After upgrading HA to 0.115.0b8, all yeelight bulbs just stopped working. There is 'entity not avaiable' text.
Lights were working for more than one year with this configuration, and I did several HA upgrades in this time.
configuration.yaml
# Yeelight config
discovery:
ignore:
- yeelight
yeelight:
devices:
172.16.15.1:
name: Lamp1
172.16.15.2:
name: Lamp2
172.16.15.3:
name: Lamp3
172.16.15.4:
name: Lamp4
2020-09-13 15:20:18 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to get capabilities from 172.16.15.3: timeout
2020-09-13 15:20:18 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to import 172.16.15.3: cannot connect
2020-09-13 15:20:18 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to get capabilities from 172.16.15.1: timeout
2020-09-13 15:20:18 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to import 172.16.15.1: cannot connect
2020-09-13 15:20:18 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to get capabilities from 172.16.15.2: timeout
2020-09-13 15:20:18 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to import 172.16.15.2: cannot connect
2020-09-13 15:20:18 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to get capabilities from 172.16.15.4: timeout
2020-09-13 15:20:18 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to import 172.16.15.4: cannot connect
I tried to restart bulbs and router, but nothing changed.
I tried to disable firewall, nothing changed.
All bulbs are on latest firmware (2.0.6_0065)
Bulb model: YLDP06YL
I tried to add bulb via ip with integration module, but the error is 'failed to connect'
HA upgrade procedure was same as many times before, I'm using homeassistant/raspberrypi4-homeassistant image
For now, switching to stable, as latest stable version works fine (0.114.4).
cc @shenxn
@sysoppl When running 0.144.4, are there any error logs? According to the old code, it seems that the integration can still be marked as initialized even if get_capabilities
failed.
No errors shown up on 0.144.4
@sysoppl It seems that the new and old version uses exactly the same way to get capabilities. Can you enable and provide debug logs?
I removed some personal information
@sysoppl When running 0.144.4, are there any error logs? According to the old code, it seems that the integration can still be marked as initialized even if
get_capabilities
failed.
I have similar issues while running 0.144.4, mine is led color stripe(S1) with firmware 2.0.6_0009 and my light is nvever go back online after I restart my HA. following are my logs:
Logger: homeassistant
Source: components/yeelight/__init__.py:320
First occurred: 涓婂崍2:26:40 (6 occurrences)
Last logged: 涓婂崍2:37:10
Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/yeelight/main.py", line 463, 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/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(self.args, *self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/yeelight/__init__.py", line 161, in update
device.update()
File "/usr/src/homeassistant/homeassistant/components/yeelight/__init__.py", line 358, in update
self._update_properties()
File "/usr/src/homeassistant/homeassistant/components/yeelight/__init__.py", line 320, in _update_properties
self.bulb.get_properties(UPDATE_REQUEST_PROPERTIES)
File "/usr/local/lib/python3.8/site-packages/yeelight/main.py", line 412, in get_properties
response = self.send_command("get_prop", requested_properties)
File "/usr/local/lib/python3.8/site-packages/yeelight/main.py", line 466, in send_command
self.__socket.close()
AttributeError: 'NoneType' object has no attribute 'close'
@sysoppl Can you get debug log on 0.144.4 as well? That would be helpful. You can use
logger:
default: info
logs:
homeassistant.components.yeelight: debug
yeelight: debug
so that you don't get debug logs from other integrations.
Also, is your HA in the same subnet as your yeelight devices? If so, is the discovery working? Trying setting up through UI and leave the host
field empty to see if you got any luck.
@tkmark If your problem happens on 0.144.4, then it is most likely not related to this issue. Try restart your yeelight device. If the problem still exists, create a new issue for that.
Here is log from 0.144.4: home-assistant.log
Lights are set on 172.16.15.x, HA is set on 172.16.2.x, subent is /20
I have no yeelight integration module in 0.144.4, on 1.115.0b8 it shows an error 'failed to connect'
For me, it's the same if HA is in 192.168.100.x and the light is in 192.168.1.x it doesn't, but it worked properly before.
@sysoppl Thanks for the log. I've figured out the problem. In 0.144.4, the integration does not check for the result of get_capabilities
. So everything works fine even get_capabilities
timed out. get_capabilities
uses the discovery protocol so when your HA and yeelight devices are not in the same subnet, this may not work. Everything else uses TCP based socket so they work well. I'll try to fix this tomorrow.
Thank you very much
Same here ... Tnx for future fix .
Same here. Thanks for the fix
For me the fix was to add the devices again over the configuration -> integration tab and search for Yeelight.
My devices are available again
Same here. Thanks in advance for the fix.
@FaserF I was unable to add them again. I keep getting a "Failed to connect" error.
Same here. Thanks in advance for the fix.
@FaserF I was unable to add them again. I keep getting a "Failed to connect" error.
I have the same problem
I create a PR (#40251) to fix this issue. Sorry for the inconvenience. We'll try to merge and release this as soon as possible.
@shenxn - I have the exact same problem described in this issue, with the same error messages. But my HASS and the yeelight bulbs are on the same subnet. So, why do you think the discovery problem may be failing? If I try to manually add the integration via Home Assistant -> Configurations -> + button, and I leave the "Host" field empty, it says that it cannot find any devices.
For me the issue is fixed with 0.115.2
@t-anjan Do you happen to have HASS running within a Docker Container without Host Networking?
@jcarvalho thanks for the tip, my HA was not using host networking.
Not fixed for me with 0.115.2, had to revert back to 114.2 again
I create a PR (#40251) to fix this issue. Sorry for the inconvenience. We'll try to merge and release this as soon as possible.
this one fixed my issue, i was able to add but there's no device nor entity even when discovery/zeroconf is configured. Thanks for this.
@t-anjan Do you happen to have HASS running within a Docker Container without Host Networking?
@jcarvalho - I am running Home Assistant using Hass.io . Not manually setup using Docker. So, not sure how I should check if host networking is enabled.
I create a PR (#40251) to fix this issue. Sorry for the inconvenience. We'll try to merge and release this as soon as possible.
Hi,
I have the same issue and thanks for looking into this. Any update on the merge? will it make the next release?
Thanks.
Same issue here, sometimes work, sometimes not. I use the lights in the same network as HA
@t-anjan Do you happen to have HASS running within a Docker Container without Host Networking?
@jcarvalho - I am running Home Assistant using Hass.io . Not manually setup using Docker. So, not sure how I should check if host networking is enabled.
To find out the networkmode the container is using, use this command in the shell
docker container inspect <hass.io container name> | grep -i networkmode
If the container runs in host mode, it will give you 'host', if it runs in any other mode, it will return something else.
I'm not sure if my issue is the same or a different one:
After upgrading to 0.155.2, my Yeelights were still there and functioning (except for the issues I'm having with the bedside lamps that they go unavailable for ~30s 3-5 times per hour and come back).
But because of these bedside lamp issues, I wanted to try the new way of adding Yeelight devices via the integrations page.
So I tried removing all the devices, removed loading my yeelight.yaml, restarted HA and made sure all devices and entities were gone and then tried adding them via the integrations tab. After a bit of pain (not all devices were found automatically and sometimes it said "added configuration for device", but it added no entity and no device. it was like an empty device) I could get them all added using the auto discovery.
But: When I restart HA, they're all unavailable. Not a single one is usable, even after two more restarts. I also tried removing a device, restart HA, disconnect the light, connect it again, added it again using the integrations page: It worked, but after restart again: unavailable in HA.
I see them all in my routers network devices list: They are there / online.
Also no error in the logs, beside this error which I see for all devices since 0.115.2:
2020-09-25 10:24:37 ERROR (MainThread) [homeassistant.components.yeelight] Failed to get capabilities from 192.168.178.27
2020-09-25 10:24:37 ERROR (MainThread) [homeassistant.components.yeelight] Failed to get capabilities from 192.168.178.24
My yeelight.yaml only has a three custom_effects, but no device configured there manually; nothing to see here.
I make a snapshot of this now and then go back to my snapshot before I did the switch to get them added via integrations page. So if there are any questions / something I can research/help with, I can load this snapshot again and test.
Thx for the help!
[EDIT] If it may help, these are my Yeelights, various different models:
Same here on 0.115.2, I have two ceiling3 lamps, one is discovered the other isn't, so I had to add it manually via integration->yeelight->add host
EDIT: Previously had this issue on 114
Same problem after upgrade from 1.114.4 to 1.115.2. All my bulbs doesn't work.
But sometimes Bedside lamp, and one of "old version" of LED strip works.
The fix for this issue https://github.com/home-assistant/core/pull/40251 is not merged yet, so I don't see why upgrading to 0.115.2 would fix it.
We have to wait until it's merged and a version with the fix is released
Apologies, I have not seen the fix / post in this thread! Thx for the fast fix and will wait until it's merged!
To find out the networkmode the container is using, use this command in the shell
docker container inspect <hass.io container name> | grep -i networkmode
If the container runs in host mode, it will give you 'host', if it runs in any other mode, it will return something else.
@rutgersmit - Where do I need to run this command? I don't seem to be able to get access to the host OS command line at all. When I SSH into the RPi, it seems to take me directly inside home assistant core. The docker command itself is not found here.
Edit: I finally ended up just connecting a keyboard and monitor to the RPi directly and accessed the host console. The network mode showed as "Host". So, I guess that is not the problem why home assistant cannot find my yeelight bulbs.
That's how you can get ssh access to the host system: https://developers.home-assistant.io/docs/operating-system/debugging/#ssh-access-to-the-host
In my case all the yeelight devices and the server are in the same network, but the problem is with the firewall: yeelight devices send their ssdp response to the same port they received the request from, right?
tcpdump shows that the yeelight package(which is used under the hood of the yeelight integration) always uses random ports to send it's discovery requests. Therefore it's simply impossible to configure the firewall in a way that allows receiving responses from the devices.
@zhulik Yes I think that is the problem. The SSDP packets uses UDP instead of TCP. The fix is going to take some time since without SSDP packets we cannot get device IDs so there are some unique ID migrations that make the PR a little complicated.
@zhulik @shenxn - If the issue is that the firewall on all routers will block the yeelight integration from working, how is it working for some users? I have a pfSense router. Is there anything I can do to make this work? My lights have not been working for months now on HA...
@t-anjan for anyone not using a firewall on their pi it should work.
I'm not using a pi, home assistant is running on my home server that also does firewalling and routing: I'll try this afternoon if it works using some creative firewalling: Allowing all udp traffic from a yeelight ip should work if this is the case.
For anyone looking for a quick workaround on Linux, after hours of looking around for a solution the only thing that worked for me was allowing traffic from the bulb IP via firewall.
sudo ufw allow from 192.168.0.XXX
After that I easily added my lights via the integrations menu, worked for my lightstrip as well as colour bulb.
Probably not the safest way I assume but it does the job for now.
@zhulik @shenxn - If the issue is that the firewall on all routers will block the yeelight integration from working, how is it working for some users? I have a pfSense router. Is there anything I can do to make this work? My lights have not been working for months now on HA...
You can make a rule to allow traffic from your lights ip to the home assistant ip.
Any workaround for people running multiple subnets?
I'm running HA over wireguard, so allowing Multicast traffic is not an option 馃憥
Any workaround for people running multiple subnets?
I'm running HA over wireguard, so allowing Multicast traffic is not an option -1
Probably not what you want to hear but if you're running HA with docker, just revert back to 0.114.2. Personally I just pinned my HA image to home-assistant:0.114.2 and I will update when this issue is resolved. Sorry if this doesn't apply to you :)
Same here :) Just rolled back. But as every component that is migrated to using multicast discovery breaks in my setup, I'm keeping a close look on the progress to avoid surprises on the next update.
If I know it in time, I can still buy other equipment that doesn't require multicast discovery :)
Worked fine for me on 0.115.x but currently on 0.116.1 and yeelight states are unavailable. Thinking about downgrading.
@Milzor If it works for you on 0.115.x, then your issue might be related to #41507, which is already fixed and will be released in 0.116.2.
I just installed 0.116.2 and I'm still having the problem of my lights not showing up. I was on 0.114.something earlier and there it worked.
Few days ago I upgraded to 0.116.1? I think and it was broken there so I downgraded back to 0.114.something, now I'm reading multiple issues of 0.116.2 containing the fix, but seems to not work for me atleast.
Failed to get capabilities from 192.168.178.33: timeout
Failed to get capabilities from 192.168.178.39: timeout
Failed to get capabilities from 192.168.178.34: timeout
Failed to get capabilities from 192.168.178.32: timeout
Failed to get capabilities from 192.168.178.31: timeout
Failed to import 192.168.178.33: cannot connect
Failed to import 192.168.178.39: cannot connect
Failed to import 192.168.178.34: cannot connect
Failed to import 192.168.178.32: cannot connect
Failed to import 192.168.178.31: cannot connect
I just installed 0.116.2 and I'm still having the problem of my lights not showing up. I was on 0.114.something earlier and there it worked.
Few days ago I upgraded to 0.116.1? I think and it was broken there so I downgraded back to 0.114.something, now I'm reading multiple issues of 0.116.2 containing the fix, but seems to not work for me atleast.
#40251 is not yet merged as I see it.
15 days since a review of the latest changes in #40251 was requested and still nothing.
I just tested the version of #40251 and it works great. I don't get why it takes so long to add this to a bugfix release.
For anyone who does not know, if you want to temporarily fix the issue using this PR, you can download this repo and copy the contents of homeassistant/components/yeelight
in your install in custom_components/yeelight
.
Then you can setup up this integration as usual from the frontend. When the bugfix is finally merged, just delete the custom_component and update HA.
Same on 117.5 yeelight YLXD01YL
2020-11-08 17:08:26 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to get capabilities from 192.168.2.186: timeout
2020-11-08 17:08:26 ERROR (MainThread) [homeassistant.components.yeelight.config_flow] Failed to import 192.168.2.186: cannot connect
Will be fixed in 0.118 read the PR
Most helpful comment
I create a PR (#40251) to fix this issue. Sorry for the inconvenience. We'll try to merge and release this as soon as possible.