Today, I’m going to show you how to integrate Google Assistant with Home Assistant Cloud.
So you can control your entities from any Google Assistant device without exposing your
Home Assistant to the Internet.
I’m also going to show you how to configure what entities can be controlled via Google
Assistant, and how to customize the response when a command is giving.
Open Home Assistant and on the sidebar, click on Configuration and then Home Assistant Cloud.
If this is the first time using the Cloud service, you can sign up and get a 30 days
free trial.
After that, it’s $5 month which is not a lot for all the features that you get.
Plus the security that you don’t have to expose your Home Assistant to the Internet.
After you’re signed in, enable the Google Assistant integration.
Then you need to enable the Hass.io skill for Google Assistant so open the Google Home
app on a mobile device.
Tap on Add, Set up device, and then tap Have something already set up?.
Search and select hass.io.
Then, sign in to Home Assistant Cloud, and tap on Allow Access.
After Hass.io is linked, another page comes up with some of the entities that you have
in Home Assistant.
To see a list of all your entities and assigned them to specific rooms, go back to the main
Google Home Window.
Go to Account, Settings, Assistant, and then Home control.
All right, so Google Assistant is now integrated with Home Assistant and you can start controlling
your entities from any Google Assistant device.
To trigger entities that have an on and off switch, for example, a light, you can simply
say “Hey Google, turn on living room light”, And the Google Assistant would turn the light
on and then provide an appropriate response.
However, entities like automations or scripts, for example, a script to lock your computer,
you wouldn’t be able to just say, “Hey Google, lock computer” You would actually
have to say “Hey Google, activate” and then the name for the script.
The response back would be something like, “Ok, activating PC lock”
There are a couple of ways that you can customize this and make it simple to execute a script
or automation.
For example, you can use Routines in Google Assistant to customize the way you ask to
execute an action.
But, you wouldn’t be able to change the Assistant’s response.
However, you can use IFTTT to customize both the way you ask for something and also the
way Google Assistant response back.
Let me show you an example of how to set up both methods using a script to lock my computer.
If you want to use routines, on the Google Home app, tap on the Routines icon, Manage
routines, and then, the “+” Plus icon to create a new one.
Enter the phrase or phrases that you would like to say to trigger the command.
Then, tap on Add action and enter the actual phrase that would trigger the script or the
automation entity.
On this example, it would be Activate PC Lock.
Save the changes and then, any time you say the phrase on the routine, it would execute
the action that was set up.
If you want to use IFTTT to be able to customize the way Google Assistant response back you
would need to first set up the following in the automations.yaml file.
Then, on the Home Assistant Cloud page, enable the IFTTT webhook.
After that, go to the IFTTT page and click on New Applet.
Then, click on This, search and select Google Assistant, and select Say a simple phrase.
Now, enter the phrase or phrases that would trigger the script or the automation entity.
Then on the bottom, enter the phrase that you would like the Google Assistant to say
in response.
Click on Create Trigger, Then click on That, search and select Webhooks, and select Make
a web request.
Now, copy the IFTTT webhook from the Home Assistant Cloud page and paste it in the URL
field on the IFTTT page.
Change the Method to Post, the Content Type to Application/json, and then under Body,
enter the following to trigger the specific Home Assistant entity.
After that, click on Create action and then Finish.
Now, let’s go ahead and put it to the test, “Hey Google, lock computer”
All right so it ran the command that I wanted and it gave me a better response.
The last thing that we’re going to look at is how to configure in Home Assistant the
entities that can be controlled from Google Assistant, and which ones to exclude.
Also, how to change the name of the entities, add aliases and assign them to specific rooms.
All right, in your Home Assistant config folder, create a new file and name it cloud.yaml.
Then, in the configuration.yaml file, add the following to the cloud component.
After that, open the cloud.yaml file and add the following:
Under filter, there are a few variables that you can use.
So, depending on your setup, and the number of entities that you would like to expose
to Google Assistant, you can either use include_entities which would only expose the list of entities
that you specify, or exclude_entities, which exclude the entities in that list.
Alternatively, you can either use include_domains or exclude_domains which can either include
or exclude all entities inside of a specific domain.
Now, to configure how entities are exposed to Google Assistant, you can use the variable
entity_config.
With this, you can change the entity’s name, add aliases and also specify the location
of the entity within the home.
I personally suggest setting this option for the entities exposed to Google Assistant.
So like that if you unlink and then relink the Hass.io skill to Google Assistant, it
would automatically set all the entities to specific rooms.
Otherwise, you would have to manually assign them via the Google Home app.
After you finish making changes to the cloud.yaml file, restart Home Assistant and then sync
the updates to Google Assistant by simply asking, “Hey Google, sync my devices”
All right guys, that's all I have for you today.
Remember to check the written guide on my website for any changes.
You can find a link in the description.
Also, stay tuned for next video where I will show you how to integrate Amazon Alexa with
Home Assistant Cloud.
Like always guys, thank you for watching.
If you like this video, give it a thumbs up.
Don’t forget to subscribe if you haven’t done so already, and, I would see you in the
next video.