Firing off Home Assistant cast with an IFTTT webhook.

Being able to have google cast Home Assistant is pretty handy but kinda hard to do. For this I have Home Assistant Cloud and IFTTT integration setup. Create a Google Assistant trigger for what you want to say. You can grab your IFTTT webhooks URL from the bottom of the Home Assistant Cloud configuration page in Home Assistant. The body will need the entity name of your Home Hub and the view in Home Assistant.

{ "action": "call_service", "service": "cast.show_lovelace_view", "entity_id": "media_player.master_bedroom_display", "view_path": "hub" }

Now in Home Assistant create a new automation. Just create the event trigger shown below and leave the action blank. Open up the automations.yaml, the one you just made should be at the bottom of the file. Paste in the service template at the bottom of this post. make sure the spacing right, run a config check to make sure it checks out.

service_template: '{{ trigger.event.data.service }}'
data_template:
  entity_id: '{{ trigger.event.data.entity_id }}'
  view_path: '{{ trigger.event.data.view_path }}'