Google Assistant (0.56) on HassIO?

Hi,

I am really excited about the new Google Assistant component that was added in 0.56.

However, has anyone set this up on HassIO? I guess installing gactions is the tricky part?

Gactions is not required to run on the hass server. It is only required during setup and can be run from anywhere.
I run mine on a windows laptop. My hass is not hass.io but I run it in a docker on unRaid with no problems. Enjoy!

I have been trying to configure this on hass.io for the past 4 hrs and no luck yet, setup info is really confusing and it lacks information. but as far as I could understand these are the steps needed for Hass.IO
. (I have a Google Home Assistant. not the implemented Rpi one. maybe this is the problem. I dont know!)

  1. Download gactions-cli to your PC.
  2. Create a file to where you downloaded the Gactions-cli and name it project.json
  3. Open the Project.json with Notepad++ (or any other editor) and change [YOUR HOME ASSISTANT URL] with your Home assistant link (ex: https://my.ddns.net). It has to be HTTPS or it won’t work, so you need letsencrypt installed.
  4. Go to Google Action . and:
    a. Add/Import project
    b. Go to Build under the Actions SDK box
    c. Copy the command that looks like: gactions update --action_package PACKAGE_NAME --project doctest-2d0b8
  5. When you run the code - Replace PACKAGE_NAME with project.json.
  6. This is one of the confusing part. you either:
    a. Run the Gaactions.exe you downloaded.
    b. Open your CMD.
    1. type cd downloads (or the path you placed the .exe and .json)
    2. type the code you got from from the Action SDK. (ex: gactions update --action_package PACKAGE_NAME --project doctest-2d0b8)
      — in my case, it gave me a link to follow (copied from cmd and pasted to browser), that gave me an authorization code. After I pasted the code back on cmd, it gave me another link to follow. which was the one from the setup. (_**ex: https://console.actions.google.com/project/doctest-2d0b8/overview**_)
  7. This is another confusing thing. On App Information, the APP name needs to be specific but I dont know if this has anything to do with the projectID or ClientID. So Fill this out the best you can including the images, (I got some random pics from google.)
  8. On Account Linking:
    a. Grant type: Implicit
    b. Client ID: Should be the same as client_id from your hass config above (the one you get from ActionSDK)
    c. Authorization URL (replace with your actual URL): https://[YOUR HOME ASSISTANT URL]/api/google_assistant/auth
    d. Configure your client. Add scopes for email and name
    e. put anything for testing, it dont matter.
  9. Another confusing thing, “Back on the main app draft page. Click Test Draft. That will take you to the simulator (which won’t work) so just close that window.” — Do we have to do this? if not… why even add to the setup, it just confusing.

Ok this is all the setup for the Google Action. Now we have to setup the GoogleHome APP

  1. On your phone, Open the Google Assistant app and go into Settings > Home Control
  2. Click the + sign, and near the bottom. If you did the first part right, you should see in your list something like “[test] your app name”. And everything should work from here, but It doesnt.

I had many different errors at this point. “invalid clientID”, “ProjectID mismatch”, “timeouts”, “cant reach site” and some others.
On your configuration.yalm you have to add the following.

google_assistant:
project_id: someproject-2d0b8
client_id: [long URL safe random string] - “Why this, Where to get it ?, can it be anything or it must be specific ?”
access_token: [a different long URL safe random string] “Why this, Where to get it ?, can it be anything or it must be specific ?”
exposed_domains:
- switch
- light
- group

I have tried a few thing even went to This site and created the Long string, but it still not working and getting error.

If anyone know where I went wrong. shine a light on Us so we can get this working.

Are you putting your client_id and access_token strings in the square brackets? I don’t have access to my config files atm, but I’m almost certain I didn’t put mine in any brackets or quotes and it works.

both of these are just long strings. They essentially used to authenticate you. (Not sure how exactly it works)
I just used some randoms strings that I typed on the keyboard. Just randomly banged on letters and numbers.
Then I paste them in there, no quotes or
And it works.

I have it setup on my Hass.io but after less than a day, it’s already stopped working. Hass.io is functioning fine but now when I try to command Google Home to turn on or off my lights, I get “I’m sorry, there was an error and I’m unable to control your home devices.” These are the only errors in my logs that might be related:

2017-10-23 07:57:42 ERROR (MainThread) [homeassistant.core] Error doing job: Fatal error on transport TCPTransport (error status in uv_stream_t.read callback)
TimeoutError: [Errno 110] Operation timed out
2017-10-23 09:35:29 ERROR (Thread-15) [pychromecast.socket_client] Error reading from socket.
2017-10-23 09:35:29 WARNING (Thread-15) [pychromecast.socket_client] Error communicating with socket, resetting connection
2017-10-23 09:35:29 ERROR (Thread-15) [pychromecast.socket_client] Failed to connect, retrying in 5.0s

Edit: Looks like it’s my firewall blocking Google Assistant. Anyone know what IP address Google Assistant uses to communicates with HA?

Edit 2: Well, it looks like there’s several IPs that Google Assistant is making a request to my HA from so there’s no way I’ll be able to know which IPs to allow through my firewall. I don’t feel like turning off my firewall based on all of other malicious access attempts I’ve seen over the past few days with DuckDNS/LetsEncrypt enabled. I think I’m going to just move back to IFTTT for my Google Assistant integration. I really wish all of this integration just ran locally…

I agree re: running locally.
I’m somewhat bemused as to how this is even useful? I have LimitlessLED which work perfectly in HA and I can control using IFTTT using my google home. (via duckdns and letsencrypt). What is the benefit in having Google Assistant in Hass.IO? I just don’t understand at all. There seems to be no reason but I’m willing to be convinced.

Maybe when there is a good guide there will be an explanation of why you would want to do this.

A couple benefits of “native” integration with HomeAssistant, Google Assistant will know the state of your devices and you can group them into rooms within the Google Assistant app. The response time seems to be about the same as IFTTT - maybe ever so slightly faster. I’d prefer this “native” integration but I can’t figure out any easy way to make this work with my firewall (Cujo) because the Google Assistant requests come from several different random IPs.

Thanks for the quick help and pointing out the obvious that I had misssed :wink:

When running the command:

gactions update --action_package PACKAGE_NAME --project doctest-2d0b8

Edit: I did modify the above command as per the documentation!

on windows (win 10), I get

ERROR: Failed to update the app for the Assistant
ERROR: The caller does not have permission
2017/10/24 13:30:38 Server did not return HTTP 200

I tried running the prompt as admin but the same error is returned. I am running Hassio with an https URL which I used in the json file.

Any ideas?

Ive done this in many different ways and always get a different error, right now the error I have is “invalid ClientID”

Yet another noob mistake on my end - the error above was due to incorrect google account being used when authenticating (doh!)

Now everything is working flawlessly and I LOVE IT!

Update:

Setting productID and ClientID the same made it work for me. so on your configuration.yalm :

google_assistant:
project_id: project-8whateveryoursis
client_id: project-8whateveryoursis
access_token: 80charrandomstring “with no brackets”
exposed_domains:
- switch
- light
- group

restart your home assistant and rerun the code on cmd to update your setting.
go to your phone app and it everything should work.

I am trying to set this up as well and it seems my settings are correct as I have an app available, that I created, in Google Home under the Home Automation section. Once I add the app it seems to go through the login process but right at the end I get an error flag on the bottom of app in black stating: “Couldn’t update the setting. Check your connection.”


I managed to resolve it, I tried both to remove the “exposed_domains:” section in the config file and also I tried to add my created app in the Google Home app with my tablet that only had one account linked to it (perhaps this is why it would not add the app since another account didnt have access to the app). For anyone else experiencing this issue, the following thread helped me: Google Assistant Setup Issue - "Could not update the setting. Please check your connection"

Hi,
I have followed setup and am getting the Invalid Client ID when trying to add through the Google home app my config is this

google_assistant:
project_id: the name that is the project_id on the Google actions site
client_id: fhfdsa;hkhdfsa # this is a random string and is the same is in the Project setup onthe Google Action site
access_token: # thi sis the same as the client ID
api_key: key I generated from Google Console
exposed_domains:
- switch
- group

Not sure what I am missing

thanks

did you use the code provided in the instructions to create the random string? It wont work with something you create yourself (as I found out)

i tried that command but it through an error. Is there anywhere else you can generate the id from

i dont have a system running straight linux so I used a website that does the code translating. it worked perfectly. paste the command in here

Thanks that worked a treat I also needed to have the ClinetID different than the access token.
All good now

thanks

this might help someone else…

https://stackoverflow.com/questions/45305501/gactions-not-working-caller-does-not-have-permission