Yeelight binding?

Yeelight Binding is pretty unreliable on my side.

2 of my lights are not picked up. Incidentally those are the ones furthest away from the Windows 10 machine running OpenHab, and I think communication happens via a Wifi access point connected via Lan to my main router (And access point)

Some of the others seems to go offline at random and I have no idea how to bring those online again. Sometimes restarting brings them all online but checking in after a day some are offline again.

Not sure if I need to run it on a Raspberry Pi of Linux box, rather?

Just have that problem since yesterday too - running a Raspberry Pi (without any problems before; except needed to activate WiFi on the Pi to find the bulbs).

But now it is a desaster - all bulbs offline. Yesterday, when I went to sleep there were 2 bulbs online (were offline before) ā€œKitchen 2ā€ + ā€œKitchen 3ā€. This morning (did nothing in the night) there were again 2 online, but this time ā€œKitchen 2ā€ + ā€œBath 2ā€.

I want them all to be working againā€¦ First I only had two bulbs offline: ā€œSleeping 3ā€ and ā€œLivingroom Floorā€. I deleted the ā€œLivingroom Floorā€ one to add it again, but it did not show up again. After several restarts all bulbs were offlineā€¦

Hope anybody can fix this :confused: Even a restart of the binding is flooding the consoleā€¦

Consider to switch to the Mi IO binding.

Currently Iā€™m having a mixture of both bindings and my yeelights work much more reliable with the mi io binding.

1 Like

Already thought about that. Got all other stuff running over it (including 2 bedise lamps). But my biggest problem are these tokens. I got all my Yeelight-lamps in the Yeelight app and not in the Mi Home appā€¦ That would be okay and easy with 5-10 lamps, but I got around 30 or so and that is really bad to reset them all, add them to the Mi Home app and then read out the token for each lamp. :frowning:

Arenā€™t they automatically synchronized between both apps?
Just checked mine and i have each yeelight in MiHome, as well as in the yeelight app.

As long as you are using the same mi account i think you are fine?

Interesting! I am using the same account for sure, but I do think I use the Mainland China-Server with the Mi Home (read it somewhere to do so) and the Singapore-Server with the Yeelight Appā€¦ Hmmmmā€¦

Sounds like I need to reset all my Bulbs and add them to the Yeelight App with the other Server? Or other way round do the same with the Mi Home App (2 Gateways with like 40+ devices) to the Singapore-Serverā€¦ Big ā€œhmmmmā€ā€¦

Seems like the first one is the smaller hmm :wink:

Just checked, i have both on mainland china. Maybe you could try to switch the Server in the yeelight app. Perhaps the bulb information get transferred?

Dunnoā€¦

I think I had both of them on Mainland China too at first, but updates for the Yeelights were only rolled out on Singapore or something. There was a cause why I did that - I am pretty sure about that. Guess I will need to do something, but I do not understand what is wrong now. First try will be a new sd card with a clean install. I want to have 2 sd cards in future to mirror each other and just replace it, when a update crashes anything - dont want that againā€¦


Edit: Just switched the server of the Yeeligh app to Mainland China without doing anything else and then back. After that there were updates available, but only for some lamps. I clicked to update all and he said that they already have the newest version and now comes the interesting part: these lamps, where the update was shown, are back onlineā€¦ I still do not understand it, but I like it. 7 of 26 are back online (thought I have more :smiley: ).

I do have errors with the Yeelight binding, but it seems like the problem is not the binding itself?.. makes it more confusingā€¦


Edit 2: Had the same update-thing for the rest of the bulbs, but they are still not workingā€¦ Guess it has to do something with the bulbs - at least that is my guess now.


Update: I moved all Yeelights to the Mainland China Server. When I moved them they were working fine. After a restart all bulbs were offline again. After that I moved 2 bulbs to American Server and they are online againā€¦ after a restart, you are already gussing it - goneā€¦ Can someone make up anything out of this information? Bad SD?

I did not went to buy one, because I thought this can maybe fix it, but at latest on the weekend I will make a fresh install and try it. To me it seems like the binding is loosing the tokens of the Yeelights and cannot get them back? Does anybody know where they are stored or are here no tokens required?..


Update 2: After several restarts of the bulbs (on/off wallswitch) all bulbs were working. After some time (half an hour) many bulbs are gone again with having the name ā€œā€ in the thing overviewā€¦ I already ordered a SD and will try a fresh install on the weekendā€¦

I wonder why nobody else has these problemsā€¦

I made a fresh installl in the last 4 hours and I still have the offline problem. I still do not know what the problem is and I guess that I will need to switch the Bindingā€¦

Iā€™m not actually sure that anybody is really using the bulbs with OpenHab reliably.

One aspect that I wonder about is whether your wifi setup plays a big role. I have two APs ā€“ one in my study which is connected to the PC running OpenHab, and then another in another. Both share the same SSID and are connected over LAN. They are different channels though.

Two of my builbs I never pick up using the Yeelight binding and my guess is those are on the different Wifi AP.

