Play media to Chromecast device

I have a Gen 1 Chromecast connected to a TV at the moment and I have a touchscreen close to it for Home Assistant

My son watches the same show on Netflix every single day but has to wake us up to get it started

I would really like to add a button to Home Assistant to play a show in the same way it can be done through Google Home

I was hoping this might work but no luck, any help would be appreciated. I have asked on the Discord channel several times with no luck

This is my current Service Data

{
“entity_id”: “media_player.chromecast”,
“media_content_id”: “https://www.netflix.com/browse?jbv=81026478&jbp=1&jbr=3”,
“media_content_type”: “video/netflix”
}

1 Like

Can you call the media_player.play_media service with that data and successfully play that content?

If so you could write an automation using an input boolean as the trigger and the call that service with that service data in the action.

- alias: Play Netflix Show
  trigger:
    - platform: state
      entity_id: input_boolean.what_ever
      to: 'on'
  action:
    - service: media_player.play_media
      data_template:
        entity_id: media_player.chromecast
        media_content_id: "https://www.netflix.com/browse?jbv=81026478&jbp=1&jbr=3 2"
        media_content_type: video/netflix
    - service: homeassistant.turn_off
      entity_id: input_boolean.what_ever

Then when you turn on the switch (input boolean) in HA it will play the content and turn the switch back off ready to play it again the next time it’s turned on.

my current problem is that this action doesn’t work. It doesn’t show the netflix splash screen or start playing

Where did you find that service data to use?

I attempted to model it from the youtube one, I can’t find any examples of anyone trying to do the same thing

Ok, I have no idea then.

But once you do figure out what service data to use then you can use my outline above to create your switch. :slightly_smiling_face:

Did you find a way to accomplish this? Everyone wants to know!

Also interested in this …

Following…I’m also interested.

I’ve accomplished this by remote controlling a spare Android phone. It seems to be the only way currently (Since remote controlling Chrome does not allow casting), but it works quite well actually for a work-in-progress. So, we could have this in Home Assistant soon!

I’ve got pull requests pending for pychromecast and HAss which provide basic support for app casting functionality:
https://github.com/home-assistant-libs/pychromecast/pull/359
https://github.com/home-assistant/core/pull/35114

Additionally, Netflix support is provided in my custom component cast_extensions:

Also interested :wink:

I got stuck in step 2 ‘Install androidviewclient’ I have no idea what this is talking about, I have HA on PI

1 Like