Custom Component / Card: Plex meets Home Assistant

Also when you click that url what does it show?

Going to that URL gives me “401 Unauthorized”

There is your error, you are probably entering incorrect token.

I am using the token that my Tautulli server uses.
I got it from going to app.plex.tv and copying the token from the URL. Do I need a different one?

You need the one from the host you are entering, so that IP and port.

I had no idea that a single Plex server would have different tokens based on local or remote access.
How do I go about finding the token for IP access? The URL path doesn’t display a token like it does when accessed over the web.

Please read readme, all the questions you had here including this one are answered there.

I do apologize, I did read the read me through about 10 times and google searched my errors and read a good portion of this thread before I posted any questions.

I do have it working now. It was not clear to me that there is a Plex-Token and also a X-Plex-Token.
I have worked with Plex-Tokens many times, and I am sure that added to my confusion.

But it may benefit your UI editor and your read me to clearly specify that you are looking for the X-Plex-Token. Thank you again for your help and your plugin.

Glad to hear you got it working, I will clarify it in readme and UI. I wasn’t aware there is another type of token.

I guess the other one is referred to as the Unique Identifier.
Third party apps like Tautulli pull that long string to tie in your server.

I was confused because you find that unique ID from the address bar, and when I clicked on the how to find your plex token link it said log into plex and grab it from the address bar.

I am sure some of that is my ignorance.

I am having a new issue. When I try to play content from a card (plexPlayer) I get a toast error "Failed to call service rest_command/pmha_playback. Service not found. Unsure where I need to start with trouble shooting this. Voice command still works flawlessly.

**EDIT
I have tried using the version 2 UI configuration and it does not show my plexPlayer as a selectable entity. My Plex instance is remote from my HA instance and Plex Player, maybe this is something I missed in the README. The Machine ID “clients” url only shows Plex Players local to the Plex server. Apologies if I have missed something in the README.

        type: custom:plex-meets-homeassistant
        token: ***
        ip: ***
        port: ''
        libraryName: Movies
        protocol: https
        maxCount: 8
        sort: originallyAvailableAt:desc
        runBefore: script.start_rjm_plex
        entity:
          plexPlayer: RJM
1 Like

This looks awesome! Looking forward to start adding this into my setup.
I got a question about the shown content, are collections supported instead of libraries? With the new Plex dynamic collections, it’s easy to create playlists for a specific style of movie, that updates based on criteria (eg unwatched only, top 25). It would be neat if I can specify this collection to show instead of a library.

Mainly Shared Plex servers configuration section.

Oh that is a very interesting idea! I will look into it. Would you mind creating a feature request via issues on github?

Does this mean I need to run a local plex instance to ‘route’ the stream to local plex clients?

Add information about your local Plex server which sees your device on which you wish to play content. This is done by including a new key, “server” having additional keys:

Sure, just opened the FR on github [Feature Request] Plex Smart Collections · Issue #28 · JurajNyiri/PlexMeetsHomeAssistant · GitHub
as mentioned there, I’m open for testing if you need anybody :wink:

You can add server from which you want to use target devices into plexPlayer.

Yes, if your remote server doesnt see your local devices, you need to have a server which sees them, or use cast/androidtv/kodi.

2.1 has been released

New Features

  • Ability to use playlists as a library
  • Ability to use collections as a library

HI Ive been playing with for a few days now, can you get it to Display content but get get the play function working. I have noticed that most people have a local Plex server, However I have a remote server should the play function still work?

Yes, through kodi/android TV/cast without additional setup. For plexPlayer check readme and detailed configuration. You will need to set it up manually through code config.