The rest I pick up but they go offline basically at will.

Iā€™ve extracted all the tokens for my light, planning on trying the Mi binding next.

I used them with openHAB 2.1 without any problems at allā€¦ But I had a problem with the astro binding and therefore I upgraded to 2.2.

I think I found that errorā€¦ look at the first error from post 100ā€¦

java.lang.IllegalArgumentException: No enum constant com.yeelight.sdk.enums.DeviceType.bslamp1

See that ā€œbslamp1ā€?.. The Yeelight-App was not working, when I first installed our new bedside-lamps (but hours later after a restart)ā€¦ f***! I spent like 15 hours with reinstalling, try different versions and so onā€¦ I even switched all my bulbs from Singapore to China Server (way worse performanceā€¦ - want to switch them back)ā€¦

So if anybody encounter the same problem - now you know what it is. I will now use a backup and try it with the bedside lamps deleted out of the ā€œYeelightā€-app.

Also tried the Mi Io Binding for a moment (using it already for vacuum and power strips), but there is totally missing that brightness 0 = OFF. At least I think so.

I have a similar issue with the Mi Desktop lamp ā€“ it works perfectly in the Yeelight app, yet the binding has no support for it.

No chanceā€¦ hope it only was that, but it did not helpā€¦

22:52:07.877 [DEBUG] [org.openhab.binding.yeelight         ] - ServiceEvent UNREGISTERING - {org.eclipse.smarthome.config.discovery.DiscoveryService}={component.name=org.openhab.binding.yeelight.internal.discovery.DiscoveryService, component.id=229, service.id=363, service.bundleid=228, service.scope=bundle} - org.openhab.binding.yeelight
22:52:07.904 [DEBUG] [org.openhab.binding.yeelight         ] - ServiceEvent UNREGISTERING - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={component.name=binding.yeelight, component.id=230, service.id=364, service.bundleid=228, service.scope=bundle} - org.openhab.binding.yeelight
22:52:07.928 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x0000000000c91375' changed from OFFLINE to UNINITIALIZED
22:52:07.939 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x0000000000c91375' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
22:52:07.943 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x0000000000d09938' changed from OFFLINE to UNINITIALIZED
22:52:07.952 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x0000000000d09938' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
22:52:07.956 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x0000000000d09a4d' changed from OFFLINE to UNINITIALIZED
22:52:07.964 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x0000000000d09a4d' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
22:52:07.970 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x000000000361d756' changed from OFFLINE to UNINITIALIZED
22:52:07.978 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x000000000361d756' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
22:52:07.981 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x0000000000c960c4' changed from OFFLINE to UNINITIALIZED
22:52:07.990 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x0000000000c960c4' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
22:52:08.013 [DEBUG] [org.openhab.binding.yeelight         ] - BundleEvent STOPPING - org.openhab.binding.yeelight
22:52:08.024 [DEBUG] [org.openhab.binding.yeelight         ] - BundleEvent STOPPED - org.openhab.binding.yeelight
22:52:08.030 [DEBUG] [org.openhab.binding.yeelight         ] - BundleEvent STARTING - org.openhab.binding.yeelight
22:52:08.053 [DEBUG] [org.openhab.binding.yeelight         ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={component.name=org.openhab.binding.yeelight.internal.discovery.DiscoveryService, component.id=231, service.id=365, service.bundleid=228, service.scope=bundle} - org.openhab.binding.yeelight
22:52:08.063 [DEBUG] [org.openhab.binding.yeelight         ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={component.name=binding.yeelight, component.id=232, service.id=366, service.bundleid=228, service.scope=bundle} - org.openhab.binding.yeelight
22:52:08.069 [DEBUG] [org.openhab.binding.yeelight         ] - BundleEvent STARTED - org.openhab.binding.yeelight
22:52:08.126 [INFO ] [.yeelight.handler.YeelightHandlerBase] - YeelightWhiteHandler: initialize
22:52:08.132 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x0000000000c960c4' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
22:52:08.136 [DEBUG] [.yeelight.handler.YeelightHandlerBase] - YeelightHandlerBase: channelLinked -> Brightness
22:52:08.136 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x0000000000c960c4' changed from INITIALIZING to OFFLINE
22:52:08.139 [INFO ] [.yeelight.handler.YeelightHandlerBase] - YeelightWhiteHandler: initialize
22:52:08.140 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x0000000000d09a4d' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
22:52:08.145 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x0000000000d09a4d' changed from INITIALIZING to OFFLINE
22:52:08.145 [INFO ] [.yeelight.handler.YeelightHandlerBase] - YeelightWhiteHandler: command: REFRESH
22:52:08.148 [INFO ] [.yeelight.handler.YeelightHandlerBase] - YeelightWhiteHandler: initialize
22:52:08.151 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x0000000000d09938' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
22:52:08.150 [DEBUG] [.yeelight.handler.YeelightHandlerBase] - YeelightHandlerBase: channelLinked -> Brightness
22:52:08.155 [INFO ] [.yeelight.handler.YeelightHandlerBase] - YeelightWhiteHandler: command: REFRESH
22:52:08.156 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x0000000000d09938' changed from INITIALIZING to OFFLINE
22:52:08.162 [DEBUG] [.yeelight.handler.YeelightHandlerBase] - YeelightHandlerBase: channelLinked -> Brightness
22:52:08.164 [INFO ] [.yeelight.handler.YeelightHandlerBase] - YeelightWhiteHandler: command: REFRESH
22:52:08.165 [INFO ] [.yeelight.handler.YeelightHandlerBase] - YeelightWhiteHandler: initialize
22:52:08.167 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x0000000000c91375' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
22:52:08.170 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x0000000000c91375' changed from INITIALIZING to OFFLINE
22:52:08.170 [DEBUG] [.yeelight.handler.YeelightHandlerBase] - YeelightHandlerBase: channelLinked -> Brightness
22:52:08.172 [INFO ] [.yeelight.handler.YeelightHandlerBase] - YeelightWhiteHandler: command: REFRESH
22:52:08.173 [INFO ] [.yeelight.handler.YeelightHandlerBase] - YeelightWhiteHandler: initialize
22:52:08.175 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x000000000361d756' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
22:52:08.179 [DEBUG] [.yeelight.handler.YeelightHandlerBase] - YeelightHandlerBase: channelLinked -> Brightness
22:52:08.179 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'yeelight:Dolphin:0x000000000361d756' changed from INITIALIZING to OFFLINE
22:52:08.180 [INFO ] [.yeelight.handler.YeelightHandlerBase] - YeelightWhiteHandler: command: REFRESH

Dont know what to do nowā€¦ with the Mi IO Binding I need to adjust soooo many rules :confused:

Seems like the yeelight binding works better if Raspberry is connected via WLAN.
I tried it, but messed up switching it back - I just didnā€™t get it. So I had to reinstall and restore a backup.
The Yeelight Binding as it is, is just not working.

The MIIO Binding finds my things, but I messed up extracting the IDs. So also canceled that one.

Rework of the yeelight binding would really be appreciated.
thank you in advance!

when i try to send command to the ā€œcolorā€ item, im getting error:
2018-02-04 22:34:30.997 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'YeeLightMotion Trigger at night': Value must be between 0 and 100

the command

yeetest.sendCommand("1,191,255")

and item:

Color yeetest "Color" <colorlight> {channel="yeelight:Wonder:0x0000000002bdfea1:Color"}

any ideas?

@kubawolanin first of all thank for your work about the yeelight, Iā€™m still a rookie for the openhab system, Iā€™ve installed openhabian on raspberry pi3 and I still have a lot of problems with the yeelight. I have 2 celling light rightly configured on the app and on the MiHome app (mailnad china server and in developer mode active) Iā€™ve triyed to use the binding org.openhab.binding.yeelight-2.1.0-SNAPSHOT.zip from costerli but itā€™s impossible to find any lamp. Take in consideration that:

the version of openhab is openhab2.2
only Myopenhab cloud service is intalled
the openhab working on the wlan interface of raspberry
iā€™ve just copied the file in the addon folder as ZIP and also iā€™ve tried with jar extension
the Yeelight binding is visible and it seems to work but by in box in paper ui the scan return no things
the lamps works rightly and in the past Iā€™ve already controlled it using Domoticz

So by the ssh console the status of the service return this error/warning:

openhabpi karaf[2960]: java.lang.IllegalArgumentException: No enum constant com.yeelight.sdk.enums.DeviceType.celing1
openhabpi karaf[2960]: at java.lang.Enum.valueOf(Enum.java:238)
openhabpi karaf[2960]: at com.yeelight.sdk.enums.DeviceType.valueOf(DeviceType.java:1)
openhabpi karaf[2960]: at com.yeelight.sdk.device.DeviceFactory.build(DeviceFactory.java:29)
openhabpi karaf[2960]: at com.yeelight.sdk.services.DeviceManager$2.run(DeviceManager.java:130)
openhabpi karaf[2960]: at java.lang.Thread.run(Thread.java:748)

It seems that the system isnā€™t able to know the lamp (devicetype), as iā€™ve read in other post seems that other guy have taken the same problem with other type of lamp (as bulb or strip). What Can I do to find and command my lamps? Are you completly sure that the binding is ok for openhab 2.2? Do I need other binding or special settings (lib, option, cfg file)? Please help me.
Thank you very much for your help

@arripeo Iā€™m not the author of this binding :slight_smile: @coasterli is.
And @marcel_verpaalen is working on a generic Miio binding that talk with Yeelights as well! You can check it in the Marketplace.

I have yeelight binding installed with a textual configuration and it works properly.
See the https://docs.openhab.org/introduction.html for more details on how to configure your Things and Items.
Cheers

Thanks for your time i will ask also to @coasterli

Thanks @marcel_verpaalen for the answer ā€¦ not sure how I could send custom command tho ā€¦ Should I create map (.map file) or is there another way?