Google Assistant: list of devices does not update

Hi,
I configured the Google Assistant integration according to the description in Google Assistant Docs
So far, everything works fine, however I added a new light to Home Assistant, but it does not show up in the Google Home app on my Android smartphone.

I exposed the lights like this

 exposed_domains:
   - switch
   - light
   - group

and do not make use of the google_assistant_name customization.

Similarly, when I remove an existing Light from Home Assistant, it is still shown in the Google Home app.

I can remove the Home Assistant link within the Google Home app and add it again to update all devices, but this will reset all connections to the rooms in Google Home, so I want to avoid to do this whenever I add/rename/remove a light or switch in Home Assistant.

Is there anything I missed during configuration of the integration, or is there any way to trigger an update of the components within the Google Home app?

Thanks in advance!

2 Likes

This is currently the only way.

There is a pull request to refresh it but it’s not merged yet.

Actually - scratch that - It’s been merged now!

It’ll be live in 0.58, which should arrive this coming weekend.

1 Like

That is awesome to hear.
I’m looking forward.
Thanks for your quick responses!

I had now the time to try this out with the latest 0.58 release but had no luck so far.
I enabled the Homegraph API for my Home Assistant project in the cloud console as described in the Google Assistant Docs and added the api_key and an agent_user_id to the google_assistant section in the configuration.
As the documentation states that the initial sync from Google requires the agent_user_id I unlinked and relinked the account from the Google Assistant.
But still, when I add/remove a light and restart Home Assistant, the Google Assistant does not update accordingly.

Any advice?

You don’t restart, you call the google_assistant.request_sync service.

2 Likes

Oh, I did not get that the request_sync service as described in the documentation is a Home Assistant service that has to be called manually.
Somehow I thought it is something that is triggered when I try to refresh the data in the Google Assistant.

Now, when I call the google_assistant.request_sync service everything works like a charm.

Thank you so much!

How do you call that service?

On your Home Assistant page, in the bottom left under Developer Tools click on the leftmost icon.
Select Domain google_assistant and Service request_sync and click the Call Service button.

2 Likes

I have Google Assistant active and working but I don’t get that domain listed?

I have the 0.58.1-version.

I suppose this can be automated by the following automation:

automation:
- alias: 'Update Google Assistant on start of Home Assistant'
  trigger:
    platform: homeassistant
    event: start
  action:
    service: google_assistant.request_sync

Yes, that’s right

See step 9 of the documentation, and the note below it.

9.2. Select your project and click Enable Homegraph API

Thanks, but this was a problem for me because I don’t have any projects there? I have previously followed up to and including step 7.

If you have no project, then maybe you’re signed in with the wrong account?

I only have one account added in my browser profile. That a project exists https://console.actions.google.com/ does not automatically mean that it also exists on https://console.cloud.google.com, at least in my case.

I now have a new project on https://console.cloud.google.com, but this is a newly created project that I needed to create today to enable html5 notifications via GCM. So not the same name etc.

I have never submitted my project on Actions, I have only have it as test draft. Is this sufficient?

Yes, that’s all you have to do.

I do think my project was also not shown on https://console.cloud.google.com by default.
I chose the dropdown to select the project (I have some other projects in there though) and searched for it in the Search Projects and Folders search field, that worked for me.

1 Like

Yes, this worked. I could not select it from the drop-down, it was not visible under ‘All’ from the popup you get when pressing the dropdown… but when I searched from it, I found it. And after that, it was visible from the drop-down.

Go to https://console.cloud.google.com/apis/api/homegraph.googleapis.com/overview

This should be a link, it’s not on the guide. I’ll see if I can fix it.

Go to Credentials and select API Key from Create Credentials

It does not say which API key, server or browser? But I suppose server. This could be clarified and I’ll try to do that as well.

Note down the generated API Key and use this in the configuration

Clarification could be added to what exact config parameter / chapter this is (api_key).

I tried this just now but I got this error in the home-assistant.log file:

2017-11-24 08:13:34 ERROR (MainThread) [homeassistant.components.google_assistant] request_sync request failed: 400 b'{\n "error": {\n "code": 400,\n "message": "Request contains an invalid argument.",\n "status": "INVALID_ARGUMENT"\n }\n}\n'

See the Note at the bottom of the Google Assistant Docs page, which states:

Note: The request_sync service requires that the initial sync from Google includes the agent_user_id. If not, the service will log an error that reads something like “Request contains an invalid argument”. If this happens, then unlink the account from Home Control and relink.