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

Thanks but my idea was to go to youtube add some music videos to youtube playlist then play that list using HA automation . Like this

  • Hey Google , Play my music >>> IFTTT>> HOME ASSISTANT>>media_player.chrome>> all speakers in the house.
    One can only wish lol.

Not really.

I think that the link I mentioned already does it (you can start either a playlist already saved or a radio based on a playlist in Google Music) so it is only a mater of time someone with the appropriate skills manages to do it with Youtube (if not already done).

Thank you very much but your link is great for people who what to setup Google music . I am interested in youtube. I searched all over the net and could not find code for youtube. I do hope somebody with appropriate skills will make one for youtube.

It would be nice to play a livestream or playlist from Youtube. Any progress on this?

Also looking for this, have not found a solution!

I imagine the easiest way of doing this would be to automate the Chrome Browser somehow and output your audio to the chromecast

I am not a programmer to achieve that.

I am able to play videos this way. Any idea how can I share the link directly from my phone using some kid of sharing service?

I don’t understand why not playing directly from YT Music app on the phone to Chromecast Audio.

Cause I want to play in other devices. Like panel tablets. Moreover I do not own a chromecast device.

My guess initially was that you wanted to send the link to Youtube video from mobile device to HA, but it would have been easier to just use the mobile device to cast to Chromecast devices.

I think that browser mod might be what you are looking for in order to be able to play on the browser running HA on tablet/pc.

Yeah you are right. I am using it and it is working fine.

I would like now to speed up the link sharing between youtube on mobile (for example) to HA so i can easilly call the service which plays youtube audio on the browser mod

Hi.

Is it possible to play a youtube playlist?

Thanks
Mike

1 Like

I have this worknig with a script, that calls the media_player service like this:

alias: Play on chromecast
sequence:
  - service: media_player.play_media
    target:
      entity_id: media_player.tv_tv
    data:
      media_content_id: >-
        {% set msg
        ={'app_name':'youtube','media_id':'dQw4w9WgXcQ'}%}{{
        msg|to_json }}
      media_content_type: cast
mode: single
icon: mdi:youtube

changing the ‘media_id’ to ‘playlist_id’, as mentioned here, would let you play a playlist instead.
also adding:

,'enqueue':'true'

in there would let you enque a video, or a playlist.
i have a short explanation, with examples here.

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