Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual setup of Google assistant integration broken #74351

Closed
Barsonax opened this issue Jul 3, 2022 · 85 comments
Closed

Manual setup of Google assistant integration broken #74351

Barsonax opened this issue Jul 3, 2022 · 85 comments

Comments

@Barsonax
Copy link

Barsonax commented Jul 3, 2022

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

@probot-home-assistant
Copy link

google_assistant documentation
google_assistant source
(message by IssueLinks)

@probot-home-assistant
Copy link

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)

@elupus
Copy link
Contributor

elupus commented Jul 3, 2022

There aught to be something in your log.

@DusBus
Copy link

DusBus commented Jul 4, 2022

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"

@Barsonax
Copy link
Author

Barsonax commented Jul 4, 2022

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?

@DusBus
Copy link

DusBus commented Jul 4, 2022

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

@elupus
Copy link
Contributor

elupus commented Jul 4, 2022

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?

@DusBus
Copy link

DusBus commented Jul 4, 2022

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+.

@fishamic
Copy link

fishamic commented Jul 6, 2022

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 ;)

@balloob
Copy link
Member

balloob commented Jul 6, 2022

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

@fishamic
Copy link

fishamic commented Jul 7, 2022

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)

@Barsonax
Copy link
Author

Barsonax commented Jul 7, 2022

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
Copy link
Author

Barsonax commented Jul 7, 2022

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

@elupus
Copy link
Contributor

elupus commented Jul 7, 2022

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

@Barsonax
Copy link
Author

Barsonax commented Jul 7, 2022

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.

@elupus
Copy link
Contributor

elupus commented Jul 7, 2022

The section called "Enable Local Fullment"

@Barsonax
Copy link
Author

Barsonax commented Jul 7, 2022

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

@DusBus
Copy link

DusBus commented Jul 7, 2022

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.

@Barsonax
Copy link
Author

Barsonax commented Jul 7, 2022

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 😅

@DusBus
Copy link

DusBus commented Jul 7, 2022

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.

@balloob balloob changed the title Google assistant integration broken Manual setup of Google assistant integration broken Jul 7, 2022
@lygris

This comment was marked as resolved.

@Barsonax
Copy link
Author

Barsonax commented Jul 9, 2022

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.

@DusBus
Copy link

DusBus commented Jul 9, 2022

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?

@elupus
Copy link
Contributor

elupus commented Jul 9, 2022

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

@DusBus
Copy link

DusBus commented Jul 9, 2022

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.

@oywino
Copy link

oywino commented Jul 9, 2022

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

@elupus
Copy link
Contributor

elupus commented Jul 9, 2022

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.

@oywino
Copy link

oywino commented Jul 9, 2022

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 😢

@rouke-broersma
Copy link

@elupus wow that totally solved the problem.... I had completely not thought about the API calls possibly not coming from my phone but rather, of course, from google IPs... Sorry!

@Tonguc-Endem
Copy link

Google deprecated their OAuth2 identity authentication method. There is this document from google explaining that the old OAuth method will stop working entirely after October 3rd, 2022.

Anyways, I've relinked both Nest and Google Assistant/Home with the new method. Nest integration seems to be working fine. However Google assistant/home integration is not entirely working as it used to. When I turn on an exposed HA device from the google home app, it turns the device on but the button shows state as off until I click the button a second time. For it to work correctly I have to click 2 times. 2 times to turn on, 2 times to turn off. However, if I issue the command via voice, it seems like it is working without a problem with voice. Asking with voice gives the device state correctly even when the google home app shows state wrong.

This has to be an integration problem.

@rouke-broersma
Copy link

@Tonguc-Endem the current instructions for setting up Google assistant integration use a redirect flow for authorization. Were you using an even older setup before and are you saying you updated to the current documented setup?

@noogs
Copy link

noogs commented Oct 23, 2022

For others having unexplained issues with the Google Assistant integration and are using firewalls with Geo-IP Blocking. Google has been heavily investing in Brazilian infrastructure lately and I've noticed the majority of my requests are now coming from Brazilian IP addresses. Allowing Brazil in my Geo-IP filter immediately resolved all my issues.

