Setting up Google Actions for Assistant

Given the imminent release of Google Actions (see PR) in Home Assistant, let us use this space to discuss configuration issues instead of polluting the PR.

Google Actions will allow you to interact with Home Assistant using Google Assistant. This means you can use Google Home (or any other Assistant device), which is currently not working with emulated_hue with Home Assistant.

12 Likes

Great idea on the thread. Sorry the setup is kind of a pain and thanks to all you early adopters testing so we can get things ironed out before it gets officially released.

3 Likes

Given that GH is not working at all right now, this is a HUGE improvement. It will be great if we can add screenshots to the guide. I will try to work on this tonight, if I get some time.

2 Likes

I donā€™t get what you can achieve with this ā€¦

I think I followed all the steps that were mentioned in this document but I get HTTP 500 error when I try access this app via ā€˜Home Controlā€™.

Is following client_id same as the one mentioned in Step 6?

google_assistant:
  project_id: someproject-2d0b8
  client_id: [a long random string]
  access_token: [base64 encoded string]


The final item on that page Account linking is required for your app to interact with Home Assistant.
Grant type: Implicit
Client ID: Make up a random-ish or hard to guess string

As @arsaboo implied, itā€™s the holy grail of using HA directly with GA without the need to buy a real Google Home or if you have already got one it gets around the mess Google created when they broke emulated_hue support.

Given the GA add-on for hass.io youā€™d only be a cheap mic and speaker away from proper voice control.

Yes, those are supposed to match. Iā€™ve updated it in my documentation PR.

continuing from githubā€¦

ok no errors in hass now
but now ithe Home app attempts to link the device and returns
Couldnā€™t update setting. Check your connection.
i saw earlier you had a similar issue?

Make sure the client_id and access_token does not contain special chars (Only use alphanumeric characters), try making the client_id less than 20 chars long, and the access_token less than 80. Also make sure that the url in your projects.yaml is correct and that you are using a HTTPS connection that is not using a selfsigned cert (Use a Letā€™s Encrypt cert, itā€™s free).

Also Iā€™m not sure how many devices are supported by the Google Home, try only exposing lights?

all alphanumeric
client id = 18 chars token 54
but i am using a self signed certificate that I just put on there for this component.

I still cannot get past the error in the Home App
ā€œCouldnā€™t update setting. Check your connection.ā€
is it essential that we cannot use a self signed certificate?
something of a nightmare for those of us who do not require remote access if we have to set up a letsencrypt. duckdns for one component.

The valid SSL certificate requirement is because the requests come from Googleā€™s servers and they check the cert. Unfortunately I donā€™t have any control over that.

i understand
but is using a self signed certificate on a local home assistant installation causing the problem
(as opposed to setting up through a CA)?

certificate created per instructions here

Iā€™m 99% sure Google wonā€™t allow selfsigned, you can get around it locally by adding the CA in your cert store, but you canā€™t add that same cert on Googleā€™s servers. Iā€™m not sure which platform you are running HASS on, but if you have access to a docker host, you could use something like this: https://github.com/linuxserver/docker-letsencrypt

That would probably be the easiest way to set it up, as cert creation and such is totally automated.

Also if you set it up for remote access, you may find use cases for having remote access (We use it at home to signal trying to get hold of the person at home, if the person does not pick up the phone, as we often put them down somewhere when at home).

Iā€™m just happy that Google actually trust the Letā€™s Encrypt cert, as we would otherwise have to pay for a cert.

sounds good
I am running hass in a virtualenv on raspbian
I just wanted to make sure I wasnā€™t going off on a quest to break an otherwise functioning Home Assistant install for no reason,
thanx for the help

Thank you @PhilK

What about acces_token? I have the access_token in config yaml file along with client_id.

access_token: [a different long url safe random string]

I generated this token using www.base64encode.org but I didnā€™t find any reference if this token needed to be linked anywhere during the project setup process at Google.

@sbmlat nope, the access_token gets passed back to Google during the auth step and used in requests.

Think of it like:
Google: ā€œHello, Iā€™m client_id abc123ā€
Hass: ā€œHi client_id abc123, your access_token is ReallySecretPasswordā€
Google: ā€œCoolā€
Google: ā€œHi, Iā€™m abc123 and my token is ReallySecretPassword. What devices do you have?ā€
Hass: ā€œHere you go!ā€

@kylerw in reply to your PR comments

I donā€™t have a fan to test with so that one might be a bit of a challenge. Iā€™ll need to look at how the fan entity works and think through it a bit.

SYNC is how it gets new devices but before today there wasnā€™t actually a way to trigger that outside of going into the app and manually triggering it. Today along with all the new traits and types they added Request Syncā€¦Iā€™m just not sure where that should live yet. Possibly a service that can be called at will and maybe triggered on startup? Optional parameter to do it on a timer? Havenā€™t thought through it too much yet.

Also interesting about your problem with rooms (which I agree is a super pain) is the roomHint field. You could add an attribute to your entities like google_assistant_room: bedroom and have it automatically go to the right place, but from reading the dev info it doesnā€™t actually do anything with those fields yet.

1 Like

Having a Google Home since a couple of weeks, I was really disappointed by the capabilities (or lack of), especially here in France. This is just amazing. Iā€™ve got a question, though: when testing a ā€œnormalā€ (not a Smart Home one) project, the testing ran by either the web UI or the gactions executable is time-limited. Is this different with Smart Home applications?

Iā€™m on hassio and getting the 500 error and from what Iā€™ve read, it is caused by not updating the init.py in the http folder. Is there any way to alter this file in hassio? I tried copying the contents of components/http (via git) and putting it in custom_components/http,but it didnā€™t seem to work.

Havenā€™t had a chance to test this yet, but let me say THANK YOU to everyone who has put in time and work on this so far!!! The home assistant community is the best!

2 Likes