Play Youtube video on Chromecast with script/service

Tags: #<Tag:0x00007f1ba34f0f18>


I want to auto play Youtube video/playlist on Chromecast but not found any way. I search about but it say service not exist, media_player.play_media will not too: Googlecast/Chromecast Play Youtube TV App/Channel


See here :


It show error:

Unable to find service media_extractor/play_media

I use hassio 0.64.3


you will need the add below to config

# Example configuration.yaml entry


Thank you. My fault with quick reading.


Thnx jivesinger, but it doesn’t work with Do you know why?


Would media_extractor work with Youtube Music urls. I’m new to this and would like to trigger a relaxation music playlist upon tv turning off, I’m already hooked to a webos tv but need some clues as to how to cast the playlist.

– edited to include answer –

Thank you so much I got this to work with youtube music casting to Google home mini
“entity_id”: “media_player.master_bedroom_speaker”,
“media_content_id”: “”,
“media_content_type”: “audio/youtube”

I believe this might also work without advertising since I have a subscription too. Don’t know how it might apply to others.


@3dgr, will this play the entire playlist without pause?


@goprojojo Yes, I believe it would play the entire playlist. I need to redo my setup so I can’t confirm now.


Sounds promising. I also tried to play a YouTube video playlist ( ) on my Chromecast TV but it plays only the first video. Don’t know if it’s possible what I want. Any suggestions?


@goprojojo Did you try to see if it would start directly ?


It starts directly but the playlist stops after the first track. Below my automation.yaml.
Any suggestions?

- alias: 'TEST'
    platform: state
    entity_id: binary_sensor.test
    to: 'on'
    - service: media_extractor.play_media
      - media_player.tv_bedroom
        media_content_type: video/youtube


Just tried this as well. The reason why it is probably not working, that the media extractor does not support it. This is the warning:

Playlists are not supported, looking for the first video
1:35 PM components/ (WARNING)


So is there another way to play Youtube video playlist (with or without media_extractor)?