Is it Possible to stream youtube video play list to Google Chromecast Audio?

I finally got Youtbe playlist working with Home Assistant

It works for Youtube Music and Videos, to a TV using chromecast

Create a new script and add:

**service**: media_player.play_media
target:
  entity_id: media_player.living_room_tv
data:
  media_content_id: ' { "app_name": "youtube", "playlist_id": "PLSlWCUnZ5deDcEWu50m_I-iCgIfm0jqv9", "media_id": "CoHD4weW5NI" }'
  media_content_type: cast

I hope it can help anyone out there having similar task/issue.

6 Likes

how did you get the playlist and media ids?
I am trying to do something similar, but with autogenerated playlist and all I have is just informations about now playing track :confused:

EDIT: tried with regular playlists with the same result :frowning:

Where are you getting your playlist from?
Web browser or mobile phone app?

Let’s use this youtube channel playlist:

btw, Andy’s channel is Awesome!

https://www.youtube.com/watch?v=ArBy7uqSJkY&list=PLckvFmDGYhtu7rVvxbYBgHXCytCnoc8u2

Where the media_id is :

ArBy7uqSJkY

and the playlist_id is:

PLckvFmDGYhtu7rVvxbYBgHXCytCnoc8u2

You can copy and paste your link here and we can have a look if you still not find the info.

Cheers
:wink:

1 Like

oh! my bad! I was starting the stream from mobile app, then casting it to speaker and then looking for the data in developer options at home assistant’s dashboard :wink: while the id was totally easily to find in the URL [if only I was trying it from web browser ;)]

thanks!

1 Like

Hi thor_c

Can I bind the script here to a button? For example, when I click that button, can it ask me for a youtube link? or youtube ID . If so, can you describe it?

Hi, can I get this to work for video playlist (containing video) with google speakers?
I just need it play the audio

Tried adding to the script, but I’m not getting any audio
on node red I just get error