core: 0.80 introduces new upnp component but it is not working

Home Assistant release with the issue: 0.80.0

Last working Home Assistant release (if known): This is a new feature

Operating environment (Hass.io/Docker/Windows/etc.): Running on Hass.io ersion 136 on HassOS 1.11

Component/platform: https://www.home-assistant.io/components/upnp/

Description of problem: I’ve tried to set up upnp ports for my Home Assistant and also for the add-ons that I want to be able to view from outside, but I’m getting the error from below. The router’s configuration shows no sign of the upnp’d ports and of course the ports are still closed. The router is a Netgear R8000.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

 upnp: 
   port_mapping: true
   ports: 
     1xx0: 11xx0
     3xx8: 13xx8
     7xx1: 17xx1
     8xx1: 18xx1
     9xx1: 19xx1
     hass: 443

Traceback (if applicable):

Error setting up entry R8000 (Gateway) for upnp
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/config_entries.py", line 236, in async_setup
result = await component.async_setup_entry(hass, self)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/upnp/__init__.py", line 113, in async_setup_entry
device = await Device.async_create_device(hass, ssdp_description)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/upnp/device.py", line 36, in async_create_device
upnp_device = await factory.async_create_device(ssdp_description)
  File "/usr/local/lib/python3.6/site-packages/async_upnp_client/__init__.py", line 848, in async_create_device
service = await self.async_create_service(service_desc_xml, description_url)
  File "/usr/local/lib/python3.6/site-packages/async_upnp_client/__init__.py", line 875, in async_create_service
return self.create_service(service_description_xml, scpd_xml)
  File "/usr/local/lib/python3.6/site-packages/async_upnp_client/__init__.py", line 882, in create_service
state_vars = self.create_state_variables(scpd_xml)
  File "/usr/local/lib/python3.6/site-packages/async_upnp_client/__init__.py", line 902, in create_state_variables
state_var = self.create_state_variable(state_var_xml)
  File "/usr/local/lib/python3.6/site-packages/async_upnp_client/__init__.py", line 908, in create_state_variable
state_variable_info = self._state_variable_parse_xml(state_variable_xml)
  File "/usr/local/lib/python3.6/site-packages/async_upnp_client/__init__.py", line 927, in _state_variable_parse_xml
state_variable_xml.find('service:sendEventsAttribute', NS).text == 'yes'
AttributeError: 'NoneType' object has no attribute 'text'

Additional information:

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 17 (11 by maintainers)

Most upvoted comments

@bboti86 Thanks! It is indeed missing something in the XML. In case you’re interested: the used library, async_upnp_client, expects all stateVariables in the given XML, to state whether changes send events or not.

I’ve updated async_upnp_client to handle this case and assume it does not. When #17560 is merged, please do test.