core icon indicating copy to clipboard operation
core copied to clipboard

Manual setup of Google assistant integration broken

Open Barsonax opened this issue 2 years ago • 63 comments

The problem

After it was working for months Google assistant integration with homeassistant now seems to be broken. I also cannot re add homeassistant in google home because after logging in I get this message: photo_2022-07-03_15-05-46

Iam running homeassistant on docker in a pi behind a reverse proxy. Iam still able to reach my homeasisstant instance with https from a external network so there doesn't seem to be any connectivity issue.

What version of Home Assistant Core has the issue?

Home Assistant Core 2022.6.7

What was the last working version of Home Assistant Core?

Home Assistant Core 2022.6.7

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Google assistant

Link to integration documentation on our website

https://www.home-assistant.io/integrations/google_assistant/

Diagnostics information

No logs available

Example YAML snippet

google_assistant:
  project_id: foobar
  service_account: !include service_account.json
  report_state: true
  expose_by_default: false

Anything in the logs that might be useful for us?

No logs available

Additional information

No response

Barsonax avatar Jul 03 '22 13:07 Barsonax

Hey there @home-assistant/cloud, mind taking a look at this issue as it has been labeled with an integration (google_assistant) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

There aught to be something in your log.

elupus avatar Jul 03 '22 20:07 elupus

Same here, have spent several hours troubleshooting this without any significant progress.

Others have stated that adding a logo and some more information (privacy policy etc.) did the trick but I also tried all of that and nothing changed.

I even started from scratch and worked through the entire documentation again but same thing, fails with "Could not reach xyz"

DusBus avatar Jul 04 '22 10:07 DusBus

There aught to be something in your log.

Checked it again and there's nothing related to google_assistant. No call to graph api or something like that.

Others have stated that adding a logo and some more information (privacy policy etc.) did the trick but I also tried all of that and nothing changed.

Yup tried that one as well.

It so weird as it was working fine for months. During that time the pi was restarted several times. Now since a couple of days it stopped working. Maybe something changed on googles end?

Barsonax avatar Jul 04 '22 11:07 Barsonax

I was in the process of moving all my smarthome stuff to homeassistant but wanted to make sure that google assistant is working before changing anything. Did the whole jazz with reverse proxy etc. etc. to make sure that everything works as intended with a test instance of homeassistant (that was a few weeks back). I then reinstalled home assistant from scratch and left everything else (the rev proxy in particular) as it was. I first simply copied over the working config with all the keys n stuff but since it didn't work, I started over with an entirely new project on Google Actions. unfortunately still no luck.

I just tried again and checked the logs, there is absolutely nothing (related to gassistant) in there. Or am I looking in the wrong place?

Settings -> System -> Logs

DusBus avatar Jul 04 '22 11:07 DusBus

