Play a youtube video to google home

Hi, I’m new to the world of home assistant and I started creating some scripts but I’m having trouble creating a script to play a youtube video on google home in order to recall it with the voice. Can you tell me the best way to do something like this?

I am with hassbian last version.

Thank you.

Nobody know? :slight_smile:

I am trying to do the same. But all I get is the CASTING icon on the Google Home Hub Max.
I got the same error when trying to use the Text to Speech service from google.

Any ideas… Sorry if this is a dumb question, new to Home Assistant.

Ignore the trigger.

alias: Put Kids to Bed
description: ''
trigger:
  - type: opened
    platform: device
    device_id: 4b2bd01816aa5c7220005d88b0153b0b
    entity_id: binary_sensor.front_door_contact_sensor_2
    domain: binary_sensor
condition: []
action:
  - service: media_player.play_media
    target:
      entity_id:
        - media_player.master_bedroom_display
    data:
      media_content_type: video/youtube
      media_content_id: https://youtu.be/6xDyPcJrl0c
mode: single

Ok the action needed some modifcation.

action:
  - data:
      media_content_type: cast
      media_content_id: ' { "app_name": "youtube", "media_id": "6xDyPcJrl0c" }'
    service: media_player.play_media
    target:
      entity_id: media_player.kids_room_display
1 Like