Control Item (Yeelight Color LED Bulb) via MQTT

Hey Peoples,

setup my openhabianpi with mosquitto broker, completed the test and all works fine.

Using the org.openhab.binding.yeelight-2.1.0 I set up a *.items file in /etc/openhab2/items with following content:


Dimmer  Yeelight_1_Neu_Brightness       "Yeelight_1_Neu_Brightness"               {channel=" yeelight:Wonder:0x0000000003708d4c:Brightness", mqtt="<[broker:Yeelight_1_Neu_Brightness:state:default], >[broker:Yeelight_1_Neu_Brightness:command:*:default]"}

Now if i send a message to the topic the slider of the dimmer changes in openhab to the value i send in the messafe data. The problem is the value of the yeelight does nothing. Brightness is the same value as before.

Log is as following when i move the slider in the paper ui:

2018-06-11 11:52:35.895 [ome.event.ItemCommandEvent] - Item 'Yeelight_1_Neu_Brightness' received command 51

==> /var/log/openhab2/openhab.log <==

2018-06-11 11:52:35.898 [INFO ] [yeelight.handler.YeelightHandlerBase] - YeelightColorHandler: command: 51

==> /var/log/openhab2/events.log <==

2018-06-11 11:52:35.913 [vent.ItemStateChangedEvent] - Yeelight_1_Neu_Brightness changed from 71 to 51

but when I Send the message via mqtt it only shows:

2018-06-11 12:56:00.229 [vent.ItemStateChangedEvent] - Yeelight_1_Neu_Brightness changed from 50 to 20

So my question is to become the behavior that I want:
Openhab Listen to mqtt messages and communicate to the smart bulb if it have to change a state.

If it works I want also Color and ColorTemperature to set up.

Thanks for your help!

If it’s the first gen of Yeelights I would rather use the Mi Home IO Binding from the Eclipse Market.
Works fine and you can adjust all Values over rules.
MQTT is fine, but don’t reinvent the wheel :wink: