Open override80 opened 6 days ago
Hey there @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)
dlna_dmr documentation dlna_dmr source (message by IssueLinks)
I'm looking at that log snippet, in particular the XML in the NOTIFY:
<?xml version="1.0"?><e:propertyset xmlns:e="urn:schemas-upnp-org:event-1-0"><e:property><LastChange></InstanceID></Event></LastChange></e:property></e:propertyset>
After one layer of XML decoding, the contents of the LastChange
tag should be valid XML, but instead it's got:
</InstanceID></Event>
Is your speaker OK?
Hi @chishm , it is - I have 4 of them (3 Soundtouch 10 and 1 Soundtouch 20), they all work. I do already use them via SoundTouchPlus integration in home assistant. Sometimes they work as expected as DLNA rendered, sometimes thay just stick to "unknown".
here is the state of the corresponding entities provided by SoundTouchPlus vs DLNA:
Can I help somehow with some tests?
The real issue is that I used DLNA renderers in Music Assistant as Player Providers. Because if I add home assistant media players directly in Music assistant I need to make sure that the source on the player is properly set to "notification" source, otherwise they won't work... This I could avoid by using DLNA.
Hi @chishm , do you believe that these might be related? https://github.com/home-assistant/core/issues/57061 https://github.com/home-assistant/core/issues/85711?
Something might have changed in 2024.7 (https://community.home-assistant.io/t/2024-7-time-to-resize-your-cards/745771/111).
Maybe this is more related to @StevenLooman UPNP integration? Sorry to ping you here Steven, I am a total noob on DLNA and UPnP. I will reopen the task tagging the proper integration if this is the case.
I tried to figure out how to monkey patch client.py in the async_upnp library, but unsuccessfully
Setting this:
will make the speaker work. Still a lot of errors in the log though, again xml parsing errors:
2024-11-28 11:35:36.720 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1706, in feed
self.parser.Parse(data, False)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 1046, in _async_update_entity_states
await entity.async_update_ha_state(True)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 962, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
self.__async_calculate_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1091, in __async_calculate_state
if (entity_picture := self.entity_picture) is not None:
^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1081, in entity_picture
return self.media_image_local
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1086, in media_image_local
if (image_hash := self.media_image_hash) is None:
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 652, in media_image_hash
if (url := self.media_image_url) is not None:
^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/dlna_dmr/media_player.py", line 894, in media_image_url
return self._device.media_image_url
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 1198, in media_image_url
items = _cached_from_xml_string(xml)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 239, in _cached_from_xml_string
return didl_lite.from_xml_string(xml, strict=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/didl_lite/didl_lite.py", line 1077, in from_xml_string
xml_el = defusedxml.ElementTree.fromstring(xml_string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/defusedxml/common.py", line 126, in fromstring
parser.feed(text)
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1708, in feed
self._raiseerror(v)
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1615, in _raiseerror
raise err
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 0
2024-11-28 11:35:37.168 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1706, in feed
self.parser.Parse(data, False)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 1046, in _async_update_entity_states
await entity.async_update_ha_state(True)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 962, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
self.__async_calculate_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1091, in __async_calculate_state
if (entity_picture := self.entity_picture) is not None:
^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1081, in entity_picture
return self.media_image_local
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1086, in media_image_local
if (image_hash := self.media_image_hash) is None:
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 652, in media_image_hash
if (url := self.media_image_url) is not None:
^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/dlna_dmr/media_player.py", line 894, in media_image_url
return self._device.media_image_url
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 1198, in media_image_url
items = _cached_from_xml_string(xml)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 239, in _cached_from_xml_string
return didl_lite.from_xml_string(xml, strict=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/didl_lite/didl_lite.py", line 1077, in from_xml_string
xml_el = defusedxml.ElementTree.fromstring(xml_string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/defusedxml/common.py", line 126, in fromstring
parser.feed(text)
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1708, in feed
self._raiseerror(v)
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1615, in _raiseerror
raise err
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 0
2024-11-28 11:35:46.719 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1706, in feed
self.parser.Parse(data, False)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 1046, in _async_update_entity_states
await entity.async_update_ha_state(True)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 962, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
self.__async_calculate_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1091, in __async_calculate_state
if (entity_picture := self.entity_picture) is not None:
^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1081, in entity_picture
return self.media_image_local
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1086, in media_image_local
if (image_hash := self.media_image_hash) is None:
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 652, in media_image_hash
if (url := self.media_image_url) is not None:
^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/dlna_dmr/media_player.py", line 894, in media_image_url
return self._device.media_image_url
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 1198, in media_image_url
items = _cached_from_xml_string(xml)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 239, in _cached_from_xml_string
return didl_lite.from_xml_string(xml, strict=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/didl_lite/didl_lite.py", line 1077, in from_xml_string
xml_el = defusedxml.ElementTree.fromstring(xml_string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/defusedxml/common.py", line 126, in fromstring
parser.feed(text)
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1708, in feed
self._raiseerror(v)
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1615, in _raiseerror
raise err
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 0
2024-11-28 11:35:48.226 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1706, in feed
self.parser.Parse(data, False)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 1046, in _async_update_entity_states
await entity.async_update_ha_state(True)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 962, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
self.__async_calculate_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1091, in __async_calculate_state
if (entity_picture := self.entity_picture) is not None:
^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1081, in entity_picture
return self.media_image_local
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1086, in media_image_local
if (image_hash := self.media_image_hash) is None:
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 652, in media_image_hash
if (url := self.media_image_url) is not None:
^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/dlna_dmr/media_player.py", line 894, in media_image_url
return self._device.media_image_url
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 1198, in media_image_url
items = _cached_from_xml_string(xml)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 239, in _cached_from_xml_string
return didl_lite.from_xml_string(xml, strict=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/didl_lite/didl_lite.py", line 1077, in from_xml_string
xml_el = defusedxml.ElementTree.fromstring(xml_string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/defusedxml/common.py", line 126, in fromstring
parser.feed(text)
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1708, in feed
self._raiseerror(v)
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1615, in _raiseerror
raise err
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 0
2024-11-28 11:35:56.723 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1706, in feed
self.parser.Parse(data, False)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 1046, in _async_update_entity_states
await entity.async_update_ha_state(True)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 962, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
self.__async_calculate_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1091, in __async_calculate_state
if (entity_picture := self.entity_picture) is not None:
^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1081, in entity_picture
return self.media_image_local
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1086, in media_image_local
if (image_hash := self.media_image_hash) is None:
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 652, in media_image_hash
if (url := self.media_image_url) is not None:
^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/dlna_dmr/media_player.py", line 894, in media_image_url
return self._device.media_image_url
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 1198, in media_image_url
items = _cached_from_xml_string(xml)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 239, in _cached_from_xml_string
return didl_lite.from_xml_string(xml, strict=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/didl_lite/didl_lite.py", line 1077, in from_xml_string
xml_el = defusedxml.ElementTree.fromstring(xml_string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/defusedxml/common.py", line 126, in fromstring
parser.feed(text)
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1708, in feed
self._raiseerror(v)
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1615, in _raiseerror
raise err
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 0
2024-11-28 11:35:56.844 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1706, in feed
self.parser.Parse(data, False)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 1046, in _async_update_entity_states
await entity.async_update_ha_state(True)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 962, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
self.__async_calculate_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1091, in __async_calculate_state
if (entity_picture := self.entity_picture) is not None:
^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1081, in entity_picture
return self.media_image_local
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1086, in media_image_local
if (image_hash := self.media_image_hash) is None:
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 652, in media_image_hash
if (url := self.media_image_url) is not None:
^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/dlna_dmr/media_player.py", line 894, in media_image_url
return self._device.media_image_url
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 1198, in media_image_url
items = _cached_from_xml_string(xml)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 239, in _cached_from_xml_string
return didl_lite.from_xml_string(xml, strict=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/didl_lite/didl_lite.py", line 1077, in from_xml_string
xml_el = defusedxml.ElementTree.fromstring(xml_string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/defusedxml/common.py", line 126, in fromstring
parser.feed(text)
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1708, in feed
self._raiseerror(v)
File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1615, in _raiseerror
raise err
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 0
The problem
When I try to add my Bose Soundtouch spakers via DLNA as a Digital Media Renderer, speakers stay unavailable and I cannot use them. They used to work until a few weeks ago. Attached the debug log.
What version of Home Assistant Core has the issue?
core-2024.11.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Supervised
Integration causing the issue
DLNA Digital Media Renderer
Link to integration documentation on our website
https://www.home-assistant.io/integrations/dlna_dmr
Diagnostics information
home-assistant_dlna_dmr_2024-11-25T12-03-05.708Z.log
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response