PlexDevices - Custom Media Player Component

Fix posted to address the season issue

1 Like

@rpitera, have you tried using Plex DVR to record TV shows to a writable Samba share? Have a look at Storage Limitation section in Plex’s website:

Plex relies in the list of storage devices directly from NVIDIA Shield. Kodi does not. I’m not sure if there’s a file manager for Kodi, but in NVIDIA Shield, Android TV does not allow write access to Samba shares unless it’s classified as an “internal volume” similar to USB hard drives connected to the Shield. If you connect your external USB hard drive to Shield as a Media Storage, Android TV won’t allow write access to it unless you classify it as internal volume.

This is even with a Media Optimizer feature. Plex can’t write transcoded movie to a Samba share.

Honestly, I don’t think you’ve been cheated by Plex. I’m not sure if it’s a limitation only in NVIDIA Shield or if it’s a limitation for Android TV as a whole, which includes Nexus Player and other Android TV devices.

Again, sorry for going OT and will gladly move this to a PM if anyone objects.

@GraysonPeddie I think your missing the point here; it’s not about storing media and I don’t use DVR. This is about the metadata for your collections; all the movie/tv posters, ratings info, banners, thumbnails etc. All the stuff that makes Plex really useful in cataloging your collection. For PlexPass members this also includes all the information in the enhanced music libraries as well. None of this can be stored anywhere on the Shield except for the Shield devices internal memory, even if you increase that space by using adoptable storage as Plex decided to use a secure location.

This isn’t an OS issue or even a Shield issue, this is solely due to Plex programming. Kodi uses the standard data location in Android, so when you adopt a USB drive as internal storage, your metadata is stored there.

It’s not about the collections or DVR or samba shares. It’s all about where your metadata is stored. Even with a moderately large collection, you can quickly eat up your internal storage space and some have even reported their Shield’s crashing as a result. Plex advertised the Shield as the “ultimate media server” and pushed it hard, but never let on about these limitations until months later. The article you referenced - which I already saw - was only added when users started complaining about the multiple issues. Things like the inability to use PlexMix on the Shield wasn’t even added to that page until a couple of weeks ago.

So yeah, I feel cheated. And the limitation is not for Android TV as a whole, only Plex Media Server on the Shield, since that’s the only Android TV device currently supported to run PMS.

Okay. My apologies for going off-topic.

I don’t know if it’s possible to store metadata in another storage device, such as a Samba share, though, but I get your point.

1 Like

When browsing your server in the web client go in to your account and you should find web hooks.

Plex has posted a node.js example on how to do home automation with web hooks

/R

I got that, but what URL do I put in it for Webhooks? Do I put in something like http:\\localhost:1250 (I used “\” instead of “//” so Discourse does not convert the localhost address into links; otherwise, I’ll get a “Popular Link” badge…)?

Can you guys create a new discussion topic on web hooks? Its better for this thread and for people who want to know about web hooks

I continued discussion in my new thread.

Please pardon me for going off-topic.

FIX DEPLOYED

When using both entity_namespace and use_custom_entity_ids:
BEFORE FIX: media_player.xyz
AFTER FIX: media_player.plex_xyz

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).