Yet another Google assistant integration issue

I could really need some help getting Google assistant integration working again… I’ve had it working for about a year, but some entities weren’t controllable (shown as offline with GA), and sync_update wouldn’t work when I wanted (but did a few times) so I decided to remove the configuration and start over, so I created and configured a new project, replaced the info in the configuration an so on, but now I keep getting “Couldn’t update your settings, check connection” :disappointed:

I have made sure that my HA instance is accessible over the internet over https and I can see my instance is reachable both through https://mydomain.duckdns.org:8123 and https://mydomain.duckdns.org (both 443 and 8123 are forwarded)
I have disabled pihole temporarely while trying to add the project in the Google home app.

I should also mention that I removed my original project from the Google Actions console, but I can still see two test apps in the Home app even though I only have one i the G Actions console

I have also tried:
clearing my browser cache and cookies
removing the HA chrome-app from the phone
exposing only a single entity in the configuration
Disabling the manual Google assistant integration and trying with the Nabu Casa cloud one and I keep seeing the same issue “Couldn’t update your settings, check connection” or something in that regard.

Here’s (one of) my configuration.yaml configurations I’ve tried prior to trying to set up GA with cloud:

google_assistant:
  project_id: MYNEWPROJECT
  service_account: !include MYNEWGAPROJECT.json
  report_state: true
  expose_by_default: true
  exposed_domains:
    - light
  entity_config:
    light.vardagsrum_tak:
      expose: true

I’m seeing these in the logs, but can’t seem to make much sense of it.

Logger: homeassistant.components.websocket_api.http.connection.REDACTED
Source: components/websocket_api/connection.py:97
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 14:22:13 (1 occurrences)
Last logged: 14:22:13

Error handling message: Unauthorized

Another:

Logger: homeassistant.components.google_assistant.smart_home
Source: components/google_assistant/trait.py:193
Integration: Google Assistant (documentation, issues)
First occurred: 14:23:13 (9 occurrences)
Last logged: 14:25:31

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 538, in async_get_entities
    if entity.is_supported():
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/helpers.py", line 371, in is_supported
    return bool(self.traits())
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/helpers.py", line 344, in traits
    self._traits = [
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/helpers.py", line 347, in <listcomp>
    if Trait.supported(domain, features, device_class)
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/trait.py", line 193, in supported
    return features & light.SUPPORT_BRIGHTNESS
TypeError: unsupported operand type(s) for &: 'str' and 'int'

Another:

Logger: homeassistant.components.google_assistant.smart_home
Source: components/google_assistant/smart_home.py:33
Integration: Google Assistant (documentation, issues)
First occurred: 14:23:13 (9 occurrences)
Last logged: 14:25:31

Error handling message {'inputs': [{'intent': 'action.devices.SYNC'}], 'requestId': '16677197895202521342'}: {'errorCode': 'unknownError'}
Error handling message {'inputs': [{'intent': 'action.devices.SYNC'}], 'requestId': '2414685249902313956'}: {'errorCode': 'unknownError'}
Error handling message {'inputs': [{'intent': 'action.devices.SYNC'}], 'requestId': '1444145285365152721'}: {'errorCode': 'unknownError'}
Error handling message {'inputs': [{'intent': 'action.devices.SYNC'}], 'requestId': '11423497685148771470'}: {'errorCode': 'unknownError'}
Error handling message {'inputs': [{'intent': 'action.devices.SYNC'}], 'requestId': '17109729758187490245'}: {'errorCode': 'unknownError'}

Not sure if this one’s related:

Logger: homeassistant.components.websocket_api.http.connection.139997077976160
Source: components/websocket_api/http.py:138
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 14:30:00 (1 occurrences)
Last logged: 14:30:00

Client unable to keep up with pending messages. Stayed over 512 for 5 seconds

Ok… so i tried to find some clues on what could be causing this, and I noticed that:

  1. I’m greeted with a “Logging in with Home assistant local” screen
  2. After I enter my home assistant credentials I get redirected back to to the login screen for a brief while and the username and password fields aren’t populated - and I get the error message.

The way I noticed the redirect is because I pressed the three dots in the Home apps built in browser and selected to open with chrome.

I should also mention that I’ve tried connecting the test app both over LAN and 4G but I can’t get past the credentials screen and the error that follows.

The removed project that I initially had configured is still visible in the G home app, even though there is no trail left of it in the G actions console or IAM. Pressing it in the G home app shows a brief loading screen before it returns to the available apps list.

Not sure if this could be a clue to someone, and I’m happy to provide any additional information if needed

EDIT:

I thought that maybe it was some kind of auth issue, so I removed all access-tokens and cleared all logs and then tried to add the app again. Still same error, with these logs present after entering my credentials:

Logger: homeassistant.components.google_assistant.smart_home
Source: components/google_assistant/trait.py:195
Integration: Google Assistant (documentation, issues)
First occurred: 21:15:58 (3 occurrences)
Last logged: 21:15:59

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 538, in async_get_entities
    if entity.is_supported():
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/helpers.py", line 371, in is_supported
    return bool(self.traits())
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/helpers.py", line 344, in traits
    self._traits = [
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/helpers.py", line 347, in <listcomp>
    if Trait.supported(domain, features, device_class)
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/trait.py", line 195, in supported
    return features & light.SUPPORT_BRIGHTNESS
TypeError: unsupported operand type(s) for &: 'str' and 'int'

and this one:

Logger: homeassistant.components.google_assistant.smart_home
Source: components/google_assistant/smart_home.py:33
Integration: Google Assistant (documentation, issues)
First occurred: 21:15:58 (3 occurrences)
Last logged: 21:15:59

Error handling message {'inputs': [{'intent': 'action.devices.SYNC'}], 'requestId': '11582302016100052833'}: {'errorCode': 'unknownError'}
Error handling message {'inputs': [{'intent': 'action.devices.SYNC'}], 'requestId': '8911973771625270978'}: {'errorCode': 'unknownError'}
Error handling message {'inputs': [{'intent': 'action.devices.SYNC'}], 'requestId': '3164852768554185039'}: {'errorCode': 'unknownError'}

Ok, I finally solved it!

I ended up enabling debug logging for the Google assistant component and found that I had some sketchy automations on some old devices that Google didn’t like. All these automation were running in node red, so I disabled that flow and that did the trick.

I have since tweaked my automation, so I didn’t loose any functionality.

Hope this helps someone