Google Assistant component stopped working 0.85.1

I’m having issues with Google Assistant ever since upgrading to 0.85.1. I’ve gone through the complete configuration twice now with no change. I can see the home assistant device in google home app and when I login I get the “Succesfully linked…” message but no home assistant devices appear in the app.

When I call the request sync service from home assistant I get a failed message and following in the log:

Tue Jan 22 2019 20:12:59 GMT-0500 (Eastern Standard Time)

Error handling message: {‘type’: ‘call_service’, ‘domain’: ‘google_assistant’, ‘service’: ‘request_sync’, ‘service_data’: {}, ‘id’: 28}
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/google_assistant/init.py”, line 78, in request_sync_service_handler
res.raise_for_status()
File “/usr/local/lib/python3.6/site-packages/aiohttp/client_reqrep.py”, line 916, in raise_for_status
headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 403, message=‘Forbidden’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/websocket_api/decorators.py”, line 17, in _handle_async_response
await func(hass, connection, msg)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/websocket_api/commands.py”, line 148, in handle_call_service
connection.context(msg))
File “/usr/local/lib/python3.6/site-packages/homeassistant/core.py”, line 1121, in async_call
self._execute_service(handler, service_call))
File “/usr/local/lib/python3.6/site-packages/homeassistant/core.py”, line 1143, in _execute_service
await handler.func(service_call)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/google_assistant/init.py”, line 80, in request_sync_service_handler
body = await res.read()
File “/usr/local/lib/python3.6/site-packages/aiohttp/client_reqrep.py”, line 943, in read
self._body = await self.content.read()
File “/usr/local/lib/python3.6/site-packages/aiohttp/streams.py”, line 319, in read
raise self._exception
aiohttp.client_exceptions.ClientConnectionError: Connection closed

I’ve tried all the steps for troubleshooting request sync in component page and I’ve got the api key setup.

I’m not sure it matters but I’m using nginx to reverse proxy home assistant. I double checked that configuration and it matches the the docs.

This was working a few weeks ago but I took some time off from home assistant and now I can’t get it to work again.

What is the config for google assistant? There was a change a couple of releases back and it changed back again. I seem to remember the exact same issue when it changed back until I reverted the change… might have been in 0,.84… honestly can’t exactly remember. It was something to do with
expose_by_default: false
Looks like I added that in 0.83 but had to remove that in 0.84 - until I did that, I lost all my devices in Google when I re-synced.

I do have that line in my config. I’ll try removing it. Thanks!

You know that Google sync stops working every month? This is a limitation of the non cloud version…
Seems the draft in the simulator is limited in time.
So you need to go to the console Google sitew and enable testing again, this creates a new draft…

Afterwards you can sync again…
Maybe that’s your issue

1 Like

I didn’t know it was monthly but I had noticed that the test-draft was longer available and recreated it. I went as far a completely deleting the google action and recreating it from scratch

not sure if its exact 1 month, can be more :slight_smile:

This thread is a bit old, but if someone is searching for solutions to failing device syncs, maybe the following info is valuable as well:

If devices stop syncing and you get a 403 error in the log…


2019-05-28 13:45:34 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall script.google_home_devi
ce_sync (c:fdde49f00feb4aa9a9b13e6587f66e7e)>
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/components/google_assistant/__init__.py", line 76, in request_sync_service_handler
    res.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 942, in raise_for_status
    headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/app/homeassistant/core.py", line 1150, in _safe_execute
    await self._execute_service(handler, service_call)
  File "/usr/src/app/homeassistant/core.py", line 1163, in _execute_service
    await handler.func(service_call)
  File "/usr/src/app/homeassistant/components/script/__init__.py", line 114, in service_handler
    context=service.context)
  File "/usr/src/app/homeassistant/components/script/__init__.py", line 172, in async_turn_on
    kwargs.get(ATTR_VARIABLES), context)
  File "/usr/src/app/homeassistant/helpers/script.py", line 131, in async_run
    await self._handle_action(action, variables, context)
  File "/usr/src/app/homeassistant/helpers/script.py", line 210, in _handle_action
    action, variables, context)
  File "/usr/src/app/homeassistant/helpers/script.py", line 299, in _async_call_service
    context=context
  File "/usr/src/app/homeassistant/helpers/service.py", line 89, in async_call_from_config
    domain, service_name, service_data, blocking=blocking, context=context)
  File "/usr/src/app/homeassistant/core.py", line 1141, in async_call
    self._execute_service(handler, service_call))
  File "/usr/src/app/homeassistant/core.py", line 1163, in _execute_service
    await handler.func(service_call)
  File "/usr/src/app/homeassistant/components/google_assistant/__init__.py", line 78, in request_sync_service_handler
    body = await res.read()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 969, in read
    self._body = await self.content.read()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/streams.py", line 335, in read
    raise self._exception
aiohttp.client_exceptions.ClientConnectionError: Connection closed

…you may check if you (accidentally) messed with the API restrictions for your configuredAPI key, i.e. the API key isn’t allowed to use the HomeGraph API:

google_assistant:
  project_id: foo-bar-123456
  api_key: xyzABX....
  • Edit (✎) the key properties
  • Open the dropdown “x APIs” in the API Restrictions section
  • check, if “HomeGraph API” ist selected (if not, check it!)
  • don’t forget to press the SAVE button at the bottom of the page
  • Retry the device sync in HA