Error in sending image to a DLNA Renderer: AttributeError: 'Resource' object has no attribute 'url'. Did you mean: 'uri'?

I have set up a WDTVLive media player as a DLNA renderer with the HA integration and trying to send images to it.

For example, in Developer Tools, if I select the action Media Player: Play media, selct the correct device, and a URL 192.168.1.101/p2.jpg which is pointing to my internal web server, Content type image, I get an error message in HA “Field to perforrm the action media_player.play_media: Unknown error”. Please see the attached screenshot. However, the image displays correctly on the WDTVLive.

I get the same symptoms trying to do this from an Automation.

The following appears in the HA Logs:

Logger: homeassistant
Source: components/dlna_dmr/media_player.py:894
First occurred: 16:04:26 (31 occurrences)
Last logged: 16:08:46

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 1037, in _async_update_entity_states
await entity.async_update_ha_state(True)
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 960, in async_update_ha_state
self._async_write_ha_state()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 1130, in _async_write_ha_state
self.__async_calculate_state()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 1089, in __async_calculate_state
if (entity_picture := self.entity_picture) is not None:
^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/media_player/init.py”, line 1068, in entity_picture
return self.media_image_local
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/media_player/init.py”, line 1073, in media_image_local
if (image_hash := self.media_image_hash) is None:
^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/media_player/init.py”, line 639, 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 1212, in media_image_url
return absolute_url(device_url, res.url)
^^^^^^^
AttributeError: ‘Resource’ object has no attribute ‘url’. Did you mean: ‘uri’?

Also

Logger: homeassistant.util.logging
Source: util/logging.py:95
First occurred: 16:08:11 (2 occurrences)
Last logged: 16:08:13

