Milight binding not working in OH2

Hi @hmerk,
I have your OH1 Milight working perfectly and I’m trying to migrate to OH2, but I’ve found problems with your binding.
First, when I click on “Install” or “Uninstall” on any binding, the icon never stops spinning (this happens with every binding), I don’t know if this is normal, although the log says the binding has been installed/uninstalled. I have the log set to debug.
But when I install your binding nothing else happens. If I go to Configuration/Bindings it doesn’t appear there, and if I go to Inbox and click on “scan”, the circular arrow or “search for things”, there isn’t any trace of anything Milight there.
I’m not getting any logs related to Milight.
Also, I looked at the docs and it says: “Just use the auto discovery feature or add a thing for the binding manually by providing host and port”, but there is no indication of the syntax to manually provide the host and port.

Sorry, but I did not port the binding to oh2.

@David_Graff can you help and also update your documentation.

Hi @jjmeseguer,

if the install/uninstall routines do not work, it’s a fault of the OH2/ESH framework. Please check if the Milight Binding (the OH2 one, not the OH1 one!) is listed in the “Manually add devices” screen. There should be a “+” button on the Inbox screen to get there.

A safe way to install the binding is to download the jar file of the binding and put into the addon directory of your OH2 installation directory.


Thank you both, you were right. I updated to the last openHAB snapshot and now the binding loads correctly. FYI, in the binding list there are two Milight bindings, 1.9.0 and 2.0.0, which seem to be only one. When you click install on the 2.0.0 the spinning wheel appears in the 1.9.0. I don’t know which version is installed.
Now the auto discovery works, but I’d like to add the things manually. How can I do it?

Hi @David_Graff,
I can’t get your binding to work properly:
-Isn’t there a status and a white light property as there was before? They are much needed.

In the RGBW bulbs:
-They only switch on if I raise the brightness to 100% of if I select a color.

  • If I switch night mode on, it goes to night mode, but if I turn it back off, the light blinks once and goes back to night mode. I can only get it out of night mode switching it off by lowering the brightness to 0% or raising it to 100%.
    -If I select a color, the only way to go back to white is to click outside the color wheel (why???) in Basic UI. In Classic UI I haven’t found a way yet.
    -I haven’t found the way to make the disco mode and speed properties work.

In white (cold-warm) bulbs:
-Brightness doesn’t work. 100% or nothing.
-Turning off night mode does nothing.
-I can’t get disco mode and speed properties to work (they weren’t there in the OH1 binding and I believe this bulb doesn’t support them).

My .items:
Dimmer MiLightSalonBrillo {channel=“milight:rgbLed:ACCF239E3FC0:7:ledbrightness”}
Color MiLightSalonColor {milight=“milight:rgbLed:ACCF239E3FC0:7:ledcolor”}
Switch MiLightSalonNoche {milight=“milight:rgbLed:ACCF239E3FC0:7:lednightmode”}
Dimmer MiLightSalonDiscoMode {milight=“milight:rgbLed:ACCF239E3FC0:7:discomode”}
Dimmer MiLightSalonDiscoSpeed {milight=“milight:rgbLed:ACCF239E3FC0:7:discospeed”}

Dimmer MiLightLamparitaSalonBrillo {channel=“milight:whiteLed:ACCF239E3FC0:3:ledbrightness”}
Dimmer MiLightLamparitaSalonTemperaturaColor {channel=“milight:whiteLed:ACCF239E3FC0:3:ledtemperature”}
Switch MiLightLamparitaSalonNoche {channel=“milight:whiteLed:ACCF239E3FC0:3:lednightmode”}

Am I doing anything wrong?

Hi, @hmerk,
Is the 1.9.0 version from OH2 your version of the binding? Is it supposed to be different from the 2.0.0 version?
It doesn’t matter which one I click on install, one (I don’t know which) from @David_Graff gets installed, and I can’t get it to work.
I have also tried to install the 1.8.3 version in OH2 without luck. Could someone help me install this version, that worked correctly in OH1?

Yes. the 1.x Version was originally developed by me.
There is a quite big difference between 1.x and 2.x Binding versions as you need different binding configs in your items file.
I am on holiday actually and won’t be able to help before 9/26.

Ok, enjoy your holiday!
I’ll let you know if I haven’t got it to work when you’re back :slight_smile:

Hi @David_Graff and @hmerk,
I finally got the 1.9.0 version of the binding to work in OH2.
If you click install on it in the Paper UI the 2.0.0 version gets installed instead.
I got it to work by manually copying the binding from runtime/karaf/system/org/openhab/binding/org.openhab.binding.milight/1.9.0.b4 to the addons folder.
@David_Graff, please:
-Fix the installation issue.
-Fix the issues I described above.
-Add status and white light channels.
-Update the documentation.
Thanks both for your hard work!!!

hi @jjmeseguer

I’ve tried copying over the 1.9.0 version as you describe, but I’m still getting the same issue. Dimming on the white bulbs is pretty erratic, if I turn the ledbrightness down, the bulbs turn off. They only turn back on if brightness is set to 100%. Did you manually create items/things after installing 1.90, or use auto-discovery?

FYI @David_Graff and @hmerk:

Here’s what I’m seeing in my logs:

18:09:52.312 [ERROR] [] - Exception occured while informing handler:org.eclipse.smarthome.core.types.RefreshType cannot be cast to org.eclipse.smarthome.core.library.types.StringType

1 Like

It seem that you are still using version 2.0.0. Try to delete it from the addons folder, uninstall it from the Paper UI and then copy it again to the addons folder.
I created the items (no things needed) manually as explained in the OH1 binding wiki:

1 Like

I’m seeing the same errors in the log and I can’t get it to work properly aswell.
I use the OH2 and tried the 2.0.0 and the 1.9.0 version of the Binding, after I figured out which one was installed via the paper UI - I had the same issues as described above.

thanks @jjmeseguer. I was able to manually get the 1.9 binding working, but it doesn’t seem like items created with older bindings are able to be exposed to the Homekit service. Even after adding the [“Lighting”] tag, they don’t get discovered by iOS devices, while others do.

I guess we’ll have to wait until the issues with the binding are sorted before we can use it with OH2. I found this thread that may provide some updates.

@MACannie It seems no matter what version of the binding you click on in PaperUI it will install the 2.0 version. I believe there’s a command in the openhab2 console that outputs what bindings are running and their versions. It might be “list”, I don’t remember exactly. You can use that to see what version of the binding you have running.

@MACannie, try as I told @shaikh3 2 posts earlier: delete the binding from the addons folder, uninstall the binding from Paper UI or from the console and then copy it over again.

@shaikh3, I’ve just tried HomeKit with Milight 1.9.0 and it works. Make sure HomeKit is working and review your .items. Here’s mine:
Switch MiLightSalon “Techo mesa salón” (Salon,Luces) [ “Lighting” ] {milight=“milight1;7”}