Sounds strange. Mine is still working. But i`ve not set it up a-new in some time. But I don't think anything changed there.

Do you even get redirected to the loginscreen in home assistant when you try to relink?

elupus avatar Jul 04 '22 12:07 elupus

Do you even get redirected to the loginscreen in home assistant when you try to relink?

Yes. Basically:

  • Open up Home app (I tried using it on a different device / reinstalling the app as well, does not make a difference though)
  • Click on the lil +
  • Set up device
  • Link devices (2nd entry)
  • Select custom app from the list
  • Home Assistant login screen appears
  • I log in
  • White page comes up, keeps loading for about two seconds and then dies with "Could not reach...."

What I find curious is that the custom icon I have set for the app does not show up in the list. I'm not sure if that's normal but something I thought was odd. Also, although I have deleted the old app in Actions, it's still in the list after 24h+.

DusBus avatar Jul 04 '22 13:07 DusBus

The funny thing is that account is somehow "linked" image but same error popup. Tried just google home for the very first time and got this timing ;)

fishamic avatar Jul 06 '22 18:07 fishamic

Make sure you are running the latest version of the local SDK JS: https://github.com/NabuCasa/home-assistant-google-assistant-local-sdk/releases

balloob avatar Jul 06 '22 18:07 balloob

Make sure you are running the latest version of the local SDK JS: https://github.com/NabuCasa/home-assistant-google-assistant-local-sdk/releases

Is this something additional? i run self-hosted HA without HA Cloud /NabuCasa and tried to get simple turning my zigbee devices which are not Tuya/Sonoff ones...(they are easily add via their apps)

fishamic avatar Jul 07 '22 12:07 fishamic

Make sure you are running the latest version of the local SDK JS: https://github.com/NabuCasa/home-assistant-google-assistant-local-sdk/releases

Iam using the docker container so one would expect it already uses the correct version of that sdk

Barsonax avatar Jul 07 '22 12:07 Barsonax

Just upgraded to 2022.7.0 but this is still not working nothing is being logged either when I try to add google assistant to homeassistant again.

When I input wrong credentials on purpose I do see a login attempt being logged

Barsonax avatar Jul 07 '22 13:07 Barsonax

The local sdk is something you upload on the action console, when you set up the project on googles site.

elupus avatar Jul 07 '22 15:07 elupus

The local sdk is something you upload on the action console, when you set up the project on googles site.

Oh you mean this part of the instructions? https://www.home-assistant.io/integrations/google_assistant/#enable-local-fulfillment

I just did that again but still not working. Maybe needs some time so will try again later.

Barsonax avatar Jul 07 '22 15:07 Barsonax

The section called "Enable Local Fullment"

elupus avatar Jul 07 '22 15:07 elupus

The section called "Enable Local Fullment"

I linked the wrong link, it was supposed to be https://www.home-assistant.io/integrations/google_assistant/#enable-local-fulfillment

Barsonax avatar Jul 07 '22 16:07 Barsonax

Wait, isn't this an optional step? As far as I understand it's supposed to work without enabling local fulfillment as well.

I too updated to 2022.7 but still... no luck.

DusBus avatar Jul 07 '22 16:07 DusBus

Wait, isn't this an optional step? As far as I understand it's supposed to work without enabling local fulfillment as well.

I too updated to 2022.7 but still... no luck.

Yes it's optional, I just tried it out because iam running out of options 😅

Barsonax avatar Jul 07 '22 17:07 Barsonax

Same here, the WAF is dropping rapidly and I'm running out of excuses... The shiny new dashboards are only going to distract my SO for a limited amount of time 😂

I was hoping it to just magically fix itself but I feel like that's not gonna happen. Unfortunately I'm still too much of a newcomer to HA and have literally no idea how to dive deeper or how to get my hands on some debug logs to maybe figure out what's going on.

DusBus avatar Jul 07 '22 18:07 DusBus

I have a similiar issue I believe. My integration is working but state reporting is not. I'm continually getting the follow errors but devices are syncing.

Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404 Request for https://homegraph.googleapis.com/v1/devices:requestSync failed: 404

EDIT Realized I created my service account in the wrong GCP project, created a new one in the correct project and enabled homegraph and it's working now

lygris avatar Jul 07 '22 20:07 lygris

Same here, the WAF is dropping rapidly and I'm running out of excuses... The shiny new dashboards are only going to distract my SO for a limited amount of time 😂

I was hoping it to just magically fix itself but I feel like that's not gonna happen. Unfortunately I'm still too much of a newcomer to HA and have literally no idea how to dive deeper or how to get my hands on some debug logs to maybe figure out what's going on.

Even though I got more HA 'experience', I even have a job as software engineer, iam in the dark with this problem. It's hard to figure out what's going wrong without logging (checked HA and Google Cloud console but both empty).

I have been running HA for almost 2 years now, the google assistant integration was working fine for almost a year until it mysteriously broke.

There are so many more things that can break when you have a cloud based integrations like this. Looking into local based alternatives now but with voice there are not so much alternatives.

Barsonax avatar Jul 09 '22 08:07 Barsonax

Just tried it with 2022.7.1 and .2 but issue still persists. Wasn't expecting much since I didn't see anything related to it in the release notes but... one can have hope 😉

What I find curious is that we don't see more people complaining about it being broken. Is it working for some? Is this integration just not used by many?

DusBus avatar Jul 09 '22 08:07 DusBus

Try creating a new project in the action console. I've had to do that in the past.

elupus avatar Jul 09 '22 09:07 elupus

Try creating a new project in the action console. I've had to do that in the past.

That was basically the first thing I tried, after I ran into this issue for the first time. Started from scratch, cleaned all the related config from HA etc. Still, no luck.

DusBus avatar Jul 09 '22 09:07 DusBus

It seems I have a similar issue: image I'm running HA in docker. This happened after upgrading from 6.7 to 7.0 I also tried 7.1 and 7.2 but to no avail. Reverting back to 6.7 did'nt quite solve the problem. I also had to completely restore a backup of the old config folder. Then everything is ok again as long as I stay at 6.7

oywino avatar Jul 09 '22 09:07 oywino

It seems I have a similar issue: image I'm running HA in docker. This happened after upgrading from 6.7 to 7.0 I also tried 7.1 and 7.2 but to no avail. Reverting back to 6.7 did'nt quite solve the problem. I also had to completely restore a backup of the old config folder. Then everything is ok again as long as I stay at 6.7

Your issue is different. Can you open a new issue on that with the errors in log.

elupus avatar Jul 09 '22 09:07 elupus

Your issue is different. Can you open a new issue on that with the errors in log.

Oops - sorry, I just reverted back and restored the previous config - so I guess the log is gone 😢

oywino avatar Jul 09 '22 10:07 oywino

+1 for the last couple months with each HA version - have tried completely removing/configuring from scratch the Google Home, app, service account (or no device sync), etc. per the manual setup instructions and this thread. Everything's accessible externally with a valid certificate and CloudFlare proxy disabled; I get the expected "405: Method Not Allowed" on the raw fulfillment URL.

I'm using Nginx proxy manager for SSL -> non-SSL backend. Websockets + HTTP/2 are enabled, no custom configuration.

devoncrouse avatar Jul 09 '22 15:07 devoncrouse

It looks like the authentication is actually successful when attempting to add the [test] app in Home - I don't see anything after the POST /auth/token :face_exhaling:

# 172.16.8.22 - HA internal IP
# 172.30.33.6 - nginx container IP
# 8123 - HA non-SSL port

ssh [email protected] -p 22222 "docker run --rm --net=host d97jro/tcpdump tcpdump -i hassio -U -w - port 8123 and host 172.16.8.22 and host 172.30.33.6 2>/dev/null" | wireshark -k -i -

GET /auth/authorize?response_type=code&client_id=https://oauth-redirect.googleusercontent.com/r/APPNAME&redirect_uri=https://oauth-redirect.googleusercontent.com/r/APPNAME&scope=email+name&state=LONGANDENCODED HTTP/1.1
HTTP/1.1 200 OK
<!DOCTYPE html><html><head><title>Home Assistant</title>...

GET /auth/providers HTTP/1.1
HTTP/1.1 200 OK
[{"name": "Home Assistant Local", "id": null, "type": "homeassistant"}]

GET /manifest.json HTTP/1.1
HTTP/1.1 200 OK
{"background_color": "#FFFFFF", "description": "Home automation platform...

POST /auth/login_flow HTTP/1.1
{"client_id":"https://oauth-redirect.googleusercontent.com/r/APPNAME","handler":["homeassistant",null],"redirect_uri":"https://oauth-redirect.googleusercontent.com/r/APPNAME"}
HTTP/1.1 200 OK
{"type": "form", "flow_id": "HASH", "handler": ["homeassistant", null], "step_id": "init", "data_schema": [{"type": "string", "name": "username", "required": true}, {"type": "string", "name": "password", "required": true}], "errors": {}, "description_placeholders": null, "last_step": null}

POST /auth/login_flow/HASH HTTP/1.1
{"username":"USER","password":"PASSWORD","client_id":"https://oauth-redirect.googleusercontent.com/r/APPNAME"}
HTTP/1.1 200 OK
{"version": 1, "type": "create_entry", "flow_id": "HASH", "handler": ["homeassistant", null], "title": "Home Assistant Local", "description": null, "description_placeholders": null, "result": "HASH"}

POST /auth/token HTTP/1.1
grant_type=authorization_code&code=HASH&redirect_uri=https://oauth-redirect.googleusercontent.com/r/APPNAME&client_id=https://oauth-redirect.googleusercontent.com/r/APPNAME&client_secret=unused
HTTP/1.1 200 OK
{"access_token": "TOKEN", "token_type": "Bearer", "refresh_token": "TOKEN", "expires_in": 1800, "ha_auth_provider": "homeassistant"}

devoncrouse avatar Jul 09 '22 16:07 devoncrouse