Exception in SSDP callback <bound method DlnaDmrEntity.async_ssdp_callback of >: (SsdpServiceInfo(ssdp_usn=‘uuid:42a283d0-0090-a991-73ac-5cc34c682333::urn:schemas-upnp-org:device:MediaRenderer:1’, ssdp_st=‘urn:schemas-upnp-org:device:MediaRenderer:1’, upnp={‘X_hardwareId’: ‘VEN_011A&DEV_0042&REV_01 VEN_0033&DEV_0006&REV_01’, ‘X_containerId’: ‘{42a283d0-0090-a991-73ac-5cc34c682338}’, ‘X_compatibleId’: ‘MS_DigitalMediaDeviceClass_DMR_V001’, ‘X_deviceCategory’: [‘MediaDevices’, ‘Multimedia.DMR’], ‘deviceType’: ‘urn:schemas-upnp-org:device:MediaRenderer:1’, ‘X_DLNADOC’: ‘DMR-1.50’, ‘friendlyName’: ‘WDTVLive’, ‘manufacturer’: ‘Western Digital Corporation’, ‘manufacturerURL’: ‘http://www.wdc.com’, ‘modelDescription’: ‘WD TV HD Live Media Player’, ‘modelName’: ‘WD TV HD Live’, ‘modelNumber’: ‘WDBAAP’, ‘modelURL’: ‘http://www.wdtvlive.com/’, ‘iconList’: {‘icon’: [{‘mimetype’: ‘image/jpeg’, ‘width’: ‘48’, ‘height’: ‘48’, ‘depth’: ‘24’, ‘url’: ‘icon_logo4wmc_48x48.jpg’}, {‘mimetype’: ‘image/jpeg’, ‘width’: ‘120’, ‘height’: ‘120’, ‘depth’: ‘24’, ‘url’: ‘icon_logo4wmc_120x120.jpg’}, {‘mimetype’: ‘image/png’, ‘width’: ‘48’, ‘height’: ‘48’, ‘depth’: ‘24’, ‘url’: ‘icon_logo4wmc_48x48.png’}, {‘mimetype’: ‘image/png’, ‘width’: ‘120’, ‘height’: ‘120’, ‘depth’: ‘24’, ‘url’: ‘icon_logo4wmc_120x120.png’}]}, ‘serialNumber’: ‘WNV101500441’, ‘UDN’: ‘uuid:42a283d0-0090-a991-73ac-5cc34c682333’, ‘serviceList’: {‘service’: [{‘serviceType’: ‘urn:schemas-upnp-org:service:AVTransport:1’, ‘serviceId’: ‘urn:upnp-org:serviceId:AVTransport’, ‘SCPDURL’: ‘MediaRenderer_AVTransport/scpd.xml’, ‘controlURL’: ‘MediaRenderer_AVTransport/control’, ‘eventSubURL’: ‘MediaRenderer_AVTransport/event’}, {‘serviceType’: ‘urn:schemas-upnp-org:service:ConnectionManager:1’, ‘serviceId’: ‘urn:upnp-org:serviceId:ConnectionManager’, ‘SCPDURL’: ‘MediaRenderer_ConnectionManager/scpd.xml’, ‘controlURL’: ‘MediaRenderer_ConnectionManager/control’, ‘eventSubURL’: ‘MediaRenderer_ConnectionManager/event’}, {‘serviceType’: ‘urn:schemas-upnp-org:service:RenderingControl:1’, ‘serviceId’: ‘urn:upnp-org:serviceId:RenderingControl’, ‘SCPDURL’: ‘MediaRenderer_RenderingControl/scpd.xml’, ‘controlURL’: ‘MediaRenderer_RenderingControl/control’, ‘eventSubURL’: ‘MediaRenderer_RenderingControl/event’}]}, ‘presentationURL’: ‘web’}, ssdp_location=‘http://192.168.1.8:61077/’, ssdp_nt=‘urn:schemas-upnp-org:device:MediaRenderer:1’, ssdp_udn=‘uuid:42a283d0-0090-a991-73ac-5cc34c682333’, ssdp_ext=‘’, ssdp_server=‘POSIX, UPnP/1.0, Intel MicroStack/1.0.1497’, ssdp_headers={‘LOCATION’: ‘http://192.168.1.8:61077/’, ‘EXT’: ‘’, ‘SERVER’: ‘POSIX, UPnP/1.0, Intel MicroStack/1.0.1497’, ‘USN’: ‘uuid:42a283d0-0090-a991-73ac-5cc34c682333::urn:schemas-upnp-org:device:MediaRenderer:1’, ‘CACHE-CONTROL’: ‘max-age=1800’, ‘ST’: ‘urn:schemas-upnp-org:device:MediaRenderer:1’, ‘_host’: ‘192.168.1.8’, ‘_udn’: ‘uuid:42a283d0-0090-a991-73ac-5cc34c682333’, ‘_location_original’: ‘http://192.168.1.8:61077/’, ‘location’: ‘http://192.168.1.8:61077/’, ‘_timestamp’: datetime.datetime(2024, 9, 8, 16, 0, 5, 48173), ‘_remote_addr’: (‘192.168.1.8’, 1900), ‘_port’: 1900, ‘_local_addr’: (‘0.0.0.0’, 1900), ‘HOST’: ‘239.255.255.250:1900’, ‘NTS’: ‘ssdp:alive’, ‘NT’: ‘urn:schemas-upnp-org:device:MediaRenderer:1’}, ssdp_all_locations={‘http://192.168.1.8:61077/’}, x_homeassistant_matching_domains=set()), <SsdpChange.ALIVE: 1>) Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/dlna_dmr/media_player.py”, line 311, in async_ssdp_callback self.async_write_ha_state() File “/usr/src/homeassistant/homeassistant/components/dlna_dmr/media_player.py”, line 358, in async_write_ha_state super().async_write_ha_state() File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 1005, in async_write_ha_state self._async_write_ha_state() File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 1130, in _async_write_ha_state self.__async_calculate_state() File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 1089, in __async_calculate_state if (entity_picture := self.entity_picture) is not None: ^^^^^^^^^^^^^^^^^^^ File “/usr/src/homeassistant/homeassistant/components/media_player/init.py”, line 1068, in entity_picture return self.media_image_local ^^^^^^^^^^^^^^^^^^^^^^ File “/usr/src/homeassistant/homeassistant/components/media_player/init.py”, line 1073, in media_image_local if (image_hash := self.media_image_hash) is None: ^^^^^^^^^^^^^^^^^^^^^ File “/usr/src/homeassistant/homeassistant/components/media_player/init.py”, line 639, 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 1212, in media_image_url return absolute_url(device_url, res.url) ^^^^^^^ AttributeError: ‘Resource’ object has no attribute ‘url’. Did you mean: ‘uri’?

I have found an issue in github with very similar symptoms, however no-one picked it up and the issue has been closed as stale and “not planned”. https://github.com/home-assistant/core/issues/111078

Does anyone have any hints on this or shall I just create another issue?