Custom Component / Card: Plex meets Home Assistant

Hi, i remember a while ago, if using Plex on http and HA with nabucase https, that the card doesn’t work because of SSL issues… Is there already now improvement to make it work when Plex runs on http without valid certificate?

Hello,

No, and there never will be. It’s not possible.

ok, to make it work with nabucasa , then i need to install a valid certficate on the plex server?
also , in your card config, when using nabucasa , do i need to point to a local IP ? or do i need to my public ip, and have 32400 open with protocol https?

You can use hostname instead of IP. You need to create reverse proxy with a valid certificate (letsencrypt with nginx for example) so that when you open https://plex.myawesomedomain.com it loads your plex. You use this URL in the card.

ok, gonna try lets encrupt
but for renewal lets encrypt, it checks port 80 , right? i need to open that one then?

There are many guides available on this that will provide better information than me.

ok, but doesnt mather what tutorial i follow, i need to buy a domain name? also i dont have a static public ip

You can use duckdns for example instead. You dont need the domain, but it is better solution overall.
Duckdns with some service also handles dynamic ips. If you do not have public ip you need to buy it or figure out some other solution, like reverse ssh tunnel to vpn.

You could also open app.plex.tv, look into network requests in F12 and look for hostname https://*.plex.direct:32400/ … you can use that, but I am not sure if it is stable or it changes. That is reverse proxy provided by Plex. You will be dependent on plex cloud though.

cool, lets try that,; the reverse proxy from plex is indeed a long string
it contains public ip + some token
public ip changes offcourse, but i can replace it with dyndns url
so lets hope that token doesnt change
cool!

ok, configured, lets try it out when i’m home :slight_smile:

did a minimal config like below, i have 2 players configured, i have some more samsung, will add them later
But when i have 2 players added, how can i select the player on the card where i want to cast it too? i dont see it?


      - type: custom:plex-meets-homeassistant
        token: !secret plex_token
        ip: aa-bb-cc-dd.xx.plex.direct
        port: !secret plex_port
        libraryName: Movies
        protocol: https
        maxCount: 10
        entity:
          plexPlayer:
            - identifier: Plex for Samsung
          cast: media_player.google_hub

In this example, it will try to first play via kodi, in bedroom. If that kodi is unavailable or off, it tries in living room kodi. If that fails, it moves on to android tvs, starting with living room, continuing with bedroom and ending with kitchen. Next, if a possible player still has not been found (all kodis and shields are off) it tries to play via plexPlayer, trying TV 2020 on local plex server and if not found, IP 192.168.13.50 on remote plex server. Finally, it tries to cast into media_player.bedroom_tv.

You can use input_select or input_text along with some templates / automations to achieve what you want - manual select of one entity to play on.

Everything is in readme :slight_smile: I also highly recommend using UI editor for configurating, it does a lot for you.

ok, gonna read, but i do use yaml, dont think the UI editor works for me?

Oh, I totally forgot about ability to still use yaml. UI config for everything is just too convenient.

Not sure if it is possible. Detailed configuration should have everything you need it will just take you more time to set up. UI automatically discovers stuff for selections… plex players and all available entities, all possible sortings for every library, all available libraries including collections etc, possible different displays etc…

np :slight_smile:

that input_select: , would that be a comma seperated list? i dont see an example of it in the defailed configuration
thnx

Just the entity id… input_select.example

You need to create it first of course. It will read its value and then use THAT as a player. So your input_select.example could have choices media_player.google_hub and Plex for Samsung

oh ok, thnx

ok, for now , just added the media_player.google_hub , when i start playing, the hub goes directly to "off’ state, when it was before idle …
need to test again when i’m home, if i can see an error on the hub
strange though

This is the error I see, any idea what could be wrong?

Something went wrong

On a more serious note, try casting directly through Home Assistant service: Google Cast - Home Assistant and see if it works.