Unable to link Home Assistant to Google Assistant

Hi,

New to Home Assistant and am trying to get Google Assistant hooked up.

I followed the steps at:

I set my home assistant to be accessed externally w/ a self signed cert and set up several devices.
Created a new “Action” project on Google Assistant, with the “Fulfillment” URL and both API and service keys in my configuration.yaml.

When I try to link the account to Google Assistant, I can get to my HA server’s login screen, but when I click okay the account remained unlinked with no error messages from Google Home and nothing I can see from logs. I tried messing around with logging in with the normal auth and the legacy api password. Didn’t make a difference. I tried having the api_key and/or service_account. Made sure the project_id was correct. Tried with an entity_config and without. Any ideas on how I can figure out what is wrong?

homeassistant:
    unit_system: metric
    auth_providers:
    - type: homeassistant
    - type: legacy_api_password
      api_password: "password"

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
http:
  base_url: URL
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

# For Monoprice Media Player
media_player:
  - platform: monoprice
    port: /dev/ttyUSB0
    zones:
      11:
        name: Bedroom
      12:
        name: Ensuite
      13:
        name: Living Room
      14:
        name: Kitchen
      15:
        name: Basement

    sources:
      1:
        name: Bluetooth
      5:
        name: Chromecast
        
# For Google Assistant
google_assistant:
  project_id: "project id"
  api_key: "key"
  report_state: true
  service_account: !include /config/key.json
  expose_by_default: true
  exposed_domains:
    - switch
    - group
    - light

1 Like

Do you have a android shortcut with a saved password (html app)? Delete this before account linking.

1 Like

I checked my phone and didn’t find any shortcuts. Launched Google Home directly from the app drawer. I don’t think I have any saved passwords.

When I try to link, it is correctly authenticating me i.e. takes the correct user name and password and rejects bad ones, but you just get the spinning processing icon and then the [test] project still shows up in the “add new” list

I mean a shortcut to home assistant:

“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.”

It whas just a guess

1 Like

Yea I didn’t have any shortcuts on my home screen either. Not sure what’s failing.

I am having the exact same issue. Google Home shows that it links and accepts my password but returns back to the page showing [test] XXXXX but its still listed under the “add new” not the “linked services”. I even created a new google action project and it does the same thing. I have been using this for over a year and it was working great minus the once a month trip to the google actions website to re establish the test so it could resync. Not sure what has changed since the last time i did it in December but it worked fine then. I am running the newest version of home assistant 103.5

1 Like

I ran through and re-did every step twice now. When was the last time this worked for you @pendlet? I downgraded to home assistant 102.1/HassOS 3.6 and retried but that didn’t help. Nothing in the logs shows why any errors I can see that seem Google Assistant related.

@chanrwm I last did a link unlink in google home about two months ago but i have done the test refresh in google actions the first week of December with no issues. I think my 30 day mark is right around the 5 or 6th of each month. This time when i tried to re start the test in google actions, Google home mini responded with “Unable to re-sync devices for google control home assistant” so i decided i would just unlink and link as i have done many times in the past but that brought me to the point i am at now. No voice control over anything in Home Assistant.

I usually upgrade home assistant as soon as i see a new version. I don’t mind being a test dummy and 90% of the time i am fine and don’t have issues. The few times i do have issues i work through them with the help of the internet i am usually back up and running in a few days. This one has me stumped. Since this did not show up when i last upgraded about two weeks ago i am not able to pin it down to a home assistant Hassio issue. I find lots of post and fixes on redit and her for this linking issue from about a year ago but nothing seems to fix it. I tried pretty much everything out there that i could find and even a few things on my own.

Some observations that i have seen with my testing is that home Assistant and google are talking. Entering a wrong password definitely fails but using a correct one it just doesn’t link with google home. I can see that my api key is being accessed via the https://console.cloud.google dashboard. When i do a linking it shows on the api request screen which gives me an indication that it is receiving data during the linking period. So this leads me to believe one of two things. Either home assistant isn’t passing the data to google about the device i have in home assistant,(Possible Yaml Issue) or google is not able to understand what it is receiving.

Both home assistant and google actions have changed in some shape or form since i last did a link so its hard to pin down which one is causing the issue. Hope someone can figure it out because i have become reliant on voice control. (I have become very lazy since automating everything) One post i did read said they actually talked to google support to work the issue and the next day he was working again but had no idea what they did to fix it or if they did anything but he was up again. Might be worth trying to talk to them.

Thanks Tim

From the GCP console, It looks like all of the calls going through Google’s Homegraph API to the Home Assistant are actually returning 404s, specifically the google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification method.

From what I read in the API docs, its when a request is made by to the third party service i.e. Home Assistant in this case, for the devices available and their associated states OR is used when the 3rd part service needs to report a change in device status. Since this is on initial pairing, it’s Google Home requesting the available devices and states from Home Assistant immediately after getting the auth and token, and HA returning no devices found. All requests fail from what I’m reading in GCP.

Though seeing what is wrong seems a lot harder without the POST body and response for the call. I’m not familiar enough home assistant to see if that’s stored anywhere or logs that show me where the failure is happening. It probably isn’t a malformed request though from Google Home’s end else I’d expected a 400 response but could be some config yaml related issue. @pendlet, could you point me at the post where the poster fixed this? Thanks!

@chanwrm The only posts i found that say they got this fixed are things we already tried or at least i did that did not work. Google Assistant - account linking issue and few others that started over with a new google project. Have you been able to figure anything out? Google Assistant trouble shooting

I did delink mine last week… I’m on the 0.104beta of HA and there is a change in the integration so I made those changes, enables testing a d resync’ed. Also did a ‘Hey Google Sync my devices’ just now and it seems to be working.

Thanks for the info. I might try upgrading to the beta version. Will let you know how it goes once i do it.

@DavidFW1960
I just updated to version 104. where did you find the integration changes for google assistant? I don’t see any changes on the integrations page.

they are on the integration page.
the service account options are new. if you don’t use this you will see errors in your log.

I have had service account for a while now so i did not think that was new. I am waiting for the PI to reboot and i am going to try to link again now that my api key is gone and see what happens.

ah maybe it’s not. I only saw the error in the log when I started with the beta earlier in the week. hadn’t seen the service account previously.

I finally got this to work again. Upgraded to 104 and I removed the API key and completely restarted Hassio. I have the service account setup and working. I think the issue was that i had service account and an API key setup in my yaml and it was causing a conflict. Cant prove it but was the only thing i changed to get it to work.

Yeah it’s one or the other according to the docs.

I had both the API key and the Service account set up in my yaml before. I did only the API key only and still only get 404 responses in the console on 0.104.


With the Service account it’s 200 responses

Both of them I still have the same behavior where no devices load and the account remains unlinked. I’ll go through and read the further debugging steps you guys posted a bit later this weekend.

Same issues here, I am just trying to set this up as of yesterday and I cannot get assistant to link i just get taken back to the set-up devices screen after entering hass login.

I am only using the service account per the docs using an !include to the .json file downloaded directly from google.