Nest integration problems

Hi Allen,
I have added the following logger to my configuration.yaml, and restarted HA. Then attempted to reconfigure the integration but I still don’t seem to be getting anything about nest, just a whole bunch of additional logging for [homeassistant.loader].

Have I set up the logging incorrectly here?

logger:
  default: info
  logs:
    homeassistant.components.nest: debug
    homeassistant.components.nest.climate_sdm: debug
    google_nest_sdm: debug
    google_nest_sdm.device: debug
    google_nest_sdm.device_manager: debug
    google_nest_sdm.google_nest_subscriber: debug
    google_nest_sdm.event: debug
    google.cloud.pubsub_v1: debug
    google.cloud.pubsub_v1.subscriber._protocol.streaming_pull_manager: debug

You need to set your default to “debug” or “noset”. The issue is not severe enough to capture by the “info”.

Hmm … I don’t necessarily agree that you’ll get useful information doing that, only unhepful information that isn’t related to the issue.

Maybe adding homeassistant.helpers.config_entry_oauth2_flow to the list of debug would be helpful since it gives you details about the exchange of the token with Google. Likely it will say your token is incorrect which is due to a misconfiguration.

I seem to be getting the same type of error as @tshin:

2022-06-16 16:14:58 DEBUG (MainThread) [homeassistant.components.http.auth] Authenticated 10.0.0.1 for /api/config/config_entries/flow/e536eef8ef62522d9aee7a08eb2841af using bearer token
2022-06-16 16:14:58 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/config/config_entries/flow/e536eef8ef62522d9aee7a08eb2841af to 10.0.0.1 (auth: True)
2022-06-16 16:14:58 DEBUG (MainThread) [homeassistant.components.application_credentials] Integration 'nest' does not provide application_credentials: No module named 'homeassistant.components.nest.application_credentials'
2022-06-16 16:14:58 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140074395818256] Received {'type': 'frontend/get_translations', 'language': 'en', 'category': 'config', 'integration': ['nest'], 'id': 86}
2022-06-16 16:14:58 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140074395818256] Sending {"id":86,"type":"result","success":true,"result":{"resources":{"component.nest.config.abort.authorize_url_timeout":"Timeout generating authorize URL.","component.nest.config.abort.invalid_access_token":"Invalid access token","component.nest.config.abort.missing_configuration":"The component is not configured. Please follow the documentation.","component.nest.config.abort.no_url_available":"No URL available. For information about this error, [check the help section]({docs_url})","component.nest.config.abort.reauth_successful":"Re-authentication was successful","component.nest.config.abort.single_instance_allowed":"Already configured. Only a single configuration possible.","component.nest.config.abort.unknown_authorize_url_generation":"Unknown error generating an authorize URL.","component.nest.config.create_entry.default":"Successfully authenticated","component.nest.config.error.bad_project_id":"Please enter a valid Cloud Project ID (check Cloud Console)","component.nest.config.error.internal_error":"Internal error validating code","component.nest.config.error.invalid_pin":"Invalid PIN Code","component.nest.config.error.subscriber_error":"Unknown subscriber error, see logs","component.nest.config.error.timeout":"Timeout validating code","component.nest.config.error.unknown":"Unexpected error","component.nest.config.error.wrong_project_id":"Please enter a valid Cloud Project ID (found Device Access Project ID)","component.nest.config.step.auth.data.code":"Access Token","component.nest.config.step.auth.description":"To link your Google account, [authorize your account]({url}).\n\nAfter authorization, copy-paste the provided Auth Token code below.","component.nest.config.step.auth.title":"Link Google Account","component.nest.config.step.init.data.flow_impl":"Provider","component.nest.config.step.init.description":"Pick Authentication Method","component.nest.config.step.init.title":"Authentication Provider","component.nest.config.step.link.data.code":"PIN Code","component.nest.config.step.link.description":"To link your Nest account, [authorize your account]({url}).\n\nAfter authorization, copy-paste the provided PIN code below.","component.nest.config.step.link.title":"Link Nest Account","component.nest.config.step.pick_implementation.title":"Pick Authentication Method","component.nest.config.step.pubsub.data.cloud_project_id":"Google Cloud Project ID","component.nest.config.step.pubsub.description":"Visit the [Cloud Console]({url}) to find your Google Cloud Project ID.","component.nest.config.step.pubsub.title":"Configure Google Cloud","component.nest.config.step.reauth_confirm.description":"The Nest integration needs to re-authenticate your account","component.nest.config.step.reauth_confirm.title":"Reauthenticate Integration"}}}

In particular what does this mean:

No module named 'homeassistant.components.nest.application_credentials'

Also found this just before it:

2022-06-16 16:14:58 DEBUG (SyncWorker_7) [homeassistant.util.json] JSON file not found: /usr/src/homeassistant/homeassistant/components/dynalite/translations/en.json

As I mentioned above turning on debug for every module is not helpful. These are not errors.

Hi guys

Wanted to let you know the follow post fixed it for me.

https://community.home-assistant.io/t/nest-authorization-error-error-400-invalid-request/399388/27#:~:text=Configure%20OAuth%20client_id%20and%20client_secret%20[Cloud%20Console]%3A

