Yeelight binding?

Thanks @GGoblin for providing an workaround for the brightness - and for the kind remninder @clel :slight_smile:

It works for my Yeelight Color V1! There is no need for a rule - I’ve just added a dimmer item linked to the color channel:

Dimmer   Yeelight3_Brightness                 "Yeelight Color 3 - Brightness"                      (Gyeelight,Glicht)          {channel="yeelight:wonder:0x000000000XXXXX:color"}

The log is a bit strange because the value switches back to 100 after changing the brightness (to 45). Without any change of brightness of the bulb - which is ok … but can anyone explain why this happens?

2019-04-10 20:46:36.358 [ome.event.ItemCommandEvent] - Item 'Yeelight3_Brightness' received command 45
2019-04-10 20:46:36.371 [nt.ItemStatePredictedEvent] - Yeelight3_Brightness predicted to become 45
2019-04-10 20:46:36.386 [vent.ItemStateChangedEvent] - Yeelight3_Brightness changed from 100 to 45
2019-04-10 20:46:37.102 [INFO ] [light.internal.lib.device.DeviceBase] - status = DeviceStatus [isPowerOff=false, r=119, g=107, b=255, color=7826431, brightness=45, ct=4244, hue=245, sat=58, isFlowing=false, delayOff=-1, mFlowItems=null, mode=MODE_COLOR, isMusicOn=false, name=]
2019-04-10 20:46:37.120 [vent.ItemStateChangedEvent] - Yeelight3_Brightness changed from 45 to 100

Nice to hear that. Actually it is not a workaround but exactly how it is intended to be set up.

Unfortunately I cannot say what causes the log entries. Maybe there was some request sent to get the state of the bulb before the new brightness is applied and afterwards the answer gets received which then is 100.

Hello, everybody!

I have a desk lamp Xiaomi Mijia Pro
https://www.gearbest.com/blog/new-gear/xiaomi-mijia-mtjd02yl-led-desk-lamp-pro-review-smart-eye-protection-without-glaring-light-3634

It may be controlled by Yeelight app. I’ve also turned on control by LAN in this app.
I’ve checked whether it supports Yeelight WiFi Light Inter-Operation Specification by following steps.

I caught advertising messages from this lamp by Wireshark:

^yu@1<1eeEi&ykA?Eiyyu??UONOTIFY * HTTP/1.1
Host: 239.255.255.250:1982
Cache-Control: max-age=3600
Location: yeelight://192.168.1.202:55443
NTS: ssdp:alive
Server: POSIX, UPnP/1.0 YGLC/1
id: 0x0000000006485548
model: lamp2
fw_ver: 29
support: get_prop set_default set_power toggle set_ct_abx set_bright start_cf stop_cf set_scene cron_add cron_get cron_del set_adjust adjust_bright adjust_ct set_name
power: off
bright: 100
color_mode: 2
ct: 3900
rgb: 0
hue: 0
sat: 0
name:

And it can be controlled by telnet, just like this:

telnet 192.168.1.202 55443
Trying 192.168.1.202…
Connected to 192.168.1.202.
Escape character is ‘^]’.
{“id”:1,“method”:“get_prop”,“params”:[“power”, “bright”]}
{“id”:1, “result”:[“off”,“100”]}
{“id”:1,“method”:“toggle”,“params”:[]}
{“method”:“props”,“params”:{“power”:“on”}}
{“id”:1, “result”:[“ok”]}
{“id”:1,“method”:“get_prop”,“params”:[“power”, “bright”]}
{“id”:1, “result”:[“on”,“100”]}

But Yeelight binding doesn’t find the lamp.
The lamp can be added manually, but in this case the thing is in offline state, and may not be controlled.

How should I ask to add support for this lamp in the binding? Should I register issue in GitHub? What additional information is needed?
Or maybe there is some workaround?
This lamp should have 3 control channels: Brightness, ColorTemperature, Command

i manged :slight_smile:

Hi all i am having some issues with controlling this…

i am using Node-red and trying to send commands to the items
but i am not sure what to send , and it also looks like the thing is defined wrong
i am using a Yeelight ceiling light, it looks like the items that are coming from the binding are not good

