JurajNyiri / PlexMeetsHomeAssistant

Custom card which integrates plex into Home Assistant and makes it possible to launch movies or tv shows on TV with a simple click
Apache License 2.0
111 stars 8 forks source link

Feature Request / Bug (?) : Support multiple servers #65

Closed Paul-Vdp closed 2 years ago

Paul-Vdp commented 2 years ago

When multiple plex servers are configured in Hass, all playing fails (at least on cast devices, not tested on other). This is because the generated json for content_id fails to include the 'plex_server' parameter, therefore resulting in an error such as : 'Multiple Plex servers configured, choose with 'plex_server' key: ['Server1', 'Server2']'

JurajNyiri commented 2 years ago

What is this plex_server key referring to? Is it something that is generated by Home Assistant integration or is it something that server has, like a server ID or something similar?

Paul-Vdp commented 2 years ago

It is simply the 'Friendly name' as given in the Plex 'General Settings' to that server, so I am sure it is retrievable through their API, as evidenced by the fact that Hass even mentions them literally in their error message (the 'Server1' and 2 in the above message are obfuscations for the real names). Adding something like "plex_server":"Server1" in the json and manually calling the service works perfectly ...

JurajNyiri commented 2 years ago

Fixed in 3.4.1.

Paul-Vdp commented 2 years ago

Thank you for looking into this. I just updated to the new version and tested (enabling my second Plex Server integration, trying to cast to a Google Cast), but I'm sorry to say that nothing seems to have changed or improved : I still get the same error message, complaining about the missing plex_server parameter, and of course nothing is playable anymore ...

JurajNyiri commented 2 years ago

@Paul-Vdp make sure to delete cache and do hard reload of your browser. You can also try a different browser. It is 100% sent now.

Paul-Vdp commented 2 years ago

So sorry ... I should have thought of that (I usually do, but not this time). Thanks a lot for fixing this - it works splendidly !