Yeelight "unavailable"

Hello to you all
I have HA in version 0.104.3
Installed on Windows 10 on oracle VM virtualbox (ver 6.0.16)
The internet I have at home is fiber based
And my router is a netgear orbi with a satellite extension.

Everything works fine except for one really annoying thing that I don’t find a solution,
Some equipment’s on the network constantly have errors in the log, for example:

  • Update or switch. *** is taking over 10 seconds
  • Unable to discover a device at address *. *. *. *

For yeelight-based lighting fixtures, the errors are:

  • Unable to update device *. *. *. *, Bedroom lightbulb: Bulb closed the connection.
  • Got exception while fetching the state: Unable to discover the device *. *. *. *

these errors do not seem to affect all the equipment I have on the network, except for the yeelight lighting fixtures, from time to time these lights become “unavailable”
Sometimes for a few seconds, and often until I resate them.

What I’ve checked:

  1. All my equipment has a fixed IP network
  2. All the bulbs are in a LAN mode
  3. All bulbs are connected at 2.4 Hz
  4. I have disabled history / default_config / discovery / logbook on hassio
  5. I disabled music mode at yeelight
  6. Installation from 0 leads to the same situation

Example of Yeelight config:

yeelight:
  devices:
    ! secret balcony_lightbulb_ip:
      name: balcony lightbulb
      model: color2
      transition: 3
      save_on_change: False # (defaults to False)
      use_music_mode: False
    secret bedroom_lightbulb_ip:
      name: bedroom lightbulb
      model: color2
      transition: 3
      save_on_change: False # (defaults to False)
      use_music_mode: False

Anyone have an idea or way to help? I’m really crazy here with all the “unavailable”

Thanks

2 Likes

Hi,
I have the same problem.
My Smart Home wifi is separated from the Internet, so this issue is not based on the internet connection,
especially it works in lan mode.
I have tried out to ping mí yeelight ceiling lights during they were unavailable in HA, but they responded normally.
So ATM I don’t know if it is a problem of the lights, and they does not answer in time to HA, or it is a problem of the HA yeelight component.

Same here for me…

Same here I can see the state history they seem to come on and offline constantly.

Currently none of my yeelight bulbs are working in home assistant. I’m on the latest 0.105.5 build and they’ve stayed offline for a couple of days now.

Strangely though they work fine from the yeelight app.

Make sure that the LAN Access is enabled inside of yeelight app. For me it was the case when idid reset a lamp and added it through the Xiaomi Home app, where it did not propose me to enable lan control, so i forgot about this. After i enabled lan it appeared in home assistant again.

Hi thanks, I’ve had the yeelight running for a long time with LAN enabled. The problem I’ve found is that home assistant is still not matching the Mac address of the lights. So when their DHCP lease is renewed it creates new entities. This is a shame as the lights implement SSDP for discovery with UDP multicast. The other issue is the lights disconnect a lot becoming unavailable intermittently. I have fairly consistent WiFi using multiple access points throughout my house and a fair few yeelight bulbs at different proximities to the access points. Yet, all of them suffer the same frequent disconnects of about 1 minute throughout the day. Whether this is disconnects from WiFi or just unavailability from home assistant, perhaps as a result of request throttling, I’m not sure.

1 Like

Hi,
based on, what you sad about DHCP,
I have checked my router settings and set an infinite lease time for my yeelight devices.
I think you can see when I adjusted the settings :smiley:
So, it seems to me, it works, but actually I am not satisfied with the yeelight HA component, because it should not cause this problem.
As i have mentioned i get response for ping request without any problem during DHCP renewal…

Mine occasionally do that and I switch them off and on again. Worse case I re-pair it.

Still getting this happening, I don’t understand why it doesn’t handle the mac address as a unique identifier and then just match the device if it already exists, rather than duplicate as a new device, and then increment the entity id with “_2”.

Struggling with the same issue. It worked quite well for many moths but now I see that it becomes unavailable more often. However, I don’t see that it adds a “_2”.
Would be good to know what the reason for this problem is. I also set the DHCP lease time to a much higher value but it doesn’t seems to solve the issue.

Yeelight works fine in Yeelight App, developer/lan control enabled, but it disappears from my wifi and shows as unavailable in homeassistant dashboard.

I have two of the exact same light, one works great the other doesnt. I tried resetting multiple times… not fixing the issue.

Probably WiFi not strong where that light is. If it disappears from the network of course HA will lose it as well. I do have to reset one of mine occasionally…

My yeeapp works just fine, I know the connection is there. Even shows it is connected to my wifi. But my wifi doesnt have it as a connected device and homeassistant is showing it as disconnected.

Hello there. Recently I turned off https from HA in LAN having set up Nginx and have became concerned about chinese IOT dev sniffing plain http internal traffic. So I firewalled my only Yeelight bulb and it doesn’t work anymore with HA. It always shows as unavailable. LAN mode is enabled as far as I can see in the app.

Please can someone point me in the right direction?

Below the config:

yeelight:
  devices:
    192.168.0.50:
      name: Soggiorno
      model: RGBW
      save_on_change: true

logs 1:

'NoneType' object has no attribute 'close'
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/yeelight/main.py", line 424, in send_command
    data = self._socket.recv(16 * 1024)
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1232, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1255, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    self._platforms.values(), func, call, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 412, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 600, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 443, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 243, in async_handle_light_on_service
    await light.async_turn_on(**params)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_turn_on
    await self.hass.async_add_job(ft.partial(self.turn_on, **kwargs))
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 744, in turn_on
    power_mode=self._turn_on_power_mode,
  File "/usr/src/homeassistant/homeassistant/components/yeelight/__init__.py", line 294, in turn_on
    duration=duration, light_type=light_type, power_mode=power_mode
  File "<decorator-gen-7>", line 2, in turn_on
  File "/usr/local/lib/python3.7/site-packages/yeelight/main.py", line 128, in _command
    result = self.send_command(method, params).get("result", [])
  File "/usr/local/lib/python3.7/site-packages/yeelight/main.py", line 427, in send_command
    self.__socket.close()
AttributeError: 'NoneType' object has no attribute 'close'

and logs 2:

Unable to update device 192.168.0.50, Soggiorno: Bulb closed the connection.

Hi, I also faced this issue.
For both my, devices HA sees “unavailable” state.
Yeelight Ceiling Light
LED Bulb (Color)


Are there any ideas about what I can try?

Hey guys, have got same issues. Anyone solved it for far?

Got the same issue out of nowhere. Havent found a way to fix it

Hi all.

I have this problem to.
And i think problem this:

I have this problem. Quite often my lights just spam unavailable throughout the day.

I’ve tried everything, I went from wireless to wired, I’ve changed my wifi channels. Literally everything I could think of.

I think the HA Yeelight piece is just unstable. The Yeelight app works perfectly.

1 Like

Hello,
recently, I am looking for solutions for my yee lamp which have been updated to the newest firmware, and then these lamps always disconnecting from Home Assistant. I checked everything just worked fine in the application even from outside, finally, I removed all the lamps from HA and add the new lamp with home kit accessories which HA detected. after that it’s working normally.
look at the QR code on the lamp you see numbers and just key-in following the format xxx-xx-xxx

1 Like