Yeelight lights disappeared from HASS (but are present in Yeelight app)

Same issue here. I have one Yeelight (Mi Desk Lamp). Was running on Auto discovery fine until recently. Today noticed that it finds the device and entity but it is unresponsive.

Have tried deleting the integration and reinstalling, no avail. Also tried adding it old-school via the configuration.yaml (see previous posts) also no change. Also finds the device but grayed out and with a red !.

Any clues?

Check the release notes for the last two releases. I thought I remember that Yeelight changed their API so the discovery method changed. You may need to upgrade the firmware of your look lights/bulbs.

Actually in the end I pulled the plug and plugged it back in. Bingo.

I’m seeing this issue for the past few weeks, but sometimes in the past my 4 Yeelights would drop out.
I found that removing power from them, and then back on (essentially hard reboot) would solve the issue.

Recently, there is no dice no matter what I do.

They show up in the Yeelight and Xiaomi Home apps fine.

I’m using the integration:
image

They show as “Unavailable” all the time now:
image

I had exactly the same problem that you’re describing with the Yeelight integration. My existing Yeelight bulbs (a whopping two of them) started showing as unavailable in Home Assistant, with the release of 0.116 (I think, there’s another thread with specific version details).

The bug required considerable discussion, because it was due to enhancing the integration, but changing the technique for discovery, or something like that. And the obvious fix had issues with HA dev conventions, IIRC. So the code improvements didn’t get into the main Home Assistant release until 0.118. And so my lights were out of commission for a couple releases. (I simply used the Yeelight app when I needed them.)

However, yesterday, after #finally upgrading to 0.118.4 (I was on 0.117.x), the problem has gone away entirely.

What’s kind of interesting is, while those lights were out of commission, a new Yeelight I added (a bedside table lamp that is apparently not even available in the US yet, it took forever to ship from China, and all of the packaging and instructions are Chinese-only) showed up immediately in HA when I did the customary dance of connecting to the device Wi-Fi network, and pointing it at my Wi-Fi network. (iOS has a feature that makes it easy to share a credential without actually requiring you to see the device’s web UI, it’s pretty neat.)

I suspect that worked so seamlessly because of the enhanced features of the Yeelight integration. So, a temporary curse, but long term benefit. Everything’s working as expected with 0.118.4. If you’re not on the latest release of Home Assistant, do give that a try.

I’m on the latest release 118.4. I usually check the release docs, and saw something for mii was in there, wondered if this was related.

Its all broken for me, can’t get any of the lights working.
All lights are showing up in Yeelight/Xiaomi apps, have static IPs, and worked previously.

Not sure what to do apart from maybe remove them completely and start again… or roll back to a previous release.