@Delfairen
Copy link

I've been fighting this when I was on DuckDNS and then on Cloudflare and I have found one issue and one manual solution. Anytime HA is rebooted I have to reauth the google assistant integeration and then I need to go into the Google home app and reconnect the Home Assistant linked service. The moment both are done it immediately works.

@wifiuk
Copy link

wifiuk commented Dec 11, 2022

+1 for using cloudflare and also having no google assistant integration recently.

@Barsonax
Copy link
Author

I have moved to Cloudflare and since then I have no more issues. Maybe it was a weird connection issue.

Also iam now using uptime kuma to monitor if home assistant is up or not, including checking if https is working. I get a message when it's down so I never miss it when something goes wrong.

@wifiuk
Copy link

wifiuk commented Dec 11, 2022

i use cloudflare and all of a sudden its dead, so cloudflare is not the fix.

@edgy-noodle
Copy link

edgy-noodle commented Dec 12, 2022

Apparently, Google is experiencing general issues with custom integrations for beta versions of the app for a few days now.

You can easily check if that's the case for you by trying to add any other integration than yours.
If you're getting the same error when clicking on any of them the following recommended answers have solved the issue for me: https://www.googlenestcommunity.com/t5/Apps-Account/Google-Home-app-quot-Could-not-reach-service-quot-for-everything/td-p/305201

@wifiuk
Copy link

wifiuk commented Dec 12, 2022

Removing the beta did help a bit but I still get the same error just further on after I have logged into home assistant now so still need to check further.

Def something funky happening

@Delfairen
Copy link

Delfairen commented Dec 12, 2022 via email

@elupus
Copy link
Contributor

elupus commented Dec 12, 2022

Odd. I have never needed to reconnect mine.

@myRice87
Copy link

myRice87 commented Feb 5, 2023

Just found this after several months of struggling with this same issue. I'm able to get to the login screen of my HA instance, but once I log in, loads for a couple of seconds then gives me the same message described in OP.

Looking at the Cloud Console logs, I see an error of 'BACKEND_FAILURE_URL_ERROR'. No idea what this means, but I'm able to get to the login screen of HA, so I'm assuming the URL is fine... I also tried what @edgy-noodle suggested above, but no success there either.

I'm on Cloudflare and using the Google Nest router, so no control over GeoIP filtering.

{
  "insertId": "17khb3wfhzg53p",
  "jsonPayload": {
    "syncLog": {
      "syncs": [
        {
          "requestId": "8285546036327690505",
          "status": "BACKEND_FAILURE_URL_ERROR",
          "httpLatencyMsec": "324"
        }
      ]
    }
  },
  "resource": {
    "type": "assistant_action_project",
    "labels": {
      "project_id": "xx-smarthome-server"
    }
  },
  "timestamp": "2023-02-05T23:24:58.792571474Z",
  "severity": "ERROR",
  "logName": "projects/xx-smarthome-server/logs/assistant_smarthome%2Fassistant_smarthome_logs",
  "receiveTimestamp": "2023-02-05T23:24:58.792571474Z"
}

@rouke-broersma
Copy link

Are you using cloudflare caching for your home assistant instance? That might be a problem.

@myRice87
Copy link

myRice87 commented Feb 6, 2023

@rouke-broersma - Just checked this. I'm on the free tier of Cloudflare, so I can't disable caching altogether. What I ended up doing was creating a cache rule that bypasses caching for all incoming requests where hostname = "*" (which should effectively disable caching). I also cleared the existing cache in Cloudflare for good measure.

Rebooted HA after this and tried connecting, but still got the same error...

@myRice87
Copy link

myRice87 commented Feb 6, 2023

Just to confirm, does the Home Assistant URL setting matter? I have it currently pointing to the correct URL for my instance (dummy inserted for the screenshot), but should this URL contain any parameters or other additional elements?

image

@elupus
Copy link
Contributor

elupus commented Feb 6, 2023

Local network should really be the ip of your instance. Not the "my" url. Doubt that matters here.

@wifiuk
Copy link

wifiuk commented Feb 6, 2023

Local network should really be the ip of your instance. Not the "my" url. Doubt that matters here.

