Keep getting "Can’t link to MYPROJECT" error setting up Nest integration

I recently set up the Nest integration and had it working fine. Later that day I wrecked my HA installation without taking a backup with it working, and only had an older backup, so I reinstalled and restored the backup.

When I’ve tried to redo the Nest integration, I always get a “Can’t link to MYPROJECT” error after entering the device access project ID when requested (during the Link Google Account section in this help file).

I’ve tried deleting my project and the device access project several times, but I keep getting the same failure. I’ve also tried clearing my cookies in case anything was lurking around from the first install. I also can’t find anything in the HA logs to give any clues.

I don’t know what else to do to get it working. I’ve seen in the help file it says that:

Can’t link to [Project Name]: Please contact [Project Name] if the issue persists: This typically means that the OAuth Client ID used is mismatched

However, it’s not clear what “mismatched” actually means, and as I say, I’ve run through the process several times, always with the same result, but no detail.

I’ve wondered if there was anything saved in my Google account linked to the original config, but I can’t think what.

Also, I don’t know if the My integration needs any config for the OAuth redirect to work successfully on https://my.home-assistant.io/redirect/oauth, but I don’t remember doing anything like that first time round.

Anyone got any ideas?

Having later seen this GitHub issue, I found that there are application credentials saved in HA, which you can get to from the three dots on the top right of the Integrations page. Those credentials were out of date, so I deleted them all.

Now when I go through the Nest setup, it does ask for a client secret (which it wasn’t doing before).

However, at the same point that it went wrong earlier, it still goes wrong, but in a different way.

It now gives an empty dialog box, and if I go back to the integrations page and click on Configure on the discovered Nest item, I now get “Something went wrong: Please contact the developer of this app”. The help doc says this is typically when you’re using the wrong type of credential, but I’m definitely using the “web application” type.

The only thing in the logs recently is this, which may well be unrelated, but it certainly doesn’t mention Nest:


 Logger: frontend.js.latest.202211080
Source: components/system_log/__init__.py:256
First occurred: 8:25:37 PM (7 occurrences)
Last logged: 9:58:38 PM
:0:0 ResizeObserver loop completed with undelivered notifications

Any ideas how to get through this please?

3 Likes

The most common reason for something like this is a misconfiguration e.g. client id is not correct between device access console and google cloud console, or being signed into multiple accounts and using different accounts in each console. Yes, ResizeObserver error is not related.

Thanks @allenporter

I’m definitely only logged in to one Google account, and I’ve gone through the same process multiple times, always getting the same error (whereas the first time I did it, I set it up with no issues).

Is there anywhere that config could be stored that’s not being regenerated (in the same way that the application credentials were stored from the first run through, and were therefore outdated from when I’d recreated the project in Google Cloud)? I’ve checked config files, and have deleted cookies too. I don’t think I’m getting the process wrong each time.

And is there any way to figure out what should have been displayed in the empty dialog box? Or anything else I can do to try and diagnose it?

Thanks

Is there anywhere that config could be stored that’s not being regenerated (in the same way that the application credentials were stored from the first run through, and were therefore outdated from when I’d recreated the project in Google Cloud)? I’ve checked config files, and have deleted cookies too. I don’t think I’m getting the process wrong each time.

To elaborate on what I mean by “client id is not correct between device access console and google cloud console.” see the instructions under Google Nest - Home Assistant under “Resolving mismatched OAuth Client ID”. In particular, if you handled application credentials also double check the device access console. There is no other configuration storage.

Basically, it sounds like you resolved part of the troubleshooting steps described in the integration docs, but not all of them.

I’m sorry @allenporter - the 'Resolving mismatched OAuth Client ID" looked like a heading bar to me for the bullet point afterwards. I only just realised after looking at it a few times that it was something to click on to expand - now I can see what you were referring to, so that gives me some more to go at.

I’ll have a go again.

Cheers!

When I tried just deleting the application credentials in HA then re-adding the details, it failed with the empty dialog issue.

However, since deleting all the Google bits (device access and cloud project) as well as deleting the application credentials, then recreating everything again, it’s now worked.

Thanks for your help @allenporter

1 Like

I cannot tell you how helpful this was. I’ve been beating my head against the wall for a couple of hours now trying to get this to work. I’ve deleted and recreated my project multiple times. It turns out that I had old credentials stored.

2 Likes

This should be added to the Nest Integration doc page! Thank you!

3 Likes

You’re a hero!!

I’ve made an account on here just to say thank you!!

Created an account just to favourite this comment and thank you.

“Deleting all the Google bits” a.k.a. starting over, was indeed the solution.

likewise, just created a ‘thank you’ account.

after copious headbanging.

those hidden existing Google creds in the top right of the Integrations page have a lot to answer for :slight_smile:

This solution worked for me as well! I had a cached credential that was incorrect.