Nest integration problems

Thank you for the update!
I think you will make a lot of us happy with this working.

Ps. on your previous reply:
“Set the oauth consent screen setting to Production . (You have it set to Testing )”

This is what i did:
In the Google Cloud Platform under the OAuth consent screen i set the Publishing status into testing
added the nest integration got the token and everything went flawless,got the thermostat up and running in HA.
After this i returned back to the OAuth consent screen i set the Publishing status back into production
In HA the Nest thermostat keeps working for 7 days…

Looking forward to you update on the Nest integration.

Yeah so that workaround should no longer be necessary with the new update to use web auth with my home assistant redirect urls, mentioned above. The nest integration instructions should be updated with all the right details to get it working.

After installing 2022.6.3 I needed to reconfigure my nest integration that has been working fine since Aug 21.
I have both internal/external SSL on my HA using the same full domain name, therefore initially I had this setup in Google Console with the old callback URI method:


I have since updated in the Google console with the suggested redirect URL, as I was now receiving the"Invalid URL Redirect" error from Google.
Capture7
However on trying to reconfigure the integration, I successfully get through all the config steps but it seems to fail at the integration screen with “Unknown Error Occurred” .
Capture3

It seems to be failing on the final step, I have added the suggested logging configs as per instructions on the nest integration page but there does not seem to be any error in the logs.

I have the same issue. Followed the guide and end up with the same “An unknown error occurred” message.

This is a new Home Assistant install and first time configuring the Nest integration.

Hope someone finds a solution for this. Would be much appreciated!

It would be helpful to see what you find in the logs (may need to be full logs to see debug messages)

I am having the same issue. This is what I can see.

2022-06-15 09:57:22 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140680380065008] Received {'type': 'frontend/get_translations', 'language': 'en', 'category': 'config', 'integration': ['nest'], 'id': 35}
2022-06-15 09:57:22 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140680380065008] Received {'type': 'frontend/get_translations', 'language': 'en', 'category': 'title', 'integration': ['nest'], 'id': 36}
2022-06-15 09:57:22 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140680380065008] Sending {"id":35,"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"}}}
2022-06-15 09:57:22 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140680380065008] Sending {"id":36,"type":"result","success":true,"result":{"resources":{"component.nest.title":"Nest"}}}
2022-06-15 09:57:22 DEBUG (MainThread) [homeassistant.components.application_credentials] Integration 'nest' does not provide application_credentials: No module named 'homeassistant.components.nest.application_credentials'
2022-06-15 09:57:22 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140680380065008] Received {'type': 'manifest/get', 'integration': 'nest', 'id': 37}
2022-06-15 09:57:22 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140680380065008] Sending {"id":37,"type":"result","success":true,"result":{"domain":"nest","name":"Nest","config_flow":true,"dependencies":["ffmpeg","http","auth"],"after_dependencies":["media_source"],"documentation":"https://www.home-assistant.io/integrations/nest","requirements":["python-nest==4.2.0","google-nest-sdm==1.8.0"],"codeowners":["@allenporter"],"quality_scale":"platinum","dhcp":[{"macaddress":"18B430*"},{"macaddress":"641666*"},{"macaddress":"D8EB46*"},{"macaddress":"1C53F9*"}],"iot_class":"cloud_push","loggers":["google_nest_sdm","nest"],"is_built_in":true}}
2022-06-15 09:57:24 DEBUG (MainThread) [homeassistant.components.application_credentials] Integration 'nest' does not provide application_credentials: No module named 'homeassistant.components.nest.application_credentials'

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.