Plex Playlist - Google Cast

Hi there,

When i use the build in media browser i can easily cast a plex playlist to my google home mini. Works perfectly.

I just can not seem to figure out how to do it from a automation / node-red / developer tools.

What am i missing here? I`m perfectly able to cast other media (video, songs, pictures), just not playlist. But given it works so easy from the media browser i must be missing something…

Any help would be greatly appreciated! Hate to wake up to the same song every day :wink:

Additionally, i read other topics like this:
https://community.home-assistant.io/t/how-to-play-plex-playlist/8557/9

Asked Chat GPT, with gave 101 different anwsers that did not work.

Read the documentation: https://www.home-assistant.io/integrations/plex/

But nothing…

I’m casting to Chromecast Audio, but I wouldn’t expect it to be different for the Home Mini.

I have two drop-down input helpers for choosing the playlist to play (e.g. Upbeat fresh) and the speakers to play it on (e.g. media_player.office_speaker), then I have the following automation. Note there aren’t any quotes around the playlist or speaker names in the input helpers.

alias: "Media: play Plex playlist"
description: >-
  Play the specified playlist on the specified speakers when the Play Playlist
  button in the dashboard is clicked.
mode: single
triggers:
  - entity_id:
      - input_button.play_playlist
    trigger: state
conditions: []
actions:
  - target:
      entity_id: "{{ states(\"input_select.plex_speakers\") }}"
    data:
      media_content_id: >-
        plex://{ "playlist_name": "{{ states('input_select.plex_playlist') }}",
        "shuffle": "1" }
      media_content_type: playlist
    metadata:
      title: "{{ states{'input_select.plex_playlist') }}"
      media_class: playlist
      children_media_class: null
    action: media_player.play_media

which is triggered from my dashboard with an Entities card:

type: entities
entities:
  - entity: input_select.plex_playlist
  - entity: input_select.plex_speakers
  - entity: input_button.play_playlist
title: Playlist caster
show_header_toggle: false

Hope this helps!

1 Like

Amazing!!! I have no clue how you managed to figure it our. I tried a million variations on this. But it works!!

Tanks a lot!!!

action: media_player.play_media
target:
entity_id: media_player.home_study
data:
media_content_id: “plex://{ "playlist_name": "Easy Listening", "shuffle": "1" }”
media_content_type: playlist
metadata:
title: “Easy Listening”
media_class: playlist
children_media_class: null

1 Like