I don’t know a whole lot about the integration, specifically, but given that you’re already on the latest release that is known to fix issues with Yeelight (that is, step #1 is covered :-), I think what I’d try is deleting one light, and see if you can re-add it. (Or, if you have a spare light you haven’t used, adding a new one.)

But maybe also search this forum for “yeelight” and see if there are any other posts that might cover the issue.

Not terribly useful, sorry!

See if you don’t have every light twice in the entities.
If so, one will work. The entity will have the number 2 at the end.
Remove the integration, restart HA, and add again.

Yeah I’ve checked that a few times before already, and just went through it again now.

No duplicate devices, entities or otherwise.

All lights show up in Xiaomi Home and Yeelight apps.

Finally got the chance to spend a little time trying to figure this thing out.

So I totally removed all Yeelight integrations, and added the manual configuration from the Yeelight page to my configuration.yaml:

yeelight:
  devices:
    192.168.178.151:
      name: Yeelight 1
      transition: 500
      model: ceiling1
      use_music_mode: true
      save_on_change: true
    192.168.178.152:
      name: Yeelight 2
      transition: 500
      model: ceiling1
      use_music_mode: true
      save_on_change: true
    192.168.178.154:
      name: Yeelight 4
      transition: 500
      model: ceiling3
      use_music_mode: true
      save_on_change: true
    192.168.178.155:
      name: Yeelight 5
      transition: 500
      model: ceiling3
      use_music_mode: true
      save_on_change: true

And when rebooted my HA to see this in the logs:

More detail:

Logger: homeassistant.components.yeelight.config_flow
Source: components/yeelight/config_flow.py:117
Integration: Yeelight ([documentation](https://www.home-assistant.io/integrations/yeelight), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+yeelight%22))
First occurred: 12:29:28 (4 occurrences)
Last logged: 12:29:28

* Failed to import 192.168.178.152: cannot connect
* Failed to import 192.168.178.151: cannot connect
* Failed to import 192.168.178.155: cannot connect
* Failed to import 192.168.178.154: cannot connect

Yet more detail:

Logger: homeassistant.components.yeelight.config_flow
Source: components/yeelight/config_flow.py:153
Integration: Yeelight (documentation, issues)
First occurred: 12:29:28 (4 occurrences)
Last logged: 12:29:28

Failed to get properties from 192.168.178.152: A socket error occurred when sending the command.
Failed to get properties from 192.168.178.151: A socket error occurred when sending the command.
Failed to get properties from 192.168.178.155: A socket error occurred when sending the command.
Failed to get properties from 192.168.178.154: A socket error occurred when sending the command.

Actual logs:

2020-12-10 12:29:28 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to get properties from 192.168.178.152: A socket error occurred when sending the command.
2020-12-10 12:29:28 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to import 192.168.178.152: cannot connect
2020-12-10 12:29:28 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to get properties from 192.168.178.151: A socket error occurred when sending the command.
2020-12-10 12:29:28 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to import 192.168.178.151: cannot connect
2020-12-10 12:29:28 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to get properties from 192.168.178.155: A socket error occurred when sending the command.
2020-12-10 12:29:28 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to import 192.168.178.155: cannot connect
2020-12-10 12:29:28 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to get properties from 192.168.178.154: A socket error occurred when sending the command.
2020-12-10 12:29:28 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to import 192.168.178.154: cannot connect

I’m still at a bit of a loss as to what is happening exactly, to cause the errors.

All 4 lights work just fine in both the Yeelight and Xiaomi Home apps.

Have they locked out access to the lights?

Ok, I finally figured it out!

Feel kinda stupid, but here is what I did.
Apparently, this is the known method to do so, but it took me some time to find out.

In the Yeelight App, each light has to individually have the “LAN Control” option switched on.
After doing so, my lights turned up:
image

In the Yeelight App (Not MiiHome or Xiaomi Home), make sure the lights are listed:

Select the little “Eject” symbol in the bottom right:

Select the “LAN Control” option, again in the bottom right:

Turn on the “LAN Control” slider in the top right:

Be aware that the slider takes a few seconds to turn on/off so it looks like nothing is happened, but wait 5-10 seconds before trying again.

After this, I was able to remove the Yeelight config from my configuration.yaml and the lights remained, and were autodiscovered after a HA reboot. :slight_smile:

What a mess.
Hopefully this will help someone else.

I had the same problem for days.
What I did and solved the problem: Changed the IP address on the configuration file to a invalid one, rebooted. When checking the logs there was an error saying that was not possible to connect (expected). Then, I changed back to the correct IP address and rebooted again.
When HA started again, the light has shown correctly. Kinda weird!

Hope it helps!

1 Like

Had a similar problem. Turned out - the IP reservation of one of my (seven) YeeLights somehow got busted, so Google Wifi assigned a new IP to that bulb (.27 instead of .20). Fixed the address in the configuration.yaml - didn’t help. Tried a lot of other things, nothing.

Finally I grep’d the whole config directory (and subdirs) for the old IP addr. Found it in the .storage/core.config_entries file. Manually changed the IP addr there, deleted home-assistant_v2.db (just in case) and reastarted HA. Fixed!

2 Likes

One easy way to clean up HA from obsolete hidden Yeelight references in those 3 files

core.device_registry 
core.entity_registry 
core.config_entries

is to first install the Samba share add-on.
Make sure it is started then access those files in Windows by going to :
\\10.0.0.53\config\.storage (replace by your HA IP)
then edit them with your favorite file editor :smiley_cat:

My suggestion: stay away from those crappy Yeelights. Whatever I do (including buying new router and WiFi AP’s); they keep on falling off the network and then require a factory reset in order to be discoverable again…

I agree : I learnt my lesson well and will never buy any Yeelight products again because of how flaky they tend to be in HA (I had bought them way before I jumped on the HA bandwagon).
My LIFX bulbs (wifi as well) have a rock-solid stability in HA (although they were more expensive but I kinda bought myself some peace of mind I guess)
Anyways, if I had to buy any new bulbs today, I would probably consider Ikea Zigbee bulbs (cheap and well discovered/stable with a Conbee stick/Deconz)