Core: uPnP/IGD integration keeps reappearing even if ignored

Created on 13 Jun 2020  ·  28Comments  ·  Source: home-assistant/core

The problem

Every time I restart home assistant (and sometimes when the server is running) I get a "New integration discovered" notification about my router, which I don't want to set up. So every time I see it I just hit "ignore". However, they keep coming back, and sometimes they can even stack themselves (like they're for different devices). Anyway, it's pretty annoying and I would love to see it fixed.

Environment

  • Home Assistant Core release with the issue: 1.110 onwards
  • Last working Home Assistant Core release (if known): 1.109
  • Operating environment (Home Assistant/Supervised/Docker/venv): Supervised Docker
  • Integration causing this issue: UPnP/IGD
  • Link to integration documentation on our website:

Problem-relevant configuration.yaml


Traceback/Error logs


Additional information

image

upnp

Most helpful comment

same issue here they just keep stacking up it straight up does not like being ignored

All 28 comments

upnp documentation
upnp source
(message by IssueLinks)

same issue here they just keep stacking up it straight up does not like being ignored

I decided to go ahead and let it install and everytime I boot I get more and more of the UPNP configure on the same router as far as it is concerned I have 7 routers showing up on the main tile so far, I own 1 router and 18 devices showing up in the sub links of the tile

up to 9 routers now just from a reboot

up to 11 routers now

11 you say...
image

LOL awesome I finally decided I didn't need upnp enabled on the router so I shut it off at the router

Similar in that it appears as a new device on every reboot.

Seems to never actually be added correctly due to:

raceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 307, in async_unload
    hass, self
  File "/usr/src/homeassistant/homeassistant/components/upnp/__init__.py", line 144, in async_unload_entry
    del hass.data[DOMAIN]["devices"][udn]
KeyError: 'uuid:d4360ac1-149c-4aba-bed5-06b02e5da716'

Cool, we know the cause, now we need someone to fix it

@StevenLooman @frenck @balloob

Interesting. Does your router always advertise the same UDN/UUID? You can scan devices using the command upnp-client search. The command will output some JSON (one object per line) showing something like:

{"Cache-Control": "max-age=1900", "Location": "http://192.168.178.1:80/RootDevice.xml", "Server": "UPnP/1.0 UPnP/1.0 UPnP-Device-Host/1.0", "ST": "upnp:rootdevice", "USN": "uuid:upnp-InternetGatewayDevice-1_0-889ffacb9043::upnp:rootdevice", "EXT": "", "_timestamp": "2020-07-25 18:33:59.119386", "_address": "192.168.178.1:1900", "_udn": "uuid:upnp-InternetGatewayDevice-1_0-889ffacb9043", "_source": "search"}
...

This does require the (async-upnp-client)[https://pypi.org/project/async-upnp-client/] library/tool, Home Assistant should have installed it for you. You should be able to run it from withing your Home Assistant installation/Docket. If you cannot reach that, perhaps you can install it on your own system using pip install async-upnp-client.

Also, what brand is your router?

Any steps to reproduce this? I have tried several times but to no avail.

This might fix the error, but I'm unsure if this resolves the problem.

Is there a way to check the uuid of already discovered integrations? I can tell you then, whether it's the same or not

One way to do this is to look in your Home Assistant configuration directory. There is a hidden directory called .storage. In that directory you can find the file core.config_entries.

There might be other ways to do this, although I am not certain.

I would just like to add to this thread that I have the same situation: my ISP's router is regularly showing up with as "New device discovered", and although I always ignore it, I have now about 50+ ignored (the same) router instances in my "Show ignored integrations" list:
Ignored-multiple
Every time that, same router, (prior to my "ignore it" action) shows up as Broadcom ADSL router:
Ignored-Broadcom.

As @StevenLooman suggested, I found multiple but the same, (every one of them with different uuid) devices showing up in my core.config_entries list:
ignored-json

At last, my question here is: can i remove that bunch of configuration entries, and wlll it affect something (somewhere) if I do so?
Thank you all!

Yes you can remove them, since this issue has never been fixed probably won't be unless you have a specific need for upnp disable it in the router stops the nag screen from showing up

If this really bothers you, you can send a mail to your ISP stating that the device does not adhere to the UPnP standard by switching the the UUID. The standard states that the UUID should stay the same for the device.

Yes you can remove them, since this issue has never been fixed probably won't be unless you have a specific need for upnp disable it in the router stops the nag screen from showing up

I disabled UPNP on my router, and deleted multiple entries and it seems to work now. Just don't know why didn't think of disabling it before :|
Thank you and @StevenLooman for help!

If this really bothers you, you can send a mail to your ISP stating that the device does not adhere to the UPnP standard by switching the the UUID. The standard states that the UUID should stay the same for the device.

I have a ASUS Router and I don't shut it off nor reboot the modem execpt on rare occasions. so it is unlikely the UUID is changing in the router everytime I reboot my Home assistant it popped a new UNPNP everytime even if I did a back to back home assistant restart, I am leaning towards the flaw is in the intergration itself and blaming everything else is the problem does not solve the issue

The cause of the problem in this issue had been determined (the changing UUIDs), I was referring to this. If you have the same problem, please open a new issue.

@tomiknez If this has been solved for you, can you close this issue?

Yeah, I still am having problems with this integration. I can't find the option to disable it in my router's configuration page. I've checked config_entries and it appears that my router broadcasts different UUIDs every time it reboots/gets asked for an UUID. Is there a way to disable auto discovery for upnp?

@fufs I think if you add this to your configuration.yaml, the upnp-integration will be ignored:

discovery:
  ignore:
    - upnp

Gives me an error

Gives me an error

Also doesn't work. The ssdp integration does the discovery for upnp, see https://www.home-assistant.io/integrations/ssdp/. My bad, sorry. Unfortunately, there seems to be no way to ignore integrations from the ssdp integration. Please do make a new issue requesting this functionality.

Still, your router does not adhere to the UPnP standard, from document UPnP-arch-DeviceArchitecture-v2.0.pdf, page 52:

Required. Unique Device Name. Universally-unique identifier for the device, whether root or
embedded. shall be the same over time for a specific device instance (i.e., shall survive
reboots). shall match the field value of the NT header field in device discovery messages.
shall match the prefix of the USN header field in all discovery messages. (Clause 1,
“Discovery” explains the NT and USN header fields.) shall begin with “uuid:” followed by a
UUID suffix specified by a UPnP vendor. See clause 1.1.4, “UUID format and recommended
generation algorithms” for the MANDATORY UUID format.

Ok, I didn't get any new 'Discovered integration' notification for a while now (2+ weeks, only some old discoveries, which I ignored and nothing new appeared), so I'm gonna close this issue, for now, hoping it was something not related to upnp and fixed elsewhere. Thanks for all the help!

Perhaps the random number generator your router uses isn't that good. :)

Anyway, thank you for closing. If anything happens, please do let me know.

Was this page helpful?
0 / 5 - 0 ratings