PlexDevices - Custom Media Player Component

OK, I admit… Sometimes my computer and programming skills are just not enough… :frowning:
How do I start using it?
I’ve put the plexdevices.py under homeassistant/deps: No luck.

Shall I replace the file or just put it under deps or somewhere else?

In short: help plz…
(and yes, I’ve read the documentation on github)

// Tommy

Congratulations…great work @JesseWebDotCom

You need to put it in custom_componenets/media_player

1 Like

You can also disable the existing Plex component or add an entity_namespace: 'plex' option to it so you don’t get confused as to which is which.

Code has been approved and should be in the next release!!! Some features I had to pull (i.e. Defer for another time) to get this released:

  • dynamic groups
  • positioning (i.e. Progress bar)
  • frozen state detection

But all the other features are still in. That was way more work than I anticipated but I’m learning so that’s good.

7 Likes

If you don’t want to wait for the next release and want to start using it now:

  1. Copy this file to your ha/custom_components/media_player folder: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/media_player/plex.py
  2. Follow these new media_player.plex instructions: https://github.com/JesseWebDotCom/home-assistant.github.io/blob/b1a671c1a0b6c74a5ab01d43022668e1ec2b6dbb/source/_components/media_player.plex.markdown
2 Likes

Nice!!
One question that pops up is about the “shut down” button down to the left.
Can I use that to stop streams to external users, i.e. users that I share my library to?
(This is a very requested feature in the Plex community, it would be nice to show them how it would look :smiley: )

// T

AFAIK no as that’s not supported in the plex protocol

Well, it figures now that this is actually going to be part of HA I am probably going to be moving to Kodi.

I’m doing some initial testing on the Shield but if it works, I will be migrating over. I just feel like Plex isn’t about to address the metadata issue and the lack of space on the internal memory of my 16gb Shield is effecting performance and stability.

I hope I was of some help in the testing and if Plex ever gets their shit together I’ll come back.

Are you using your shield as a Plex server?

TL;DR Be aware you are likely adding another massive tinker hole to your life!

Slightly off topic but…

Performance wise SPMC is the go for Shield rather than Kodi, it’s a Kodi fork for Android and specifically for the Shield. Check the wiki for audio settings etc so you get it working properly with pass through first off. You can install it alongside Kodi. It fixes a few of the audio issues and adds voice search. It’s still Kodi so you can use all the skins and plugins etc. It’s not up to Kodi Krypton 17 yet, it’s still Jarvis 16 so you can’t use Krypton only plugins. I’ve found Krypton to be very sluggish on the Android TV but still have both installed for testing. Skins wise I’d recommend staying light. I use Arctic Zephyr for lighter setups (Raspberry Pi, Mi Box), and Titan (Beta) for devices with a bit more oomph.

If you have a Plex server on your network already there is a Kodi plugin (official and unofficial) that will let you use Kodi/SPMC as a backend. Emby is worth looking into as well and also has a Kodi plugin. Either way you would probably be better off at least sticking a USB3 stick into the back of your shield and bumping that 16gb up to 128 if you are having space issues. I’m not sure if mounting a network drive to shield is fixed yet but last time I tried it wasn’t possible to get it to stick, that was pre Nougat.

My current setup is Media stored on a Synology (Xpenology HP-N40L), CPU is too slow so Plex and Emby servers are now running on PC, and various clients link to the servers for Metadata. Main viewing device is Shield, with Emby plugin in SPMC or Kodi. Plex and Emby are kept in sync via Trakt. I use Emby now for pretty much everything except syncing media to my local devices. My kids prefer plex. All allow for different user profiles to keep track of things or restrict content as needed.

Oh - I saw/heard this yesterday and thought of you… Rick & Morty - The Recipe For Concentrated Dark Matter

1 Like

Yes. Plex pushed this as the ultimate Plex server but neglected to explain where they were putting the metadata.

I’d go with the network option if I had a wired network but even my fast WiFi doesn’t have the bandwidth for 4k.

That’s why I bought the Shield in the first place, so that I could keep everything local.

I appreciate your advice and I will look into all of it. I just got Kodi installed and figured out how to get my first library in so I’ll do some testing and see what shakes out. Not having any prior experience with Kodi or SPMC, your tips are really helpful! Thanks again.

I run HA, so I’m used to tinker holes!! :laughing:

No 4k TVs here - Plus I’m lucky to maintain an ADSL 1 connection with any consistency. It was the reason I stopped using plex, when I was without internet access for a couple of weeks due to a cut cable I found myself unable to access my local media due to having a lifetime pass. The irony is that if I had been using the free version there would have been no problem.

I use an EoP adapter on my shield for a wired network. Wifi is good here but ethernet offers stability.

Another thing to mention - if you go to Storage settings on the shield you will be able to share the drive (include hidden folders) over the network which allows for easy backup, configs, file transfer etc.

storage/Android/data/org.xbmc.kodi/files/.kodi

storage/Android/data/com.semperpax.spmc16/files/.spmc

I’ve moved the data directory for Plex once to a separate drive using the symlink method and it worked fine, but that was many years ago on a windows machine. Yeah, 16 GB is going to be limiting as a server. I just finished reading through their page about the storage options for shield. There seem to be several caveats. It’s cool that the shield is capable, but storage is a different matter.

I’m finding Kodi to work extremely well and highly configurable. I still want to check out SPMC as Barry suggested as I do find some of it confusing on the Shield and the web interface doesn’t provide me access to things like adding libraries - unless I’m not doing right.

Hey, I’d love to discuss this further as I could use the knowledge and it may help others, but it’s diverting way off the thread topic - I take full responsibility for that, mind you! - and I am wondering if anyone would be interested in discussing this further in a separate thread. I’m thinking we could even discuss how Kodi/SPMC integrates with HA.

If this interests anyone, just like this post and I’ll start another thread and link it in here.

If not, please accept my apologies for straying off topic… Again. :blush:

1 Like

Agree with starting a new thread

1 Like

Yeah, I’m really sorry about that.

Ok back to topic.

I realised it doesn’t keep track of videos played from the watch later section. When someone is playing a video from the watch later section, the Plex client status remains idle. Is this a limitation from Plex or the component itself?

What do you see in Plex’s now playing web page? If you don’t see it there, then it’s a limitation.