Unable to link Home Assistant to Google Assistant

I don’t know how could you know it but I’m really a big beer lover:D We just need some possibility for that beering as I’m in Hungary so Australia is really not so close for me:) But who know?! Maybe some years later, if COVID-19 leaves us some possibilities:(

Anyway thanks for you words!

1 Like

Hello Tamás,

thanks a lot for your reply. Your note helps lot to fix issues. now HA is running smoothly. we appreciate your contribution in HA community

Stay safe

Regards
Vinod

1 Like

Hello @Pyvarex,

i have spend 4 hours to try to relink my account in google assistant…then i go to the integration page of home assistant ( https://www.home-assistant.io/integrations/google_assistant/ ) and read :
“If you’ve added Home Assistant to your phone’s home screen, you have to first remove it from home screen, otherwise, this HTML5 app will show up instead of a browser. Using it would prevent Home Assistant redirecting back to the Google Home app”

that i never notice before…

My native language is not english, so i read 3 times and begin to understand…then i google this note text and i am here and read your advice…and remember i have a short-cut to HA on my phone…delete it and done!!! linking ok.

You save my evening! thanks

3 Likes

Lol… I have the same exact problem. After removing it from the home screen I’m able to link HA to Google Home App. Hope this help others facing the same issue.

1 Like

Today mine dont work anymore (it has been working the evening, then on the morning broken again) and this time i read another POST (https://community.home-assistant.io/t/request-for-https-homegraph-googleapis-com-v1-devices-reportstateandnotification-failed-403/148289/39 ) and the Homegraph API isnt active anymore…

I just activate again and it works!

Dont understand how it could desactivated by itself…???

I’ve just made an account to thank Tamas. First I needed to stop using the API key and change to the JSON file in my configurations.yaml, then I needed to do this step from Tamas https://oauth-redirect.googleusercontent.com/r/xyz/ with xyz being the Project ID. This part was missing from the walkthrough I followed. I know because I only followed it a week ago and it said to just have https://oauth-redirect.googleusercontent.com/ there.

When I did that, the first time it failed in the Home app, but the second time it worked.

Reading here I worked out how to expose only my switches too, so thanks for that guys. Now I don’t have double light instances in Home for each bulb.

1 Like

Is anyone using this with a master slave setup?

I think my authentication is working for Google Assistant, but in the HA Developer logs i am seeing that it can not find lights or switches, and i know that are on a slave device.

Thanks for all help
Mo

I think you’re onto something and I might be running into something similar. The setup went fine (I can see all my devices in the Google Home app and asking to sync devices works) but I can’t control all devices from the Google Home app.

After some testing, it appears that I can control my Hue and Lutron devices (which now have 2 entries in Google Home, since they were directly integrated to Google Home and now have secondary entries from the Home Assistant import) but I cannot connect my zwave devices that are connected through zwave2mqtt (the zwave controller is on another box in the house). They show as “not responding” and in the app it says “oops, can’t connect to the light”.

Edit: This is now working after rebooting the main and zwave instances of Home Assistant and the zwave2mqtt service.

interesting i shall look into that this evening, i’d really like this to work. Can i ask ar you using mqtt as the interface for satalite/remote nodes or are you using this https://github.com/lukas-hetzenecker/home-assistant-remote.

Thanks for your response

I’m using mqtt. Primary instance of Home Assistant running in a VM, Secondary instance running on. RPi with a zwave stick on it. Secondary running zwave2mqtt and primary listening with Mosquito. Sorry if I used some incorrect terminology originally.

No its not that your terminology was wrong i am just aware that there are two ways to do it and did not want to ask silly questions if you where not using the same method.

I have rebooted every thing and it still has not worked i am going to draw out what i have later and post it and see where we get to.

Well reboot of everything did not work for me i think it is cause i am using the script but that is because i could not get mqtt to work properly and i want to minimise the foot print for security attacks

Thanks for your reply at least

Hi all,

Sharing my experience here.
I was struggling with this configuration for about 2 days.
Had exactly the same issue: everything is properly configured, but on the last step, Google Home says: “linked”, but no devices are added.

I have a quiet big instance with around 200 devices. I assume, that this was causing a problem. Initially, my config used to look like this:

project_id: #project id
service_account: #service account json
report_state: true
exposed_domains:
- switch
- light
- group

Please note, that no other settings are currently set.
I decided to reduce the scope to minimum by changing my config to this:

project_id: #project id
service_account: #service account json
report_state: true
expose_by_default: false
entity_config:
  switch.living_room_table_lights_wall_switch:
    expose: true
    name: Table Lights
    room: Living Room

Once i did it and re-started my server, i finally managed to add the app and got only 1 device on the home screen.

Then, i changed my config to include more devices in “entity_config” section. Re-started home assistant, and asked google assistant to sync my devices. Result: i managed to get more devices.

After that, i changed “expose_by_default” to true, re-started and synced devices again.
And now, i have 130 devices on my google assistant screen.

Interesting thing is - looks like google home does not support temperature / humidity / motion sensors.
Anyway, my recommendation, to break through that stupid problem, first try to use only one device, and once you linked, add more.

1 Like

We use the Google test options for this… The app we run is a Draft in the Google Actions console. As so Google will disable this app when there are no app changes for i guess three months. Basic communication will still work. Setup, and device sync won’t work untill you enable the draft in the Actions console again.

Changes in your sync won’t count as app changes for Google. Just remember to enable it if u didn’t use it for a while.

using duckDNS with nginx, port 443. followed all instructions across many many guides but really hit a brick wall now! i see my project in the home app and it directs me to my hassio (if wifi is off). I can log in and it says linking… then it jumps back to the add devices menu and my app is not linked. :frowning:

I have saved MYSERVICEACCOUNT.json to the config.yaml directory and i have included a google_assistant.yaml in my config with:

project_id: MYPROJECTID
service_account: !include MYSERVICEACCOUNT.json
expose_by_default: false
entity_config:
  switch.MYSWITCH:
    expose: true
    name: MYSWITCH

Account Linking:
clientID: https://oauth-redirect.googleusercontent.com/r/MYPROJECTID/
authorisation URL: https://MYDOMAIN.duckdns.org:443/auth/authorize
token URL: https://MYDOMAIN.duckdns.org:443/auth/token

service account for MYPROJECT: [email protected] (Service Account Token Creator, owner)

homegraph API (enabled) metrics:
Method:
google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification
google.home.graph.v1.HomeGraphApiService.RequestSyncDevices
Requests Errors Avg latency 99th percentile latency
8 100% 0.019 seconds 0.033 seconds
3 33.33% 1.448 seconds 4.131 seconds

… and just as I was about to press send, I suddenly find after days of trying, it has linked!!! the last think I tried was to change from having domain switches exposed to just a single specific switch (I had previously tried exposing only lights domain but now that its up and running, turns out the lights dont link!!!). I also recently deleted everything in my nginx config page. maybe it was just time?

whatever it was, I hope the above helps

Thanks all for the good tips. To hopefully help someone else as new and clueless as me: I was hitting my head against the wall. I was able to see my test app but the request to access my service kept timing out. I found the answer was to change my port from 8123 to 443 in all areas of the instructions (using https and duckdns).

I do not know how to edit the instructions for the integration but it could use tidying up. The rest of Home Assistant is so well documented! The instructions seemed out of order and were not that simple to follow. And for newbies like me, it was hard to know both the location to physically place the JSON file and the syntax to include it. There is also an inconsistency error as pointed out above in the photos in the guide regarding the Client ID.

1 Like

Hi all,
I tried all the steps you mentioned, I set up everything for a few times with different options but it’s still not working for me… I’m using duckdns, the ssl with nginx is working fine, I can put my username and password for a successful login but then I’m redirected to the device linking page in the google home app.
For the config I also tried to put an extra file the google config, I included the account-json which is in the same directory, but I also tried to put the key and client-email directly in the google config, but it’s still not working…
Here’s the line in my configuration.yaml:
That’s my Google-Assistant.yaml file right now:

# Google Assistant
project_id: {my-project-id}
service_account: !include "{name-of-the-service-account-file}.json"

I deleted everything else to just get the account linking working…

I’m using NGINX for the ssl and since the documentation of the google home integration mentions that there shouldn’t be a trailing “/” at the end of the proxy_pass, I also checked that and yes, there is no trailing “/”, so it should be fine I guess…

I don’t even see any error in my Google API metrics, there are no requests at all… any idea?

1 Like

Here’s my working config, it’s also behind reverseproxy but i’m using caddy but that shouldnt matter. Can you enable debug logging for the google-assistant integration? The trick for me was to disable both report_state and expose_by_default as well as linking HA through the google assistant app and not through the google home app. Also check the permissions fo the service_account and the api-scopes. Also check for logon tokens, and clean them in HA

Here’s log settings, google_assistant.http should be enough:

GA Config:

GA Entities:

Caddyfile:

1 Like

I was struggling with getting the integration to work as well. Similar experience to most people on this thread: After selecting the Home Assistant test integration in Google Assistant it would show me a “Home Assistant linked” message, navigate me around some screens and drop me back into the home screen of Google Home, without any devices actually added. When I go back to the Integrations screen in Google Home, Home Assistant would be listed among the non active integrations.

After some more testing I was able to get it to work. I was using a configuration with exposed_by_default set to false and no exposed_domains. I was exposing a single entity through entity_config. However, even though the documentation states otherwise, without expose: true the entity would not get listed. And apparently if there are no exposed devices Google Assistant silently fails the integration (as in saying the integration was successfully linked, when in reality it wasn’t).

Adding expose: true to the single entity makes Google Assistant correctly show me the device as an available device when I link it to Home Assistant and the integration now successfully links when I select that device to be added to Google Assistant.

I’ve had same trouble. I get to enter the userID and password in Google Home Add new linked service. It does its thing then comes back with “couldn’t update the setting check your connection home assistant”. Made my way through all previous responses above and finally several of the suggestions in combination have worked - at least I’ve gotten to the point where the service now sticks as a Linked Service in Google Home. I’ve only got one domain exposed “light”. I tried “hey google lounge light on” and it worked!!!

FYI - I thought it might have been a firewall issue and disabled the firewall but still got the same problem. So … here’s my setup that works to date:

Router firewall - on.
Router forwarding LAN port 8123 and Public port 443 Protocol TCP
HA version 234 installed on Raspberry Pi 4, wired connection rather than wireless.
See images below for configuration.yaml and google configuration. Its the combination of the specific configuration I’ve mentioned below that made it work in the end:

expose_by_default: true [when it was false it didn’t work].
fullfilment URL doesn’t have a “/” on the end.
fullfilment URL doesn’t include the port number [:8123 in my case].
Account linking Client ID is as shown and not the one that ends with your project ID.
Account linking Client ID ends with a “/”.
Account linking Authorization URL doesn’t include the port number.
Account linking Token URL doesn’t include the port number.

As soon as I put the port number in any of the above, it wouldn’t work. In fact I wouldn’t even get the login screen in Home Assistant when trying to add the linked service.

CONFIGURATION.YAML

# Link to Google Assistant
google_assistant:
  project_id: abc-xyz-123456
  service_account: !include Accname-randomnumber.json
  report_state: true
  expose_by_default: true
  exposed_domains:
    - light

GOOGLE CONSOLE ACTIONS VALUES
Fulfillment URL
image

Account Linking
AccountLinking

I’ve just added additional exposed domains so the configuration.yaml is:

  exposed_domains:
    - switch
    - light
    - scene
    - script
    - media_player
    - climate
    - sensor

I then said “Hey Google, resync my devices” and it did. Devices tried so far. I only mention this as earlier posts suggested starting out with only one exposed domain.

Also, I’ve found a wired Raspberry Pi works better with Google Home than a wireless. For some reason when I had the Pi connected wirelessly Google Home if it wasn’t being used for hours lost the connection to HA on the Pi.