PlexDevices - Custom Media Player Component

Any luck with the Shield problems?

I’m not clear on what problems you are experiencing and whether that’s the intended behavior. Can you summarize your setup and what you are experiencing? Everything works “as expected” with my 16GB shield both running as a server and client and just running as a client.

Great!

Found another “issue/regression” compared to the old implementation. It is an issue for me as a Appdaemon user, when using listen_state on entities. In my opinion “media_position_updated_at” should only be updated when a state change of the player happens. Now it seems to update every poll or so, this wreaks havoc on my automations since they get triggered every poll as if something interesting has happened to the entity.

/R

I’m pretty sure this is required to display the progress bar as the state will remain “playing” but the progress will update between scans. If you can get me code that keeps a working progress bar and addresses your scenario, let me know.

I thought I laid them out in this post above?

Sorry! I was vague, of course it can happen during play, but in this case it also updates when idle

rpitera - I wasn’t able to follow as that looked like expected behavior. Can you layout, in words, your setup, what you are doing, what you’d expect to happen, and what actually happened?

Have a Shield, running Plex Client and PMS.

Playing a movie in Plex. Expect the plexdevices client to behave like the current plex client.

Show me an instance of the thing I’m playing, when I play it.
Have functional controls that change state when the state changes outside of HA.

What actually happened; I get a really nice thumbnail now but outside of that the media player doesn’t have functional controls or state changes that relate to what is actually going on.

In short, over the changes and updates I have actually lost functionality.

Let me see if I have this right:

  • Shield is both client and server, you play media on the shield client, you see all expected metadata (name, thumbnail, progress bar, etc), but you only have a stop control button

Yep! You got it. Also, the stop button not only doesn’t do anything but pressing it generates a stream of errors (and I mean a whole lot of them). It also disappears completely if the video is paused outside of HA.

Somehow, when we started out, I still had controls that were functional. Along the way I lost that.

Sorry; I thought I was pretty clear in my post, giving the situation as well as screen shots.

So that’s expected and I actually added that for you ;). The plexapi requires an ip address of a client to control it. When you run the client on the same device as the server, the client address is set to a loopback address (127.0.0.1). This address is non-routable and therefore the controls don’t work. I’m pretty sure I tried to hack around it without any luck. So instead of showing you non-functional controls, I remove them.

I did add an optional parameter if you don’t like this behavior. Add this to your config for your “plexdevices” entry:

show_all_controls: true

You should see all controls but I bet they don’t work (because of the scenario I laid out above). I believe the last time the controls worked for you is when your server was separate from your client (i.e. on your pc and you used the shield as the client).

I’ll have to go back and test with the original Plex client again to see if this is the same case then. I’ll do some more testing and get back to you.

So are you saying that using Plex client on the same machine as the PMS means that using media states in automations won’t work either?

I’m getting more and more pissed off about this situation with the Shield. (Not at you of course!) I’m feeling like I got sold a bill of goods that wasn’t presented truthfully.

States are unaffected - you should properly see playing, paused, idle, off
The only thing affected are the controls where I dynamically hide/show them based on detected capabilities (in the case of client+server, I hide).

I love my shield for what its worth. I use it as the best performing, best experience, plex CLIENT. I have a dedicated PC as my plex sever as I want something that can handle multiple transcodes (streaming clients, syncing, etc).

That is absolutely stupid. They have the actual client IP, not using it and instead going with loopback is just another example of laziness on their part.

That’s plex, not Nvidia. I see the scenario similarly coded around in the PlexPy api as well. There’s probably some hack around it; I just haven’t found it.

So if I use show_all_controls, I should see correct states then; they just won’t work to control from HA. Did I understand that correctly?

You should always see correct states, period. If you use show_all_controls, they will be force shown to you (i.e. not hidden because my code detected you are running a client/server combo).

I was talking about Plex - sorry I didn’t make that clear. Same thing with their choice of metadata storage. They blame nVidia when it has nothing to do with them.

I love mine too, but I’m starting to fall out of love with Plex very quickly.

OK, then that is an actual issue then, because when I am playing a video, all I see is a stop button. If I pause (outside of HA) the button disappears completely. (See screen shots from post above.)

You’re saying that I should see a play button when video is playing and a pause button when video is paused, right? I’m not currently seeing that behavior.

Fix posted - let me know if that solves the problem