Nest integration, for Nest Learning Thermostat , results in error 400: invalid_request

Hello, I’m hoping someone can shed some light on this integration issue I’m seeing…
my Home Assistant running on my laptop with virtual machine. I’ve been using it for a couple months, it works well.
last month, I installed a Nest Learning Thermostat, and I can access it via Nest Application on my phone. Now, I want to access the Thermostat from Home Assistant.

I followed the instructions for nest integration as documented here:
Nest - Home Assistant
during the last step, once I reboot Home Assistant and tries to add the Nest integration, after this first screen:

when I hit “Next” button, I get this error:

Authorization Error
Error 400: invalid_request
You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy for keeping apps secure.
...   ...
If you’re the app developer, make sure that these request details comply with Google policies.
redirect_uri: http://homeassistant:8123/auth/external/callback 

What is puzzling me, is that in all the instructions I don’t see a place where I have to tell/configure the uri. The Auth Client credential instructions recommends that I use “Desktop App” and explicitly says that “web app auth” is no longer recommended.
I’ve seen other article suggesting that one should specify the external link to home assistant which for me it’s path https://xxxxxxxx… . However, I never had a chance to try it, since the interface does not ask for this info because the selection was based on “desktop app”.

can someone help in this matter ?

Hello, after fiddling with so many different variations of this installation, and after scouring the community support articles and discussions, I finally got the Nest integration to work for me. while it was hard to integrate, this integration has a nice LoveLace card that looks close to what the physical Nest thermostat looks like (i.e. it’s intuitive). Thank you for the developer of this integration for making it available to the public.

While I committed a couple of mistakes in following the instructions, I fixed those, but the real problems for me were the 3 errors that I found in the documentation (if the document worked for other people as is, then perhaps the document is questionable and did not work for my environment for some reason. So, I had to deviate from the instructions). Here are the 3 Items in the documents are I had deviate from:

  1. In section “configure Oauth Client_id and client_secret”…the document recommends to use “desktop App”. I could not get that work and I kept seeing an error message when I tried to configure the integration. To get it to work, I used the “web App” auth instead. This “web app” auth will give you the option to specify the “uri” (being the external site address of HA).

  2. The section titled Configuration, The document recommends to NOT include subscriber_id in the configuration.yaml. However, after reboot the HA would clearly report a message in the log file indicating that "subscriber_id is required ". and if you ignore the error, and try to invoke the integrations, you’ll get an abort message. So, you have to add the “subscriber_id” in the yaml file.

  3. The document does not mention how to create a subscription. Which is now required to be filled (as I mentioned in previous bullet). To do that I followed the instructions on this site to get a subscription and then use its name as a “subscribor_id” to be used in configuration.yaml file.

again, thanks to all the contributors to this forum.

1 Like

You also posted this in GitHub issues, but also replying here in case someone finds your post.

You need to upgrade to 2021.12. the problem is you are following the new instructions with an old version of home assistant.

Thank you Allen for the explanation.
I can understand how this problem can show up, where SW is an older release, and the documentation is for a newer release. As I mentioned above, I over came the issues, I got my system to work using “web app” auth flow. the interface is working for me.

However, given your explanation, I can conclude, perhaps there is a gap in “HA release flow” that could be a source of issues for new comers like me (and a source of un-necessary frustration). this comment is no longer related to Nest integration anymore. Rather, the gap being, “given a particular HA release, the user should be able to point to the corresponding documentation”. In my case my release is 2021.11.5, and using the documentation link found at my instance http://homeassistant:8123/config/info the nest integration link takes me to the latest version of that integration, instead of the version that would have described the support for “web app auth” method (which, btw, I have not been able to locate).
perhaps plugging/fixing this documentation flow gap could reduce the support effort provided by the developers…this is a recommendation not for this Nest issue anymore, rather for other future enhancements that will be going on in this fine open-source enterprise.

question: given your recommendation for me to upgrade to the latest HA version 12.3, does that mean my current Nest integration would now break and I have to redo my integration (because I’m using web app auth, and I should now use the recommended desktop app auth)? or do you expect it to continue to work (even though I’m using a ‘web app’ client) ?

At any rate, thank you again for this Nest integration that you provided, and for you fine support.

I also had the same problems as @hawanam having to use web auth, manually entering subscriber_id, getting uri errors, I was scratching my head for a least 3-4, finally found this and upgrading to 2021.12 (I was on 2021.11) fixed everything.

Please, add a note at the top that Nest integration (instructions) requires 2021.12 as minimum.

@orientalsniper and @hawanam
Apologies this was confusing. Everything on is always for the current version of home assistant, and the core dev team won’t be maintaining docs for older versions. My impression is the core developers have gone through and removed all references to requiring specific versions in the past. I definitely don’t /want/ new users to be setting up nest for the old configuration flow given it is very painful.

@hawanam no work needed when upgrading, everything will keep working.

But overall, this drift between instructions and versions is bigger than most minor updates. Just to be fully transparent: I won’t be updating the documentation and just encourage everyone to update.

Hello Allen, thank you for the clarification.
now that I understand the development strategy for updating code and documentations, then I’ll make it a point to always update my HA to the latest release version before I attempt adding a new integration. I’m good with that.

btw, I updated my HA to the latest version, and my Nest integration is working well. Thank you.

1 Like

Hello, could you tell me what would be the generic URI configuration?
“https: // name_server: port / auth / external / callback”.
I can’t go on. It says, that I have selected at least one device. Thank you

Make sure to update to the latest home assistant version and check out this video for how to set everything up EASIER NEST INTEGRATION in Home Assistant! No More SSH or SSL validation! - YouTube

OK thank you. I will look at it.
HA version is 2021.12.7. I think it’s the last one.

I have done the new configuration, as in the video and I keep staying in the same step.
It keeps saying to select device, when I have already selected it.
Could it be google problem?

Hello, it’s already solved. the problem was the browser’s ublock origin and nominer extension. although I had already tried it before in other browsers that did not have the extensions. Thanks for the support.

I think this problem is back per the GitHub issue here.