Is there a way to make Plex media players not go unavailable when not playing media?
Currently I have a node-red flow that will dim the lights when playing a movie, bring the lights back up when paused or stopped. However I just recently noticed that the lights stopped coming up when the movie is stopped. The issue appears to be because my media player (plex_xboxone) goes unavailable leaving node-red with no message to forward to bring the lights back up.
It’s actually the intended behavior. The Plex integration gets the status of players from the connected Plex server(s). Once the player stops reporting its status to the server, it is removed from the list of connected clients/sessions that the server knows about.
If a Plex client is controllable and on the same subnet as the Plex server, it is more likely to remain available and visible. If you run some UDP forwarders between subnets, you can remove that second requirement and improve Plex client visibility.
@jjlawren can you explain a little more about running UDFP forwards between subnets to improve Plex client visiblity? I have set up hassio to automatically play a video playlist from plex on my nvidia shield when I get home. Problem is, if I haven’t played anything in plex on the shield in awhile, the plex media player is unavailable and the script will not run. I need a way to wake up or refresh the plex client list.
@millsx2 The GDM discovery protocol uses UDP broadcast over ports 32410 & 32412-32414 to discover other Plex devices. If a Plex client is running and responds, the Plex server will then “see” it and report it back to HA as a connected and available media_player entity. Note that this discovery traffic only matters between the Plex server and Plex clients–it does not matter where HA sits on the network.
As for how to forward UDP packets between subnets, that’s somewhat dependent on your local setup.
Thanks. I found a workaround in my Node Red flow. When starting a video playlist in plex flow, it will first detect if the shield plex player is “unavailable”. If it is unavailable I send a rest command to set it to “idle”, that will then allow the play media command to be sent.
I think it works. Once you set it to idle with a rest command, the controls are missing from the player in the UI, but since it is no longer unavailable, I can send the play media command right after and then once it has Media playing it goes back to normal.
@jjlawren The GDM discovery protocol uses UDP broadcast over ports 32410 & 32412-32414 to discover other Plex devices. If a Plex client is running and responds, the Plex server will then “see” it and report it back to HA as a connected and available media_player entity. Note that this discovery traffic only matters between the Plex server and Plex clients–it does not matter where HA sits on the network.
Just out of curiosity, would the Plex Client going unavailable after being inactive for a while if I declare them in my configuration.yaml so they won’t get covered by the discovery:. ??
I believe the rest command would work for apple tv as well, as long as you have the plex configuration set up correctly and it displays an apple tv media player in hassio UI. If you use the rest command to set apple tv to idle it should then allow you to send play media commands to it. The play media commands will not work if a device is shown as unavailable in the UI.
well… the Plex ATV shows correctly on HA. It has been working fine for the last 48 hours but ended up showing unavailable after 2 days… even though I’ve deactivated the Sleep after 15 minutes and the screensaver after 5m.
I would like to have the command to be sent to my ATV no matter if the Plex client is available or not… or have a way so the Plex ATV client never show itself as unavailable. Either would work. Any ideas?
On the other end, I just feel like buying a Shield, like you’ve done, would do the job.
The Plex Shield media player will show as unavailable if it has not been used in a day or so. That is why I use a rest command to change “unavailable” to “idle”. This happens to work for the Shield TV but I am not positive if it will work for the Apple TV Plex client. I have tried this method with cast device on a tablet and it does not work, so it may be device specific.
ok… for me, I had the player showing for two days, then it went unavailable. I was under the impression it would show available right away as soon as I use it, which wasn’t the case…
How long does it take for your install of HA to set the Plex Client from unavailable to idle?
The Plex integration relies on the Plex server to report the Plex players that it “sees”. This is either 1) players that are broadcasting their presence via GDM protocol or 2) players that have an active session (read: are actively playing media from the Plex server).
so, in the end, we can’t predict for sure when HA will “see” a specific player once the player broadcasted its presence?
Like if a player as been idle for a while (ending up being unavailable from HA’s perspective), if I “wake” up the player with the rest command @millsx2 told me about, I can’t assure for sure it will show as Idle right away ? (as opposed to unavailable)