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
71.07k stars 29.73k forks source link

DLNA server (Plex) is discovered and added by integration, but no device created. #73656

Closed bmorgan99 closed 2 years ago

bmorgan99 commented 2 years ago

The problem

I've verified the server with other apps. Removed and reinstalled to no avail. The log errors below repeat every 10 seconds.

What version of Home Assistant Core has the issue?

2022.6.6

What was the last working version of Home Assistant Core?

new addition, no previous version tried

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

DLNA Digital Media Server

Link to integration documentation on our website

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

Diagnostics information

n/a

Example YAML snippet

n/a

Anything in the logs that might be useful for us?

2022-06-17 14:28:14 DEBUG (MainThread) [async_upnp_client.profiles.profile] Failed to call action AVT:GetTransportInfo for state variables: UpnpResponseError('Error during async_call(), status: 501, body: ')
2022-06-17 14:28:14 DEBUG (MainThread) [async_upnp_client.profiles.profile] Failed to call action AVT:GetMediaInfo for state variables: UpnpResponseError('Error during async_call(), status: 501, body: ')
2022-06-17 14:28:14 DEBUG (MainThread) [async_upnp_client.profiles.profile] Failed to call action AVT:GetDeviceCapabilities for state variables: UpnpResponseError('Error during async_call(), status: 501, body: ')
2022-06-17 14:28:14 DEBUG (MainThread) [async_upnp_client.profiles.profile] Failed to call action AVT:GetTransportSettings for state variables: UpnpResponseError('Error during async_call(), status: 501, body: ')
2022-06-17 14:28:14 DEBUG (MainThread) [async_upnp_client.profiles.profile] Failed to call action AVT:GetCurrentTransportActions for state variables: UpnpResponseError('Error during async_call(), status: 501, body: ')
2022-06-17 14:28:14 DEBUG (MainThread) [async_upnp_client.profiles.profile] Failed to call action RC:GetMute for state variables: UpnpResponseError('Error during async_call(), status: 501, body: ')
2022-06-17 14:28:14 DEBUG (MainThread) [async_upnp_client.profiles.profile] Failed to call action RC:GetVolume for state variables: UpnpResponseError('Error during async_call(), status: 501, body: ')
2022-06-17 14:28:14 DEBUG (MainThread) [async_upnp_client.profiles.dlna] Got no value for PresetNameList
2022-06-17 14:28:14 DEBUG (MainThread) [async_upnp_client.profiles.dlna] Got no value for Volume
2022-06-17 14:28:14 DEBUG (MainThread) [async_upnp_client.profiles.dlna] Got no value for Volume_mute

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)

bmorgan99 commented 2 years ago

For grins, I set up another DLNA server on my PC and then it and the Plex server showed up in the integration.

bmorgan99 commented 2 years ago

Still no HA device and Music Assistant is oblivious

StevenLooman commented 2 years ago

The logging you provided states the device returns a 501 error. The UPnP Device Architecture document states this as:

501, Action Failed, May be returned in current state of service prevents invoking that action.

The repeating is that the integration polls the device (Plex) for any changes in state.

Are other applications able to do anything with the DLNA server, like get information about the current thing played or play media?

StevenLooman commented 2 years ago

Also, there is a specific integration for Plex. Perhaps this integration should ignore Plex devices, like it does for XMBC/Kodi, Philips, Samsung, and LG devices.

bmorgan99 commented 2 years ago

The errors stopped after a few hours and the integration now lists the Plex DLNA server. VLC and Windows File Explorer can both fully use it.

Tried with Chrome but I can't figure out the URL http://192.168.1.5:32469/DeviceDescription.xml works, but I don't know what the home page is

StevenLooman commented 2 years ago

What do you mean by?

but I don't know what the home page is

The device (most likely) doesn't provide a nice looking user interface. The URL you're referring to is (and DLNA itself) is an API which other applications, such as home assistant, can call. Those applications provide the UI.

bmorgan99 commented 2 years ago

Ah, I just assumed there was a rudimentary interface I could browse and possibly learn something. If writing a front end is required, I'm right out.

Anything I can do to help further?

chishm commented 2 years ago

I think it might be using the wrong integration. Those debug messages look like they're for a Digital Media Renderer (i.e. a device that plays media content) whereas I think Plex functions as a Digital Media Server.

Could you please tell us what device you're trying to play media to? Also, you might need to setup Plex using the DLNA DMS integration, not the DLNA DMR integration.

bmorgan99 commented 2 years ago

I did add the DLNA option in Plex and was already running the integration. The server name is "Gameroom DLNA" and this is my test attempt:

service: media_player.play_media
target:
  entity_id: media_player.google_study
data:
  media_content_id: 'media-source://dlna_dms/gameroom_dlna/?dc:title="Layla"'
  media_content_type: music
  announce: true

ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140469894640544] Error handling message: Unknown source ID: gameroom_dlna (unknown_error)

Edit: plex_media_server_gameroom works as a source ID, which might be the integration. the search returns: UpnpError('Missing action CD/Search', None)

The integration search should be media_content_id: "{"library_name": "Music", "title": "Layla"}" can't get that working either. I'm calling it a day