current binding is not providing the brightness channel for color bulb and the brightness of the color channel doesn’t work because the yeelight uses HSV color representation and the binding is using HSB color representation. Those color representations are just not compatible.
To add missing brightness channel is very easy, just add this line:
<channel id="brightness" typeId="brightness" />
to line 12 of the addons/binding/org.openhab.binding.yeelight/ESH-INF/thing/wonder.xml file in openhab2-addons repository and build the binding. Then the brightness channel will appear and it will work correctly.
To fix the color channel some work must be done in the code.
Hi Marek,
The version you posted works just fine!!!
Thank you.
The only issue I see is related to a set of warnings I get, anyhow they are not preventing the light to work:
2018-10-18 20:22:50.141 [ome.event.ItemCommandEvent] - Item 'Luce_Sala_Divano_RGB_dimmer' received command 100
==> /var/log/openhab2/openhab.log <==
2018-10-18 20:22:50.155 [INFO ] [nding.yeelight.lib.device.DeviceBase] - ######### this is control command response, don't need to notify status change!
==> /var/log/openhab2/events.log <==
2018-10-18 20:22:50.155 [vent.ItemStateChangedEvent] - Luce_Sala_Divano_RGB_dimmer changed from 31 to 100
==> /var/log/openhab2/openhab.log <==
2018-10-18 20:22:50.159 [INFO ] [nding.yeelight.lib.device.DeviceBase] - status = DeviceStatus [isPowerOff=false, r=255, g=94, b=214, color=16735958, brightness=100, ct=6404, hue=359, sat=100, isFlowing=false, delayOff=-1, mFlowItems=null, mode=MODE_COLOR, isMusicOn=false, name=]
2018-10-18 20:22:50.163 [INFO ] [nding.yeelight.lib.device.DeviceBase] - status = DeviceStatus [isPowerOff=false, r=255, g=94, b=214, color=16735958, brightness=100, ct=6404, hue=359, sat=100, isFlowing=false, delayOff=-1, mFlowItems=null, mode=MODE_COLOR, isMusicOn=false, name=]
2018-10-18 20:22:50.163 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler YeelightColorHandler of thing yeelight:wonder:0x00000000035b7c5c tried updating channel brightness although the handler was already disposed.
2018-10-18 20:22:50.167 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler YeelightColorHandler of thing yeelight:wonder:0x00000000035b7c5c tried updating channel color although the handler was already disposed.
2018-10-18 20:22:50.170 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler YeelightColorHandler of thing yeelight:wonder:0x00000000035b7c5c tried updating channel colorTemperature although the handler was already disposed.
I had the same warning when replacing the yeelight binding with new version. I don’t remember how i fixed it. Try to restart oh or remove all things and items related to yeelight binding and add them again
Interestingly, if I use paperui to add the yeelight thing, and copy your items but changing “bedroom2_lamp” to my channel id, then brightness works but not the other two. When trying to change colour I get this error: `
Received HTTP POST request at 'items/YeelightColour' with an invalid status value '114,80,100'.
If I manually add the thing and copy your items then brightness does nothing but the other two work.
Found the solution: changing the brightness channel to color and making it a Dimmer item
Any chance to get the second version of the color bulbs working? It is working with the mi io binding , but xiaomi supports the 2nd version on the chinese server and the chinese server does not support google home at all…
edit: it is working, missed to activate the LAN control.
i installed the openhab 2.4 with yeelight, it discover all my 7 rgbw bulbs, but only one online, after few minutes another one go online, but now all offline, from the yeelight app everything is working great
I little bit stuck. I bought a yeelight cell, successfully connect to wifi and I can control it with the app, but when I try to add to openhab, nothing happens.
Server: Mainland China or German( I tried both)
Lan control: Enabled
Same network
OH version: 2.4.0~M5-1
Yeelight fw: 1.5.9_0184
And nothing…
I try a yeelight_toolbox_3.0.1 app. It show and I can control it
openhab> java.lang.IllegalArgumentException: No enum constant com.yeelight.sdk.enums.DeviceType.ct_bulb at java.lang.Enum.valueOf(Enum.java:238) at com.yeelight.sdk.enums.DeviceType.valueOf(DeviceType.java:1) at com.yeelight.sdk.device.DeviceFactory.build(DeviceFactory.java:29) at com.yeelight.sdk.services.DeviceManager$2.run(DeviceManager.java:130) at java.lang.Thread.run(Thread.java:748)
for what it’s worth, adding them manually doesn’t work either. always “offline”