Nest Authorization Error Error 400: invalid_request

Hi All, I’m trying the custom component version of this hack, and finding that my climate entities (but not the temperature and humidity entities) for my thermostats are missing. Any idea why??

UPDATE: following Shane’s comment below, I’ve updated the ghclone command to clone the master rather than dev branch. After this, the climate entities work once again.

Where what I did:

  1. Cloned the nest integration as a custom component
cd config/custom_components
pip install github-clone
ghclone https://github.com/home-assistant/core/tree/master/homeassistant/components/nest
  1. Then I edited the const.py file, AND added a version field to the manifest.json file. Without the latter edit, the custom component was not recognized. It’s not enough to copy the core integration, you MUST add a version field.

  2. Restarted HA and installed the new (overridden, custom) nest component.

  3. Copied out the code string from the resulting URL.

As a result, my temperature and humidity entities work, but my climate entities do not. So I can see the temperatures, but I can’t adjust the thermostat. :confused:

Any ideas what might be going on?

1 Like

Could you help me with the field in create subscription “create a cloud sub/pub topic”? It’s saying to take it from the device access page, but doesn’t make sense to me with the format it requires. The example links are dead. Thank you in advance.

Thank you so much finally got it to work with your instructions and some additional changes!!!

@JamesDeng Thank you for these detailed instructions. I was getting “404 invalid_request” errors authenticating with the Desktop App OAuth method, but your walk-through using the Web App allowed me to get the Nest integration working in Home Assistant.

I tried adding the version field. This actually got me closer than ever before to getting this integration to work, as now the URL has the “http://localhost:1” in it, however when I paste the code from the URL, it loads for much longer than before but still gives me the Unknown Error. Is there anything I could be doing wrong here? I’ll keep trying different things.

@danhiking I made an account just to post this.

I found myself in the same place you were, working connection through the localhost work-around, but only humidity and temperature entities viable, no climate entity.

After reading through some logs I noticed some odd error messages, of why the climate entity couldnt be setup, almost as if it was using the wrong file path to start it.

I believe this PR’s usage of EntityFeature enums combined with our usage of custom_components, causes problems. However that’s only my working theory

But I did get the climate working and can now control the temperature !!

I followed all your same steps in your post, however I cloned the “master” branch vs the “dev” branch that you cloned for the nest component.

Thought I would share for you and others ! Hopes this helps !

I was able to get this component installed fine. However, when I go to “configure” the resulting redirect page is still a google auth error page with a “Error 400: redirect_uri_mismatch”:

If you’re the app developer, make sure that these request details comply with Google policies.

* redirect_uri: http://localhost:1

The URL does not contain a code parameter either. Any ideas what I have done incorrectly here?

worked perfectly for me! Thank you very much!!! :+1:

Thanks Shane, your insight worked!

Do you think:

  1. the PR is eventually going to go in and cause a problem in master?
  2. this problem only arises in the custom_component?

In the meantime I’ll edit the post above in case it helps someone else.

Hi Travis,

That error looks correct, but do you see a bunch of query params after the localhost:1…? You’ll need to dissect the URI to find the ...&code=...&... argument. I don’t have a screenshot handy.

Unfortunately there is no ‘code’ param, that is my issue.

I only have the following 2 params:

authError=...,client_id=...

My old nest api method was working fine but figured now was a good time to migrate to the “new” method. What a stupid mistake that was… doesn’t look like these workarounds are working anymore either.

I don’t get the &code= part in my URL when changing the const.py file. I’ve tried configuring the web app method using the old instructions but the “Go to url here (unsafe)” link goes to https://accounts.google.com/# and gives me a Something went wrong. Please try again. message.

So now I have no nest integration and no way to go back to the older, working method

1 Like

Hello
Just trying to set up the nest integration and getting the Nest Authorization Error Error 400 :frowning:

Where is the issue?
Is it with Home Assistant or with Google?
It would seem to me that the Nest HA integration needs to be, not necessarily fixed but changed to work with Google’s changes… but I’m only guessing as I’m quite the noob :slight_smile:

And is the workaround not working? as per @ideasman69 is saying?
I’d rather not spend time trying to get the workaround working for it to be dead in the water!

Has anyone succeeded in the workaround? If not, then we might like to add a big WARNING in this thread to say the information is out of date.

Any confirmed successes recently?

I have to go back through my setup as I did actually get this working within the past few weeks in order to get my Nest Doorbell Battery added to HA.

I know that when I first had the problem I was trying to use the Desktop App OAuth method but changed to the Web App OAuth method and got it working.

I just wanted to say thanks to the members above, the workaround with “subscriber_id” and web auth worked for me.

which one in particular? I’ve tried everything I can find and am still having no luck

edit: after trying it once more - with all my edge extensions disabled (uBlock, decentraleyes, clearurls) - it worked as expected using the old instructions that @JamesDeng posted here.

I just wanted to chime in on this issue. I received this error.

The fix for me was very simple. No workarounds…

under oauth consent screen, put the app into testing

Go back to home assistant then go to devices, click on reconfigure under NEST and follow the prompts in the popup, similar to the initial setup, at the end youll get the new auth key, copy/paste. boom works again.

1 Like

Wow. Was not expecting that simple of a solution to work, but it worked for me as well. Sounds like this will still work through October, so hopefully they’ll have a final solution by then.

After you got the authorization code, did you put it back into production?