home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.8k stars 30.9k forks source link

Missing StateVariable AVT/CurrentTrackURI #61067

Closed TopdRob closed 2 years ago

TopdRob commented 2 years ago

The problem

My Philips radio is spamming the log file with the error message below.

What version of Home Assistant Core has the issue?

core-2021.12.0b1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

dlna_dmr

Link to integration documentation on our website

https://www.home-assistant.io/integrations/dlna_dmr

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Failed to callback info: SsdpServiceInfo(upnp={'deviceType': 'urn:schemas-upnp-org:device:MediaRenderer:1', 'friendlyName': 'Radio kantoor', 'manufacturer': 'Frontier Smart Technologies Ltd', 'manufacturerURL': 'https://www.frontiersmart.com', 'modelDescription': 'ir-cui-FS2340-0000-0024_V4.0.27.d1c256-1B11', 'modelName': 'TAPR802', 'modelNumber': '1.0', 'modelURL': 'https://www.frontiersmart.com', 'serialNumber': 'f4574a45c91ce2cf432ca44dcc59a9f7c8', 'UDN': 'uuid:3DCC7100-F76C-11DD-87AF-305890A95861', 'iconList': {'icon': [{'mimetype': 'image/png', 'width': '48', 'height': '48', 'depth': '32', 'url': '/icon.png'}, {'mimetype': 'image/jpeg', 'width': '48', 'height': '48', 'depth': '32', 'url': '/icon.jpg'}, {'mimetype': 'image/png', 'width': '120', 'height': '120', 'depth': '32', 'url': '/icon2.png'}, {'mimetype': 'image/jpeg', 'width': '120', 'height': '120', 'depth': '32', 'url': '/icon2.jpg'}]}, 'X_Features': 'Spotify, DAB, FM, IR, Podcasts, Bluetooth,'}, ssdp_usn='uuid:3DCC7100-F76C-11DD-87AF-305890A95861::urn:schemas-upnp-org:device:MediaRenderer:1', ssdp_st='urn:schemas-upnp-org:device:MediaRenderer:1', ssdp_location='http://192.168.2.192:8080/dd.xml', ssdp_nt='urn:schemas-upnp-org:device:MediaRenderer:1', ssdp_udn='uuid:3DCC7100-F76C-11DD-87AF-305890A95861', ssdp_ext='', ssdp_server='POSIX, UPnP/1.0, Intel MicroStack/1.0.2777', ssdp_headers={'CACHE-CONTROL': 'max-age=1800', 'EXT': '', 'SERVER': 'POSIX, UPnP/1.0, Intel MicroStack/1.0.2777', 'ST': 'urn:schemas-upnp-org:device:MediaRenderer:1', 'USN': 'uuid:3DCC7100-F76C-11DD-87AF-305890A95861::urn:schemas-upnp-org:device:MediaRenderer:1', '_location_original': 'http://192.168.2.192:8080/dd.xml', 'location': 'http://192.168.2.192:8080/dd.xml', '_timestamp': datetime.datetime(2021, 12, 5, 22, 37, 7, 5795), '_host': '192.168.2.192', '_port': 53181, '_udn': 'uuid:3DCC7100-F76C-11DD-87AF-305890A95861', 'HOST': '239.255.255.250:1900', 'NT': 'urn:schemas-upnp-org:device:MediaRenderer:1', 'NTS': 'ssdp:alive'}, x_homeassistant_matching_domains=set(), _warning_logged=False)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/ssdp/__init__.py", line 238, in _async_process_callbacks
    await callback(discovery_info, ssdp_change)
  File "/usr/src/homeassistant/homeassistant/components/dlna_dmr/media_player.py", line 294, in async_ssdp_callback
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 505, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 540, in _async_write_ha_state
    attr.update(self.state_attributes or {})
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 932, in state_attributes
    if (value := getattr(self, attr)) is not None:
  File "/usr/src/homeassistant/homeassistant/components/dlna_dmr/media_player.py", line 774, in media_content_id
    return self._device.current_track_uri
  File "/usr/local/lib/python3.9/site-packages/async_upnp_client/profiles/dlna.py", line 695, in current_track_uri
    raise UpnpError("Missing StateVariable AVT/CurrentTrackURI")
async_upnp_client.exceptions.UpnpError: Missing StateVariable AVT/CurrentTrackURI

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

dlna_dmr documentation dlna_dmr source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @stevenlooman, @chishm, mind taking a look at this issue as it has been labeled with an integration (dlna_dmr) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

chishm commented 2 years ago

Thank you for the bug report. I'm not surprised that Philips isn't following the AVTransport spec properly, which requires the CurrentTrackURI. But in the interest of interoperability, I'll make dlna_dmr handle the missing case more gracefully.