Casting Plex tracks

Hi,

I’m trying to write a script that would play content from my Plex server and cast it to a Google Chromecast device. I tried the following:

> alias: Bedtime
>   sequence:
>    - service: media_player.play_media
>      data:
>        entity_id: media_player.master_bedroom_speaker
>        media_content_type: PLAYLIST
>        media_content_id: '{ "playlist_name": "Ambient Sleep", "shuffle": "1" }'

When the script executes I can hear the cast notification sound through the speakers but no media plays. My guess is that the “master_bedroom_speaker” entity (a Google Chromecast Audio) has no knowledge of the plex server. I did notice that if I go to the Integrations page and click on the Plex box I see some entities called “Plex (Plex Cast - Chromecast)” - should I be using those entities instead?

Thanks

There is no Chromecast functionality in the Plex integration today. It’s possible that the Plex server may expose & proxy Chromecast players, but you’d have to test that. Try the other entities and let us know if it works.

I actually got it work by figuring out the URL of the media on the Plex server and using that as the media_content_id. Next time I’m at my desk I’ll post details.

Looking forward to seeing your solution here, I just recently started with Plex so keen to test out some features

Sounds like you are using the Cast integration instead of Plex. However perhaps this is an opportunity to help them work together better…

Dave, I used this reddit post as a guide. Wish I could take credit.
https://www.reddit.com/r/homeassistant/comments/82c53n/can_i_write_a_script_to_play_a_plex_playlist/?utm_medium=android_app&utm_source=share

2 Likes