-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UPnP Broken After Restart - 0.92.2 #23728
Comments
Possibly fixed by #23763 ? |
Hey there @robbiet480, mind taking a look at this issue as its been labeled with a integration ( This is a automatic comment generated by codeowners-mention to help ensure issues and pull requests are seen by the right people. |
I think so. |
Just upgraded to 0.93.1, problem is not fixed. |
Are you certain you don't have a custom component installed?
Also, what about others, @DavidFW1960, @lweberru? |
Also still not fixed. Still devices are unavailable after a restart. |
And the other issue with the ordering, also still exists (0.93.1), the devices I get using the integration switch randomly. |
Same issue here for me. What custom_component are you asking about @StevenLooman ? I have always had custom_components. Sometimes HA starts and all devices are there, sometimes none and sometimes half are there. This only started in the HA version I stated when I originally opened that was closed prematurely. |
I activated logging:
Hope this helps |
This is unexpected, but gives another thing to try. @DavidFW1960 Modifications to upnp to test changes for this issue or any of its predecessors. |
@lweberru I've changed the I am able to reproduce the entity-unavaiable problem by:
I'm not sure if this is the same problem as you are having. From the logging by @lweberru it appears to be so. Either your router does not want to be found (too many requests/preventing attacks?) or is unable to respond in time. It is possible to increase the time allowed to search (4 seconds, as specified by the UPnP standard) to something more generous, but 4 seconds is already a lot. |
Do I just copy the whole upnp and make that a custom_component in hass.io? I'm running docker on debian so I could also edit the |
Copy the whole To enable logging for the custom component you'll have to add this to your configuration (note the first line in the
|
Ok so I have not had time to try the custom component yet @StevenLooman but with 0.94.0b4 here is the UPnP/IDG errors in the log: |
@DavidFW1960 Thanks! Your device is not responding in time (within 5 seconds.) It is likely this is also the cause for the entity unavailable. Did your router have a firmware-upgrade recently? |
It has but the issue predates that.. |
Any news within this issue? The same issue still exists. Only a manual re-add works. Can I change the timeout setting just to find out if it going into that direction? |
Sorry for the long delay, other things keep popping up. Hope to work on this soon. |
I changed the timeout value within ssdp.py from 4 to 10 secs (SSDP_MX = 10). Now it seems to work :-) |
Thank you @fabaff. |
Hi, I am experiencing exactly the same issue with my Ubiquiti Amplifi HD router. I see the sensor data if I completely reboot homeassistant. However, if I restart homeassistant the sensors no longer work.
|
What do you mean with rebooting home assistant vs restarting home assistant? It seems your router stops responding in time to requests. Does your router have a static IP? |
I use hass.io and I can either reboot the whole system (hassio) or just restart homeassistant. My router has a static IP. |
Does the rpi get a new IP when it is rebooted? |
It is still the same IP |
Another try... what if you stop home assistant, wait a few minutes, and then start home assistant? This mimics the behavior of a restart with regard to timing. It is very hard to reproduce the problem without having the device myself. I'm uncertain we will be able to fix it this way. |
See also #26869. |
Hi @StevenLooman, My router is a Fritz!Box 6590. HA is running as hass.io on a Raspi 3b. I have a feeling that this bug is still somehow connected to the name binding that you mentioned above . Here is why: Normal names start with: InternetGatewayDeviceV2 - FRITZ!Box 6590 Cable Could it be, that on HA restarts the wrong names are found and thus the known entities with the original names become unavailable? Correct device name: Correct entity names of device: |
It is possible that your router advertises multiple services. Are you able to run a command from within the virtualenv/docket/... where you run your Home Assistant? Please run this and post the results:
This will command will do a SSDP/UPnP-scan for devices in your network. Each line contains a JSON-object with information. The results will look something like this:
Please feel free to lines which are not related to your router. You can probably filter on the LOCATION-attribute, if it does not contain the IP of your router then it is not relevant. |
@StevenLooman I have "SSH & Web Terminal" by Frenck installed on my hass.io system and so I have shell access. But I do not know how to run commands from within a certain docker environment. Can you give me some advice? I would be happy to assist. |
Ok, I think I see now that you want me to run a command in a Python virtual env. But I can't find out how to do that. Using the shell? Using HA's "Python Scripts" integration? Please provide some instructions and I will proceed. Thanks. |
It seems the "SSH & Web terminal" is the best option, judging from SSH & Web Terminal in Hass.io Start a new Terminal (first screenshot in the article) and type in the command:
That should do it. PS No need to do the steps about Putty from that article. |
Hi Steven, im having the same issue with my AVM 7490 Router. output.txt Hope that helps... BTW: should we open a new issue or reopen this one (if possible)? |
Issuing
That's why I asked if I have to execute it from within one of the existing docker containers. @ObiKaiKenobi how did you manage to execute that command? |
@Jpsy Im managing my docker container with portainer. |
@Jpsy I have no exprience with hass.io so it is hard for me to help. Perhaps you can SSH into your installation by using a client such as PuTTY if you're on windows. @ObiKaiKenobi Thank you for the output. Your router advertises itself as a IGD1 and IGD2 device:
As noted by @Jpsy, this problem is properly not solved. It is hard for me to reproduce this, as my router only advertises as a IGD1 device. There is some code which tries to enforce the greatest version: core/homeassistant/components/upnp/__init__.py Lines 105 to 106 in d4615fd
My guess (pure speculation!) is that sometimes IGD2 is not discovered and IGD1 is used, which results in sensors with different names/ids and thus different sensors for home assistant. The screenshots shown by @Jpsy seem to show this. I am uncertain what to do. Perhaps we can store the IGD-version and enforce this. I.e., if IGD2 does not respond then home assistant will report no device found/integration not ready and possibly try again later. Hopefully I can experiment with this during the weekend. |
@Jpsy can you open a new issue for this? You can use the text from this comment: #23728 (comment). Also please link to this issue. |
@StevenLooman what about keeping track of the version in the device registry ? Therefore enforcing you always use the same IGD version ? |
Storing the version somewhere was my plan indeed. The device registry seems the perfect place, thank you. |
New issue opened: #33827 The new issue also contains my The problem with creating that search was, that the
|
I am seeing the same issue on latest docker container stable version 107.5 with my Vodafone Vox3 router. |
@dgomes Can further comments be closed for this issue? |
Last working Home Assistant release (if known): Unknown
Operating environment (Hass.io/Docker/Windows/etc.): Hass.io
Component/platform: UPnP (https://www.home-assistant.io/components/upnp/)
Description of problem:
I add a UPnP integration for my NetGear R8000 router, including port forwarding. This works well, and I see the sensor data and the port forwarding rules setup. However, if I restart home assistant the sensors and port forwarding no longer work. The integration says "entity unavailable". If I remove and re-add the integration, it works again. See https://gfycat.com/pertinentraggedflee for a video example.
Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant):Related Issue: #22787
The text was updated successfully, but these errors were encountered: