Trigger Home Assistant automation from Google Home

Trigger Home Assistant automation from Google Home

Home Assistant allows you to create some complex automations.

Automations that in the end make your life a lot easier in some situations.

But what if you want to trigger that specific automation with a voice prompt

What you need to have set in place first:

  • Google Home integration in Home Assistant or Home Assistant Subscription
  • The automation that you want to have triggered by the voice
  • A button helper to trigger the automation

Setting up the automation for Google Home

Create a button helper

First thing, after creating the Automation in Home Assistant, is to create a Button helper. This helper will allow us to trigger the automation vit a virtual button.

Go to Integrations>Helpers>Create Helper

Trigger Home Assistant automation from Google Home 31

You need to create a Button Helper or a Toggle Helper. Give it a name and select an icon for it then click on Create.

Set button helper to trigger the automation in Home Assistant

Now go to your automation of choice and for the Trigger configure an Entity and then click on State. Basically this allows the automation to be trigged when the entity changes the state (in our case when the Test button changes state, the automations commences)

Trigger Home Assistant automation from Google Home 32

That should be it in Home Assistant.

Check if the button helper shows in Google Home

Next thing is to open Google Home app and check for the Test button helper you’ve just created and see if you can spot it in the Devices>Linked to You.

Trigger Home Assistant automation from Google Home 33

If you cannot see it there then you need to do an extra step. For those who can see the button skip to the next step.

Show Button Helper in Google Home

If you cannot see the button in Google Home then you need to open up again Home Assistant, go to Developer Tools>States and search for you button name. In my case its: Test now i need to copy the entity name.

Trigger Home Assistant automation from Google Home 34

Next navigate to your configuration.yaml and open the file.

This file can be accessed in various ways. The easiest by far is to install the File editor extension.

Now paste the following line inside the file. Note that you must respect the spacing!

    YOUR_ENTITYNAME.HERE:
     expose: true
Trigger Home Assistant automation from Google Home 35

Now tell the following command to Google Home: Ok Google, Update my devices.

In a few minutes the new button will appear in Google Home.

Setup the automation in Google Home

Navigate to Automations and add a new automation.

You can set the automation to be Global (for your household) or just for you.

The for the Starters (trigger) you will select the trigger that you want, in your case a voice prompt.

And the action will be Adjust Home Devices and select the button helper.

All done! Now when you can Trigger Home Assistant automation from Google Home

Dan Mutu este fondatorul și editorul șef la GeekChronicles.ro. Contribuitor activ la secțiunile revistei Geek Chronicles și la secțiunea de Forum. Cunoștințele predominante sunt în domeniile: tehnologiei, marketing și suport tehnic.
Geek Chronicles

Pasionat de tehnologie?

Te invităm în grupul nostru de Facebook unde purtăm discuții constructive despre tehnologie și nu numai.

Articole direct pe mail săptămânal

Îți trimitem săptămânal un email cu toate articolele/materialele noi publicate fără spam

Prin abonare confirmați că ați citit termenii și condițiile și aveți peste 16 ani