PlexDevices - Custom Media Player Component

Sorry it took me so long; I’m doing testing for three or four different projects now!

So Movie worked well; Episode did produce results, but I need to verify the syntax of the episode number;

I used your example in the read me docs because it was Rick & Morty and I knew I had both seasons. All I changed was the library name. But it played a video of the DVD extras, one of the animatics. It would have been in Season 0 as a “Specials”.

Do you call episodes in the standard “S01E10” type format or…? Couldn’t find a reference in the docs and the example just had “15” in the value.

Can’t test music at the moment; I pulled my music libraries from the Shield because the metadata was going to kill the Shield. I will create a small non PlexPass music library for testing though and come back with those results.

Thanks, I see you’re busy on the ring project (I’m waiting patiently for that one).

When it played the season 0, what exactly did you put as your json?

Exactly what you had in the episode example, with the library name adjusted to my library:

{
    "entity_id" : "media_player.plex_shield",
    "media_content_id": "{ \"library_name\" : \"TV Shows\", \"show_name\" : \"Rick and Morty\", \"episode_number\" : 15, \"shuffle\": \"0\" }",
    "media_content_type": "EPISODE"
}

It’s playing the 15th episode not episode 15. Can you confirm? From season 0, count the number of episodes up to and including the one that played. Is that number 15?

Nope. If it’s just going off the position in the library then in Season 0, “Episode 15” would have been the Carl’s Jr Hardees commercial. Here’s a snap of it in the library.

The three animatics in the library are Episodes 22, 23 and 24 respectively.

But the question for me still is how do you call an ep? For as long as I have been using media centers, cataloging was always Season Number Episode. So Season 1, Episode 10 (Close Rick-Counters of the Rick Kind) would be expressed as S01E10. That’s how I would expect to call it in a play media action because that’s the way it’s always worked when comparing it to metadata sites.

Is this not the case? Are you doing absolute numbering from a show Pilot = 1, next episode is number 2 and so on?

1 Like

This part of the code was derived from this discussion:

All I needed at that time was have the ability to play a workout video. These workout videos were added to a Plex library as “TV Shows”. But in the directories they didn’t have season subdirectories and the files had ‘title - s0en.m4v’ format.

So, when you look at the Plex data reported for these titles the parent data structure does not have a season title.

Other TV Shows I have on plex in another libraries do have parent data structures with season titles.

I do agree that this component should support a json language that allows for selecting season (optionally) along with episode number.

1 Like

I think that this is an important part of the play_media action and should be supported. Even Plex conforms to these guidelines when suggesting how to set up libraries for metadata generation:

https://support.plex.tv/hc/en-us/articles/200220687-Naming-Series-Season-Based-TV-Shows

Now if the Plex API isn’t providing that information, that’s another thing entirely. (And this is always a possibility with them.)

But if it does support it, I think it’s kind of mandatory to include it since it’s pretty much how everyone does it.

Update coming to support season number and episode number (instead of episode index), ex.:

{
    "entity_id" : "media_player.plex_7b8c4c63_38ff_417d_ac14_0457796ee1c1",
    "media_content_id": "{ \"library_name\" : \"Adult TV\", \"show_name\" : \"Rick and Morty\", \"season_number\" : 2, \"episode_number\" : 5, \"shuffle\": \"0\" }",
    "media_content_type": "EPISODE"
}
1 Like

UPDATE POSTED

1 Like

When you post an update, could you put the link in the post? In a post this long, it gets harder and harder to find the link and the link in the OP is 404 now.

Will test at some point tonight.

I will now maintain links to the code and documentation in a single place - in the first post at the top of this page. I have edited previous posts with links to reflect this as well.

Scroll up to the first post for links to the latest Code and Documentation

2 Likes

Sorry, fell asleep in my chair last night!!!

Tested the new method and can confirm that I indeed did get Shwifty! (Was wondering what episode you chose!)

Music is working too but did not test playlist yet. Will do it if you need me to but I’m thinking it should work since everything else did.

1 Like

Guys - I’m basically stuck getting this officially incorporated.
https://github.com/home-assistant/home-assistant/pull/6054#issuecomment-282914840

I’m not familiar with these automated build systems and their results are confusing. Looks like I’m almost there but I need someone experienced to take a look and find out what needs to be done to fix it.

Is it possible to discover plex clients, without a plex server?

I host my plex server in the cloud and my Rasplex clients connect to that.

It looks like you’re pretty close from following the PR - you may want to post for help in the Dev forum or maybe reach out to another dev in the forums that you have seen do a few PRs (majority I’m sure would help but I don’t want to ‘volunteer’ anyone) via PM.

roger that

Hey guys!

What’s the status on this? It looks very promising!

I’m trying to get it to HA coding standards. Theres some traction on it now and it looks like were close to being done. You can see progress and get the latest code here:

3 Likes

congratulations! Can’t wait to see this in the next release!

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