Plex integration question (for light automation)

I’ve been testing the Plex integration and using it to control lights when media is playing.

My Plex client on the Apple TV seems to update it’s state to unavailable when it’s running Plex instantly (which is what I want), but for other Plex clients like on my Xbox One it never goes to unavailable. It remains on idle even when Plex has been closed and Xbox has been shutdown. On the iPhone/iPad Plex it takes a while for Plex to become unavailable.

I’ve setup Plex integration via the native integrations config, am I missing a setting somewhere?

I’m wanting to get the unavailable state so I can use it to turn on lights for a few minutes and turn off automatically once I’ve quit out of Plex.

Only thing I could think of is combining Plex and Sonos integration as I have a Beam/Playbar. It can monitor one of the attributes as TV but once the TV has been switched off and the soundbar has been idle it will switch back to media and paused. This event can then switch the light off.

Unfortunately this is just reflecting what the Plex server is reporting back to HA. Some clients disappear immediately, some take a long time to time out. It also depends if the Plex client is on the same subnet as the Plex server. In those cases the Plex client is likely to remain available for longer as it may be seen as a controllable client by the Plex server.

Thanks for that, I will go ahead and combine Plex and Sonos integration for my light automation.