Getting started with the Home Assistant app for macOS
In this guide, we will install and configure the Home Assistant companion app for macOS.
Today, I’m going to show you how to integrate Google Assistant with Home Assistant. So you can control all your Home Assistant entities using your voice from any Google Assistant enabled-speaker. And I’m going to show you how to do it for free.
There are 2 ways that you can integrate Google Assistant with Home Assistant. The easiest way is to use the Home Assistant Cloud service. The Cloud service doesn’t only give you access to link Google Assistant but also Amazon Alexa. It also makes it easier to set up remote access for your Home Assistant instance. The cloud service is a subscription plan which costs $5 a month. It’s not a lot for all the benefits that you get. Also, to support the developers that made the Home Assistant project possible, I would recommend, if you can, to support them by subscribing to the Cloud service.
The other way to integrate Google Assistant, which is the method that we will set up today, is free, but it does require a lot more steps to configure. But like always, I’m going to make it simple for you guys, and I’m going to go over everything step-by-step.
Before setting up everything, you need to have remote access configured in Home Assistant. If you haven’t done that yet, check out my Beginner's Guide to Home Assistant, where I show how to set up remote access using DuckDNS.
To create a new project via the Actions on Google website, go to console.actions.google.com.
Click on New Project, set up a name for it, and click on Create project.
Then, select Smart Home and click on Start Building.
Now that the project is created, under Quick setup, click on Name your Smart Home action and set up a name for it. This would be the name that you would look for when we get to the process of linking the Home Assistant instance to Google Assistant.
Click on Save, and then click on Actions.
Under Fulfillment URL, enter your full DuckDNS URL, including port
443 at the end and also
Click on Save and then click on Account linking.
Under Client ID, you need to enter the following link,
[https://oauth-redirect.googleusercontent.com/r](https://oauth-redirect.googleusercontent.com/r/g-asst-integ-for-home-asst), including the project ID at the end. To locate your project ID, click on the Menu icon on the top right, and then click on Project settings. Depending on what you set up as the Project name, sometimes the Project ID could be different or have some extra characters at the end. So, you want to double-check this before you continue with the setup.
To go back to the Account linking, click on Develop, and then enter the following under Client ID, including the Project ID at the end:
For the Client secret, you can enter anything you would like. This is not a password that Home Assistant would need to link to Google Assistant.
For the Authorization URL, enter your DuckDNS URL and include at the end port
443 and also
And for the Token URL, enter the same link but replace
token at the end.
Click on Next and under Use your app for account linking, click on Next as well without changing anything.
Now, under Configure your client, enter email under Scopes and then add another scope and set it to name.
Make sure that the option Google to transmit clientID and secret via HTTP basic auth header is unchecked.
Click on Next and then Save.
The configuration here is now done, so click on Test to activate the new action.
Next, you need to go into the Google Cloud API website and create a service account. This would provide a file with some details that you would need to set up in Home Assistant. So you can sync any changes in the Home Assistant platform with the Google Assistant service.
All right, so the Service account is now created. To download the file that we would need, go into:
JSONfor the Key type.
Before setting the Google Assistant integration in Home Assistant, you need to enable the HomeGraph API in the Google Cloud Platform.
We’re done with the configuration on the Google side. Which pretty much was the hard part. Next, you need to configure the Google Assistant integration in Home Assistant. You could add all the settings inside the Configuration.yaml file. However, to make everything nice and neat, create a separate file, and add the Google Assistant configuration in there.
google_assistant: !include google_assistant_integ.yaml
project_id: service_account: private_key: client_email:
private_key, and the
client_emailand paste it into the Google Assistant integration file.
report_state:and set it to
true. Like that, Google Assistant is updated with any state changes in your Home Assistant entities.
exposed_domains:and add the domains from Home Assistant that you would like to expose to Google Assistant.
report_state: true exposed_domains: - switch - light - sensor - script
After the Google Assistant integration is configured, you need to Link Home Assistant in the Google Home app.
And that’s about it. Your Home Assistant entities are available now via Google Assistant, and you can easily control them with your voice.
If you have entities that you don’t want to control with Google Assistant, you can easily disable them, so they are not exposed. To do that, go back into the Google Assistant integration file.
expose:and set it to
Other options that you can add to the entity_config is aliases, which you can use to add different aliases that will refer to a specific entity, and also room, which is used to specify the room that the entity belongs to. And then again, when you are finished editing the file, save it, restart Home Assistant and run the command via Google Assistant to sync the devices.
There is one important thing that I want to mention. The Actions on Google project that we created to make this possible is in a testing environment. So after 30 days, the test expires. However, you can still control your devices via Google Assistant with no problem. The part that you’re going to run into an issue is if you make changes to your home assistant, and you try to sync your devices in Google Assistant. You would get an error message that it was unable to sync with your Home Assistant project. The good news is that you can quickly fix that by reenabling the test simulation. To do that, go back to the Actions on Google website
And that’s about it. When you run the command via Google Assistant to sync your devices, you won’t get an error message anymore, and any changes in your Home Assistant will sync with Google Assistant.
One-time DonationBuy Me a Coffee
SubscriptionBecome a Patreon