I have to have the external URL to make Google TTS work has worked this way for years. Won't work if internal IP is used.

@elupus
Copy link
Contributor

elupus commented Feb 6, 2023

Should not be needed. It should use the external url.

@myRice87
Copy link

myRice87 commented Feb 7, 2023

I found this thread from 2021 that suggests trying to go to the /api/google_assistant page. Is this still valid in 2023? If so, I get a 404 error when I visit that page. Is this a sign of something misconfigured in my instance?

@myRice87
Copy link

myRice87 commented Feb 7, 2023

Alright, so I finally figured out the root of my issues. Leaving my resolution here in case it helps someone else:

I'm not entirely sure if this first step is necessary, but the first thing I did was disable the Cloud integration by removing it from my config, then restarting HA.

Once I did this, I went into Devices & Services and enabled the filter to show Disabled integrations. Lo-and-behold, my Google Assistant integration was sitting there in a disabled state. Once I enabled it, all of my issues went away and Google Assistant was able to connect.

No idea how it ended up disabled, but I suspect it has something to do with Nabu Casa and how it handles the Google Assistant integration. Either way, hopefully this helps someone else if they ever run into this issue.

@rouke-broersma
Copy link

I found this thread from 2021 that suggests trying to go to the /api/google_assistant page. Is this still valid in 2023? If so, I get a 404 error when I visit that page. Is this a sign of something misconfigured in my instance?

That page gives me a 405: Method not allowed. Sounds like you haven't actually activated Google assistant. Did you set the project id in configuration.yaml?

@elupus
Copy link
Contributor

elupus commented Feb 7, 2023

That is really strange. I cant think of a reason it would end up disabled. One thought could be that you thought you deleted the integration, but you ended up selecting disable at some point. Still it is a strange situation (and hard to figure out). Will ponder if we can correct that somehow.

@balloob
Copy link
Member

balloob commented Feb 7, 2023

No idea how it ended up disabled, but I suspect it has something to do with Nabu Casa and how it handles the Google Assistant integration. Either way, hopefully this helps someone else if they ever run into this issue.

This is wrong. The cloud integration does not enable or disable Google Assistant config entries.

@myRice87
Copy link

myRice87 commented Feb 8, 2023

That page gives me a 405: Method not allowed. Sounds like you haven't actually activated Google assistant. Did you set the project id in configuration.yaml?

Yes, I followed the instructions in the Google Assistant integration guide exactly, so this was the first thing I did. It turns out that my Google Assistant integration was disabled for some reason and I didn't notice.

This is wrong. The cloud integration does not enable or disable Google Assistant config entries.

Upon further reflection, I agree this may have been user error on my part. I likely disabled it at some point for whatever reason during all the troubleshooting I was doing and simply forgot.

That is really strange. I cant think of a reason it would end up disabled. One thought could be that you thought you deleted the integration, but you ended up selecting disable at some point. Still it is a strange situation (and hard to figure out). Will ponder if we can correct that somehow.

It was likely user error on my part, but regardless of how it ended up in this state, I think my difficulty in troubleshooting this came down to a few main issues:

  1. It wasn't obvious to me whether I should have been able to see Google Assistant in the Integrations UI. At one point, I tried adding it via the Add Integration button, and got a message that (at the time) I felt implied that it only needs to exist in the config.yaml. Had I known that a working integration should indeed show up in the Integrations UI, I would have investigated that more initially.

image

  1. Removing the google_assistant entry from the config.yaml, restarting HA, adding it back in, and restarting again did not reset the integration back to an enabled state.

  2. Hitting /api/google_assistant gave a 404, but there's no documentation I could find that states what this implies. In my mind, the entry in config.yaml was correct so there shouldn't be any other reason why it's not working. Had this returned a more specific error such as "Integration Disabled", I would have had more of clue for where to look.

All in all, I'm glad this ended up being a simple problem and I didn't have to completely reinstall my HA instance to fix it.

@danepowell
Copy link

I suspect there are several root causes here. In my case, on careful review of my Google Actions configuration I found a typo in my HA URL. After fixing that, account linking went swimmingly.

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Aug 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests