Can't connect to Google Assistant

I had no problems with my google assistant connection per this guide until recently when I lost my hability to “sync my devices”. I tried everything including deleting the project and creating a new one. Problem is that now I can’t connect the test app to google home getting an error message “can’t update definition. check connection” (free translation from portuguese).
In HA logs I get the following:

Logger: homeassistant.components.google_assistant.smart_home
Source: components/google_assistant/smart_home.py:33
Integration: Google Assistant (documentation, issues)
First occurred: 19:06:43 (9 occurrences)
Last logged: 19:10:41

Error handling message {'inputs': [{'intent': 'action.devices.SYNC'}], 'requestId': '2892137158585047699'}: {'errorCode': 'unknownError'}
Error handling message {'inputs': [{'intent': 'action.devices.SYNC'}], 'requestId': '15253947018422036710'}: {'errorCode': 'unknownError'}
Error handling message {'inputs': [{'intent': 'action.devices.SYNC'}], 'requestId': '2671222222694947890'}: {'errorCode': 'unknownError'}
Error handling message {'inputs': [{'intent': 'action.devices.SYNC'}], 'requestId': '10329557892450666121'}: {'errorCode': 'unknownError'}
Error handling message {'inputs': [{'intent': 'action.devices.SYNC'}], 'requestId': '7514137463264124124'}: {'errorCode': 'unknownError'}
Logger: homeassistant.components.google_assistant.smart_home
Source: components/google_assistant/trait.py:1210
Integration: Google Assistant (documentation, issues)
First occurred: 19:06:43 (9 occurrences)
Last logged: 19:10:41

Unexpected error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/smart_home.py", line 57, in _process
    result = await handler(hass, data, inputs[0].get("payload"))
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/smart_home.py", line 90, in async_devices_sync
    for entity in async_get_entities(hass, data.config)
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/helpers.py", line 435, in sync_serialize
    device["attributes"].update(trt.sync_attributes())
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/trait.py", line 1210, in sync_attributes
    modes.append(_generate("option", attrs[input_select.ATTR_OPTIONS]))
KeyError: 'options'

Can someone help?

Hi,

I seem to have the same issue at the moment. Which version of HA are you on? I’m on 0.109.6. I will try to upgrade to 0.111.4 to see if that makes a difference. Also, what have you already tried? I tried the following:

  • re-enable the draft test version in Google Actions. That worked in the past.
  • toggle the URL in the action section to recreate the preview (per documentation)
  • generate a new serve account JSON file

None of the above made a difference. The error I get is:

ERROR (MainThread) [homeassistant.components.google_assistant.smart_home] Error handling message {'inputs': [{'intent': 'action.devices.SYNC'}], 'requestId': ''}: {'errorCode': 'unknownError'}

Have you had any success in the meantime getting it to work?

Got exactly the same error as OP on (docker HA beta) version 0.112.1:

2020-07-03 11:16:15 ERROR (MainThread) [homeassistant.components.google_assistant.smart_home] Unexpected error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/smart_home.py", line 57, in _process
    result = await handler(hass, data, inputs[0].get("payload"))
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/smart_home.py", line 90, in async_devices_sync
    for entity in async_get_entities(hass, data.config)
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/helpers.py", line 435, in sync_serialize
    device["attributes"].update(trt.sync_attributes())
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/trait.py", line 1243, in sync_attributes
    modes.append(_generate("option", attrs[input_select.ATTR_OPTIONS]))
KeyError: 'options'
2020-07-03 11:16:15 ERROR (MainThread) [homeassistant.components.google_assistant.smart_home] Error handling message {'inputs': [{'intent': 'action.devices.SYNC'}], 'requestId': '17643754696447221286'}: {'errorCode': 'unknownError'}

To me this looks like some device attribute not being handled properly by HA or something, but no clue on which/what that might be…

Same problem here.

Have anyone found a solution for this problem?

After one thousand tries I changed exposed by default to false and it started working

I have your own logs but I have not solved.
At this moment I don’t have access to devices in home assistant via google assistant.
I can’t connect the test app to google home getting an error message “can’t update definition. check connection”.

That confirms trouble with a device. I am suspecting of input_select (in my case).

I the lights. If I delete them from the configuration I don’t have errors but I don’t have more the lights in Google Assistant.

Same logs of here:

After Upgrade to 0.65.5 Google Assistant will not resync

Well, just in case it happens anyone… I was doing some fiddling with google assistant API and I got a lot of this error:

ERROR (MainThread) [homeassistant.components.google_assistant.smart_home] Error handling message {‘inputs’: [{‘intent’: ‘action.devices.SYNC’}], ‘requestId’: ‘2152013997959365127’}: {‘errorCode’: ‘unknownError’}

After doing a lot of tests I found out that the error was because I didnt have “exposed_domains:” set on google_assistant “tag” on my configurations.yaml

To correct this I changed
FROM

google_assistant:
  project_id: MY_PROJECT_ID

TO

google_assistant:
  project_id: MY_PROJECT_ID
  exposed_domains:
    - switch
    - light

(and of course, you set the domains you want to expose).