Media_player.play_media to Plex on LG WebOSTV does not work

Having an issue getting HA service call for media_player.play_media to trigger Plex on my webostv. The TV is on and Plex is running as the source. When I make a call to play anything (from any library or playlist), nothing happens. There are no logs in Plex for the call failing at all, so maybe this is an issue with Plex on webos?

I’ve been able to verify that my service call works correctly by calling to a different entity (a Plexamp instance)

For example:

entity_id: media_player.plex_living_room
media_content_id: '{"library_name":"Music","artist_name":"Atmosphere"}'
media_content_type: MUSIC

Has anyone gotten service calls like this to work for Plex on webostv?

Of note: I can control other things, like play/pause through the lovelace UI media player. It’s just an issue when I try to call the play_media service.

I’m on

  • Home Assistant Core 107.6
  • Plex 1.18.9.2571
  • LG webOS 4.7.0
  • Plex for webos 4.29.0

I’ve noticed that the Plex entity for the webos TV won’t stay available. Sometimes when I restart HA (and have the TV on and Plex running), the entity will show up, but after some time, it will go to unavailable and never return (even when it is active and playing media)

Looking at the Plex API, it’s definitely there and it shows up in the plex sensor as an active client.

Any idea what’s going on?

  1. There was a an issue in the underlying library where play_media didn’t work on some clients. This is fixed in the beta if you’d like to give it a shot before the next release.
  2. Are there any errors about Plex in the HA logs?
  1. You mean unreleased? I am not in a good position to test out beta releases. I usually stay a little behind to keep some sense of stability
  2. No errors in the logs. Everything looks fine in HA and Plex (when the plex client actually showed up in HA)
  1. Correct. It’ll be in the 0.108 official release.
  2. What about when the client is playing but is not showing in HA? If the client is idle then it may go unavailable as it’s no longer communicating back to the Plex server. This is expected.

It always shows unavailable now, but sensor.plex_server shows the correct count and even lists the player and what’s playing in the attributes

In this screenshot, media_player.plex_living_room is the entity that is tied to the player LG OLED55B9PUA that is playing Mandy

I see. I’d expect to see something in your logs that would indicate why the player couldn’t be updated.

What version are you on now?

If it persists can you add this to your config and share some logs?

logger:
  logs:
    homeassistant.components.plex: debug

Also curious if the problem goes away if you pause & play on the client.

Did not know about the component-level logging options. I will set that.

It still shows as unavailable

After restarting just now with plex set to debug log, and the entity showing as “idle” (it’s on and ready) in the states, I tried calling the service (same as first post). There are no logs in the log viewer indicating that plex was called

After turning the TV off, then back on, opening up Plex and playing a source, this is the contents of the log:

020-04-04 15:33:04 DEBUG (SyncWorker_11) [homeassistant.components.plex.sensor] Refreshing sensor [sensor-c7ceb64756bdafaf0a6aae746ab31f8cb5d1c117]
2020-04-04 15:33:20 DEBUG (SyncWorker_11) [homeassistant.components.plex.server] Updating devices
2020-04-04 15:33:20 DEBUG (SyncWorker_11) [homeassistant.components.plex.server] Ignoring Plex client owned by 
2020-04-04 15:33:20 DEBUG (SyncWorker_11) [homeassistant.components.plex.server] Refreshing c7ceb64756bdafaf0a6aae746ab31f8cb5d1c117:2395adb7-84f0-4622-b570-fd6d73400964
2020-04-04 15:33:20 DEBUG (MainThread) [homeassistant.components.plex.media_player] Refreshing media_player.plex_work_lappy [<PlexClient:http://10.0.1.122:36:work-lappy> / <Track:60788:Black-Hoodie>]
2020-04-04 15:33:20 DEBUG (SyncWorker_17) [homeassistant.components.plex.sensor] Refreshing sensor [sensor-c7ceb64756bdafaf0a6aae746ab31f8cb5d1c117]

In particular, the “Ignoring Plex client owned by” bit is new. There’s nothing else there that makes any sense

Interesting. I have some ideas, let me dig a bit.

Is your Plex server linked to a Plex account? Or have you kept it unlinked where you don’t require a login or token?

I’m not sure how/why you’re getting that “Ignoring Plex client” message with a blank username. I’ve added & cleaned up some debug logging that’ll be in 0.108 (and is in the beta now) to help troubleshoot.

Plex works totally fine with all other clients. The token is valid and everything there is working otherwise. It’s just this one client not showing anything. I’ll keep an eye out for 108 and hope things are better :slight_smile:

Just now, I was playing music for a good 10-15 minutes and it didn’t come out of “unavailable” state.

I paused the music for 5 minutes or so, then it appeared as “idle”.

I unpaused the music, but it’s still showing idle.

It’s refreshing, but not showing any new state

2020-04-05 08:43:25 DEBUG (MainThread) [homeassistant.components.plex.media_player] Refreshing media_player.plex_living_room [<PlexClient:http://10.0.1.141:32:LG-OLED55B9PUA> / None]

Ok, if you’re using a token it’s linked to an account and that’s good to know. Has this specific client ever worked properly?

It’s a new TV as of a few weeks ago and I have not been able to ever see it work correctly

Also oddly… 10.0.1.141, as the log shows is NOT the IP of the TV that Plex runs on.

Also, forgot to mention that I also tried removing and re-adding the Plex integration. Same behavior before & after

Ok, thanks for all the info. I have two last questions. I should be able to test with an LG WebOS Plex client and want to make sure it’s a similar setup.

  1. Did you have to link this LG Plex client with a pin or login link?
  2. Did you customize the monitored users (or other options) in the Plex section on the Integrations page?