can anyone give me a small exmpale even screenshot for his setup?
i am using Paper UI and BasicUI

thanks allot!

ok so i made it work with node red , if anyone needs this i hope it will help

10 different modes
3 colors, and for each 3 brightness settings, and shutdown


Node flow

[{"id":"176c58d.3e780a7","type":"openhab2-out","z":"769a52c2.f1db8c","name":"Color Temp","controller":"e7fc0463.749968","itemname":"YeelightLEDCeilingLampV5_ColorTemperature","topic":"ItemCommand","payload":"","x":1210,"y":1577,"wires":[[]]},{"id":"d263e378.c264f","type":"openhab2-out","z":"769a52c2.f1db8c","name":"Brightness","controller":"e7fc0463.749968","itemname":"YeelightLEDCeilingLampV5_Brightness","topic":"ItemCommand","payload":"","x":990,"y":1757,"wires":[[]]},{"id":"8a81d1af.24257","type":"openhab2-out","z":"769a52c2.f1db8c","name":"Power","controller":"e7fc0463.749968","itemname":"YeelightLEDCeilingLampV5_Power","topic":"ItemCommand","payload":"","x":1210,"y":1487,"wires":[[]]},{"id":"2b4a7316.08c08c","type":"mqtt in","z":"769a52c2.f1db8c","name":"","topic":"/YeeLight","qos":"2","datatype":"auto","broker":"b31d9a1b.fc5e78","x":409,"y":1597,"wires":[["7e99a090.0f464","a9da2cb1.b280f","6a7101c8.7b72a"]]},{"id":"54aff69f.f83c78","type":"switch","z":"769a52c2.f1db8c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Moon1","vt":"str"},{"t":"eq","v":"Moon50","vt":"str"},{"t":"eq","v":"Moon100","vt":"str"},{"t":"eq","v":"Sun1","vt":"str"},{"t":"eq","v":"Sun50","vt":"str"},{"t":"eq","v":"Sun100","vt":"str"},{"t":"eq","v":"Mars1","vt":"str"},{"t":"eq","v":"Mars50","vt":"str"},{"t":"eq","v":"Mars100","vt":"str"}],"checkall":"true","repair":false,"outputs":9,"x":690,"y":1597,"wires":[["9a32ad13.225bd","aeeeadac.dba1"],["9a32ad13.225bd","7e58d55b.98fa6c"],["9a32ad13.225bd","7a2eb36.915014c"],["88ac2b32.cf8438","aeeeadac.dba1"],["88ac2b32.cf8438","7e58d55b.98fa6c"],["88ac2b32.cf8438","7a2eb36.915014c"],["aeeeadac.dba1","71d1654d.6ef62c"],["7e58d55b.98fa6c","71d1654d.6ef62c"],["7a2eb36.915014c","71d1654d.6ef62c"]]},{"id":"a9da2cb1.b280f","type":"openhab2-get","z":"769a52c2.f1db8c","name":"YeeLight Power","controller":"e7fc0463.749968","itemname":"YeelightLEDCeilingLampV5_Power","x":760,"y":1480,"wires":[["2bb27994.188536"]]},{"id":"2bb27994.188536","type":"switch","z":"769a52c2.f1db8c","name":"","property":"payload.state","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"eq","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":946.7556076049805,"y":1479.6758470535278,"wires":[[],["62661651.b6cd68"]]},{"id":"62661651.b6cd68","type":"change","z":"769a52c2.f1db8c","name":"ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":1486,"wires":[["8a81d1af.24257"]]},{"id":"f4816adf.99c188","type":"change","z":"769a52c2.f1db8c","name":"OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":1440,"wires":[["8a81d1af.24257"]]},{"id":"7e99a090.0f464","type":"delay","z":"769a52c2.f1db8c","name":"Wait","pauseType":"delay","timeout":"1000","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":550,"y":1597,"wires":[["54aff69f.f83c78"]]},{"id":"9a32ad13.225bd","type":"change","z":"769a52c2.f1db8c","name":"Moon","rules":[{"t":"set","p":"payload","pt":"msg","to":"5697","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":1577,"wires":[["356f021d.179d0e"]]},{"id":"88ac2b32.cf8438","type":"change","z":"769a52c2.f1db8c","name":"Sun","rules":[{"t":"set","p":"payload","pt":"msg","to":"3700","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":1617,"wires":[["356f021d.179d0e"]]},{"id":"aeeeadac.dba1","type":"change","z":"769a52c2.f1db8c","name":"1","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":1717,"wires":[["d263e378.c264f"]]},{"id":"7e58d55b.98fa6c","type":"change","z":"769a52c2.f1db8c","name":"50","rules":[{"t":"set","p":"payload","pt":"msg","to":"50","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":1757,"wires":[["d263e378.c264f"]]},{"id":"7a2eb36.915014c","type":"change","z":"769a52c2.f1db8c","name":"100","rules":[{"t":"set","p":"payload","pt":"msg","to":"100","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":1797,"wires":[["d263e378.c264f"]]},{"id":"47f5a36c.5dec0c","type":"mqtt out","z":"769a52c2.f1db8c","name":"","topic":"/YeeLight","qos":"","retain":"","broker":"e8838d6f.5153e","x":600,"y":2100,"wires":[]},{"id":"93a58168.9deae","type":"inject","z":"769a52c2.f1db8c","name":"","topic":"","payload":"Moon1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":370,"y":2000,"wires":[["47f5a36c.5dec0c"]]},{"id":"a08558ae.ff93d8","type":"inject","z":"769a52c2.f1db8c","name":"","topic":"","payload":"Moon50","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":380,"y":2040,"wires":[["47f5a36c.5dec0c"]]},{"id":"e2899214.db49f","type":"inject","z":"769a52c2.f1db8c","name":"","topic":"","payload":"Moon100","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":380,"y":2080,"wires":[["47f5a36c.5dec0c"]]},{"id":"4c8b81cd.53979","type":"inject","z":"769a52c2.f1db8c","name":"","topic":"","payload":"Sun1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":370,"y":2120,"wires":[["47f5a36c.5dec0c"]]},{"id":"74515819.0fd3e8","type":"inject","z":"769a52c2.f1db8c","name":"","topic":"","payload":"Sun50","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":370,"y":2160,"wires":[["47f5a36c.5dec0c"]]},{"id":"75efb24e.8d384c","type":"inject","z":"769a52c2.f1db8c","name":"","topic":"","payload":"Sun100","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":370,"y":2200,"wires":[["47f5a36c.5dec0c"]]},{"id":"356f021d.179d0e","type":"delay","z":"769a52c2.f1db8c","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1000,"y":1577,"wires":[["176c58d.3e780a7"]]},{"id":"6a7101c8.7b72a","type":"switch","z":"769a52c2.f1db8c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":730,"y":1440,"wires":[["f4816adf.99c188"]]},{"id":"54566c36.fcc974","type":"inject","z":"769a52c2.f1db8c","name":"","topic":"","payload":"OFF","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":370,"y":2360,"wires":[["47f5a36c.5dec0c"]]},{"id":"71d1654d.6ef62c","type":"change","z":"769a52c2.f1db8c","name":"Mars","rules":[{"t":"set","p":"payload","pt":"msg","to":"2715","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":1657,"wires":[["356f021d.179d0e"]]},{"id":"5e98f43f.bb1c3c","type":"inject","z":"769a52c2.f1db8c","name":"","topic":"","payload":"Mars1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":370,"y":2240,"wires":[["47f5a36c.5dec0c"]]},{"id":"237e5550.2d488a","type":"inject","z":"769a52c2.f1db8c","name":"","topic":"","payload":"Mars50","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":370,"y":2280,"wires":[["47f5a36c.5dec0c"]]},{"id":"633d0e3e.53e65","type":"inject","z":"769a52c2.f1db8c","name":"","topic":"","payload":"Mars100","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":380,"y":2320,"wires":[["47f5a36c.5dec0c"]]},{"id":"c3d67cb.5295c8","type":"openhab2-in","z":"769a52c2.f1db8c","name":"","controller":"e7fc0463.749968","itemname":"MQTTtoYeeLight","x":380,"y":1907,"wires":[["47f5a36c.5dec0c","b5b9eb4f.1deec8"],[]]},{"id":"ab65f0cd.88154","type":"openhab2-out","z":"769a52c2.f1db8c","name":"","controller":"e7fc0463.749968","itemname":"MQTTtoYeeLight","topic":"ItemUpdate","payload":"null","x":730,"y":1901,"wires":[[]]},{"id":"b5b9eb4f.1deec8","type":"delay","z":"769a52c2.f1db8c","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":560,"y":1901,"wires":[["ab65f0cd.88154"]]},{"id":"3369393a.d43766","type":"comment","z":"769a52c2.f1db8c","name":"Testing","info":"Brightness 1 - 50 100\ntemp Mars,Sun,Moon\n\nMars 2715\nMoon 5700\nSun 3600\n\nOff for shutdown","x":350,"y":1960,"wires":[]},{"id":"459fe867.2c8ca8","type":"comment","z":"769a52c2.f1db8c","name":"reset OH item to Null","info":"","x":390,"y":1860,"wires":[]},{"id":"d38cf73c.bb8698","type":"comment","z":"769a52c2.f1db8c","name":"MQTT to talk to OH YeeLight thing","info":"","x":420,"y":1440,"wires":[]},{"id":"e7fc0463.749968","type":"openhab2-controller","z":"","name":"openhab","protocol":"http","host":"localhost","port":"8080","path":"","username":"","password":""},{"id":"b31d9a1b.fc5e78","type":"mqtt-broker","z":"","name":"Node red","broker":"192.168.1.103","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"e8838d6f.5153e","type":"mqtt-broker","z":"","name":"","broker":"192.168.1.103","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

my site map for it

Text label=“YeeLight” icon=“settings” {

Switch item=MQTTtoYeeLight label=“OFF” icon=“light” mappings=[OFF=“OFF”]

Switch item=MQTTtoYeeLight label=“Moon” icon=“light” mappings=[Moon1=“Easy”,Moon50=“Med”,Moon100=“High”]

Switch item=MQTTtoYeeLight label=“Sun” icon=“light” mappings=[Sun1=“Easy”,Sun50=“Med”,Sun100=“High”]

Switch item=MQTTtoYeeLight label=“Mars” icon=“light” mappings=[Mars1=“Easy”,Mars50=“Med”,Mars100=“High”]

}

Hi! Is there any way to get rid of messages in the log?

2019-09-10 18:54:15.280 [INFO ] [light.internal.lib.device.DeviceBase] - ######### this is control command response, don't need to notify status change!
2019-09-10 18:54:15.283 [INFO ] [light.internal.lib.device.DeviceBase] - status = DeviceStatus [isPowerOff=true, r=0, g=0, b=0, color=0, brightness=99, ct=4000, hue=0, sat=0, isFlowing=false, delayOff=-1, mFlowItems=null, mode=null, isMusicOn=false, name=]
2019-09-10 18:54:15.956 [INFO ] [light.internal.lib.device.DeviceBase] - ######### this is control command response, don't need to notify status change!
2019-09-10 18:54:15.990 [INFO ] [light.internal.lib.device.DeviceBase] - status = DeviceStatus [isPowerOff=true, r=0, g=0, b=0, color=0, brightness=100, ct=4000, hue=0, sat=0, isFlowing=false, delayOff=-1, mFlowItems=null, mode=null, isMusicOn=false, name=]
2019-09-10 18:54:19.688 [INFO ] [light.internal.lib.device.DeviceBase] - ######### this is control command response, don't need to notify status change!
2019-09-10 18:54:19.691 [INFO ] [light.internal.lib.device.DeviceBase] - status = DeviceStatus [isPowerOff=false, r=0, g=0, b=0, color=0, brightness=100, ct=4000, hue=0, sat=0, isFlowing=false, delayOff=-1, mFlowItems=null, mode=null, isMusicOn=false, name=]
2019-09-10 18:54:20.866 [INFO ] [light.internal.lib.device.DeviceBase] - ######### this is control command response, don't need to notify status change!
2019-09-10 18:54:20.872 [INFO ] [light.internal.lib.device.DeviceBase] - status = DeviceStatus [isPowerOff=false, r=0, g=0, b=0, color=0, brightness=99, ct=4000, hue=0, sat=0, isFlowing=false, delayOff=-1, mFlowItems=null, mode=null, isMusicOn=false, name=]
2019-09-10 18:54:22.077 [INFO ] [light.internal.lib.device.DeviceBase] - ######### this is control command response, don't need to notify status change!
2019-09-10 18:54:22.080 [INFO ] [light.internal.lib.device.DeviceBase] - status = DeviceStatus [isPowerOff=false, r=0, g=0, b=0, color=0, brightness=100, ct=4000, hue=0, sat=0, isFlowing=false, delayOff=-1, mFlowItems=null, mode=null, isMusicOn=false, name=]

there are a lot of them :frowning:

Hi I have this Yeeligth ceiling Lamp

But the yeelight binding is not working any ideas?

I’m facing this issue too.
My bulb worked well for some time but went off yesterday and didn’t come back :frowning:

I’m running oH2.4 stable on Raspi3b (openhabian).

how can i activate the nightmode on the yeelight ceiling light?
has someone a rule for that?

It seems like snapping is no longer supported, most are switching to xiaomi mi io binding

i have this problem when the bulbs and ceilings loose the wlan connection.
when i restart my access point, the light will not reconnect, than i need to remove the lights from current and plug in again.
check this, maybe you has the same, when the wlan is stable (when i do net restart anything), it runs for months!

Probably facing a similar issue like many here. Moved to a new flat, trying to get yeelight bulbs and lamps to work again.

Upgraded to opengab 2.5.2, deleted cache and tmp, reinstalled yeelight binding. No bulbs or lamps are discovered. Adding them manually keeps them in offline state.

Xiaomi IO binding discovers all devices immediately and by adding their token, they are well shown as online devices.

Any news on this issue?

Thanks to you all.

The binding does not support Led Stripe v2 model YLDD04YL.
Not showing the needed controls. OH2.5.8

Can somone helo me ?

I Install the 2.4.0 and have an error:

[ERROR] [org.openhab.binding.yeelight ] - bundle org.openhab.binding.yeelight:2.4.0.201901201725 (211)[org.openhab.binding.yeelight.internal.discovery.YeelightDiscoveryService(218)] : Could not load implementation object class org.openhab.binding.yeelight.internal.discovery.YeelightDiscoveryService

Can somone tell me how to fix it?

Hi,

the same problem persist when i restart openhab or my PI. After what i must disconnect power connection to the bulbs. Is there already a solution to the problem?

Hi Openbabianz,
a new version of the yeelight bulb has come out, the product name is 1SE…is a very nice rgb lamp with 680 lumens, it’s cheap, it cost about 12 €/$.
Unfortunately the binding is not able to recognize it and even adding the parameters manually it is not possible to make it work …
Do you think something can be done? Or do you know if it will be possible to add the lamp with the binding in the future?
Thanks for your attention…
Marcello
ps, my system i updated to 2.5.10, so the binding is - binding-yeelight - 2.5.10

If the yeelight binding won’t work for this model, the miio binding might be able to control this instead.
Don’t know if there is a difference in features provided by the 2 bindings.

Hi Marcel, thank you for your answer…
The Mi IO binding dont recognise this bulb, and the manual configuration need a token to work…
So im trying to extract the token, but…its hard…
If I have success…ill write here my experience…
:slight_smile:

With the more recent versions of the binding, getting tokens should be very easy. (they are pulled from the cloud when you enter your credentials)
What is the model (reported in the miio binding, not the commercial name) that your yeelight is reporting that is not supported, we can easily add it. (in the mean time, you can replace the model in the config with yeelink.light.color1 which will most likely work just fine)