You will need to have an external URL linked to your HA, also in my case I have an SSL certificate.
Both configured using the Duck DNS add-on.

After which I changed the Redirection URL in my Google Cloud Project:

Step 6: Add the following URI (substitute your domain name): https://yourdomainname.com/auth/external/callback)

Once done I could enable the Nest integration by entering my Google Cloud Project ID when prompted by HA.

Hi,
This is no longer needed actually. That is, you don’t actually need SSL or a resolvable DNS anymore. Just upgrade to the latest home assistant and follow the instructions on the site: Nest - Home Assistant or see Troubleshooting specifically.

That might be the case for some, but I see a lot of users struggling to get this to work, even by following the instructions, just like me.

This is the only way it worked for me.

If people do not wish to set up an external URL and certificate, I hope this will get resolved soon.

Hi, what version of home assistant are you running?

What you are saying was true until the latest release of home assistant, but is not longer true. I can’t tell if you’re acknowledging that my home assistant exists and provides SSL for everyone but you think there is a bug, or if you are not aware that it exists. (The steps you listed are not complete if you want to turn off my home assistant, so i’m assuming you are running a previous home assistant version)

I seem to have the same issue as tshin and sidplayos2.

With homeassistant.helpers.config_entry_oauth2_flow added to the log i don’t seem to receive anything. With full logs enabled I get the same debug messages stating:
No module named 'homeassistant.components.nest.application_credentials

Running a fresh install of core-2022.6.6

I’ve mentioned this a few times, not sure who’s to say this more clearly: this is not related to your issue. Full debug logs are not giving you useful information. Folks should stop telling people to turn on full debug, please.

Unfortunately this issue is not related to that. I tried using my nabu casa (https://yourid.ui.nabu.casa.com/auth/external/callback) which is the external URL and still have the same issue.

The issue is that with the following log config on 2022.6.3 I don’t get any logging about nest auth even mentioned in the logs.

logger:
  default: info
  logs:
    homeassistant.components.nest: debug
    homeassistant.components.nest.climate_sdm: debug
    homeassistant.helpers.config_entry_oauth2_flow: debug
    google_nest_sdm: debug
    google_nest_sdm.device: debug
    google_nest_sdm.device_manager: debug
    google_nest_sdm.google_nest_subscriber: debug
    google_nest_sdm.event: debug
    google.cloud.pubsub_v1: debug
    google.cloud.pubsub_v1.subscriber._protocol.streaming_pull_manager: debug

I understand what you mean about us looking at irrelevant noise in the logs from having debug on, so what other logging components can we add here to actually get logging about the Nest Component auth happening?

@MGDM
I also have internal/external SSL configured, but using the old method “https://yourdomainname.com/auth/external/callback” doesn’t seem to work anymore, hence why I have changed it in the Google Console to the new my home assistant redirect method now. It seems that as of 2022.6.x you have no choice but to use the my homeassistant redirect, is this assumption correct?

The below is what I get if I try to use the “https://yourdomainname.com/auth/external/callback” method in the google console.

The other curious thing is that I am receiving the emails from google saying that my account was successfully linked to the SDM, however I suspect that those emails would not be sent out by google until it has positive auth acknowledgement that everything succeeded.

As a test, when I get back home I will roll back to the previous HA backup and re-auth again and see if that works. That will then prove if all the google setup is correct at least. Then we can trace from there.

I recommend not listening to the folks giving you incorrect information and suggest filing a github issue and actually filling out the information in the report and attaching logs, etc.

The instructions in Nest - Home Assistant and troubleshooting are correct, so don’t listen to folks that are telling you to do things differently. I realize you’re getting an error message without logging, but the amount of incorrect information here is just wasting your time.

I have raised a Github issue around this and will continue in there. FYI I reverted to 2022.3.4 , deleted and re-created the integration, modified the callback URL to the direct method and auth was successful .

I think the main problem is not having logging at the moment.

Seems like the issue may be related to “keep me logged in” not being set and My Home Assistant

1 Like

@allenporter just dropping into this thread late to say I was struggling with the same issues described in this ticket. After reading your last comment I checked the “keep me logged in” box - it failed initially. I restarted the Nest setup loop again and the second time around it was successful and prompted me for the Project ID - so this seems to be a workaround solution to whatever is the root cause of the issue.

Thanks for confirming. The issue is tracked here My Home Assistant OAuth redirect fails with "Unknown Error Occurred" when not using "Keep me logged in" · Issue #73625 · home-assistant/core · GitHub to make this less confusing.

Hi,

I have went through the integration process and I am getting to the part were it asks if I want to link my google account with HA. After I click link it takes me to the HA login screen and after I log in I see the below error and the integration hasn’t worked. I have tried creating a brand new google project and I receive the same error. I use DuckDNS and NGINX as a reverse proxy. I had this working a while back but since I tried the new steps to fix the authentication issue it is no longer working.

Error that I am receiving doesn’t give me much to go on. Does any one have any ideas as to what is going wrong?

Thanks

See the discussion in the issue I just linked My Home Assistant OAuth redirect fails with "Unknown Error Occurred" when not using "Keep me logged in" · Issue #73625 · home-assistant/core · GitHub