Google-Nest Offical Device Access Console Finally Released!

Hi,

Fairly new to Home Assistant, however im having a lot of trouble with this installation, I am getting sent on a wild goose chase for the subscriber_id when I look at the logs, the file google is apparently looking for is never correct:

Error Codes:

Configuration error: Subscription misconfigured. Expected topic name to match ‘projects/sdm-[a-z]+/topics/.*’ but was 'projects/XXXXXXXX/topics/XXXXX’.

1:26:55 AM – Nest (ERROR)

Configuration error: Subscription misconfigured. Expected subscriber_id to match ‘projects/./subscriptions/.’ but was 'projects/sdm-prod/topics/enterprise-XXXXXXXXXXXXXXXXXXXXXXX

1:30:06 AM – Nest (ERROR)

Configuration error: Subscription misconfigured. Expected subscriber_id to match ‘projects/./subscriptions/.’ but was 'projects/XXXXXXXX/topics/XXXX’

1:34:28 AM – Nest (ERROR)

Configuration error: Subscription misconfigured. Expected topic name to match ‘projects/sdm-[a-z]+/topics/.*’ but was 'projects/XXXXXX/topics/XXXX’XX.

1:36:35 AM – Nest (ERROR)

Pretty sure I’ve tried every combination, can anyone help?

FYI, I have used:

projects/XXXX/subscriptions/XXXXX

in the .yaml file and after restarting I still get the error report quoting

projects/XXXXXX/topics/XXXX

FYI, try and use backquotes around your code so it appears as ‘code’. The </> button on the bar will add single quotes around inline words/phrases/sentences or triple quotes around a block of text, or your can just type them. The triple quotes need to be on a line before the block by themselves and on a line by themselves after the block to end the ‘code’…

Inline code: Configuration error: Subscription misconfigured. Expected topic name to match 'projects/sdm-[a-z]+/topics/.*' but was 'projects/XXXXXXXX/topics/XXXXX' …and then the sentence can continue.

Block code:

1:34:28 AM – Nest (ERROR)

Configuration error: Subscription misconfigured. Expected topic name to match 'projects/sdm-[a-z]+/topics/.*' but was 'projects/XXXXXX/topics/XXXXX.

:slightly_smiling_face:

Hey All,

What do we mean when under the OAuth Error 400: redirect_uri_mismatch when it says, “[… it] must use a publicly known hostname, though your Home Assistant ports do not need to be exposed to the internet”? Below that it says something about using a hosts file to temporarily assign a public hostname…

Using port forwarding on my firewall, I have it working. When I close that external port, it stops working after a few days. Delete the integration, open the port, add it again, close the port, its good until it stops, rinse and repeat. I’ve obviously misunderstood something here!

If I don’t want to expose my whole HA to the Internet, can I just somehow make my external “public hostname” accessible from inside my network (i.e., block external traffic to that port through the firewall) and have it continue working non-stop?

Correct you don’t need to expose anything., As you’ve said.

The part where it stops working: is that due to needing reauthorization? See discussions atelier in the thread about the oauth consent screen and making sure it’s not set to Testing.

Thanks for the hint on the testing. With over 1200 posts in this thread it’s hard to get through everything.

I see that in testing mode the token only lasts for a week. So, if I simply change it to production mode, the expectation is that I can disable my external access forever (once its properly setup in the first place)? Am I understanding that correctly?

Thank you!

Your config should loom like this, if it doesn’t it is wrong:

nest:
  client_id: alphanumeric.apps.googleusercontent.com
  client_secret: alphanumeric
  project_id: a2c4e6a2-a2c4-a2c4-a9c6-a2c4e6a2c4e6
  subscriber_id: projects/alphanumeric/subscriptions/alphanumeric

To be honest, the best thing to do is start at the beginning of the instructions and make sure you have followed them exactly. I’ve followed this forum since near the start, and almost everyone who has had a problem resolved it my ensuring they have followed the instructions.

From what I can see you have two types of error there. One to do with topic and one to do with subscription. The subscription id is stored in your config.yaml, but I’m pretty sure (from memory) that topic is entered against the subscription on the google console somewhere. So if you have put something with topic in it in your config.yaml, then you’ve entered it in the wrong place.

I would suspect that when you get the topic error, you have the subscription id right, and when it reaches across to google, it is telling you that you have the topic configured wrong there. I’m sure Allen can confirm if that is right or wrong.

You’re good to go! You don’t need to expose anything on the internet at all (unless that is the only way your browser can access your public dns name because you don’t have hairpin nat or something)

Yep, exactly right. This is spelled out in detail in the instructions and it’s subtle and easy to get wrong. Likely they have a separate cloud pubsub topic configured instead of the sdm topic.

I have a two instances of HA running on my network (on two separate port). One is a production and the other is my test system.

Prod: https://external_ip:8123
Test : https://external_ip:8124

They both need to be able to interact with my Nest gen 3 thermostat.

On the test system I followed this process with was able to get it working as I could see the climate sensors and adjust the temp.

Now I want to get the prod system setup to use / control the same thermostat.

When setting up the test system I set the callback to:

https://external_ip:8124/auth/external/callback

Now I am curious if I can just reuse the entire setup on Google and just edit the callback to the prod system??:

https://external_ip:8123/auth/external/callback

Or would I have to go through the entire setup process twice to have different client_id, client_secret, project_id and subscriber_id??

Hi Rog,

I took your advice and found my error, which was this:

The Topic name should match the topic name in your project in the Device Access Console and typically looks like projects/sdm-prod/topics/EXAMPLE . The SDM topic names do not show up by default so make sure to Enter topic manually .

I’d created different topic names.

Don’t suppose that’s a Lembeh Cuttlefish in your avatar? I lived there for close to 15 years pre pandemic.

I have my system set up this way with a single credential but a prod and test auth callback urls in the allow list configured in the consent screen. It all works fine.

@allenporter

I see, so in the callback url field you have something like this?

https://external_ip:8123/auth/external/callback
https://external_ip:8124/auth/external/callback

Also is your HA instance(s) always available externally or did you just open up for authentication and then removed external access?

Close, but not quite. It is a Komodo cuttlefish, from an absolutely amazing trip in 2019. We are booked for Lembeh later this year, not sure it will happen though. Staying at Dive into Lembeh. Stayed a KBR twice before, brilliant diving.

I have it open for other reasons: using the companion apps, webhooks from smarts things, etc.

Definitely don’t need to externally for Nest integration at all. You just need a public domain name, but it doesn’t have to be open to access from the internet.

Do I need to be concerned about this?

" In Production:

Once you set your app status as ‘In production,’ your app will be available to anyone with a Google Account. Depending on how you configure your OAuth screen, you may have to submit your app for verification"

I’m not concerned as I believe no one can access without your OAuth secret…

For some reason, the integration now only sees one of my two Nest thermostats. When I get to the authorization screen, it shows me both of them and they’re both set to be allowed for the application, but Home Assistant only sees one of the two.

Where did you add this? I’ve put it in a couple places, and the check config function always come back with an error.

Hi, check out discussion for workarounds for this bug on the Google side https://github.com/home-assistant/core/issues/46412 that make it appear again. For me, restarting the thermostat did the trick, and for others changing something in the nest / home app makes it work.

Those three lines of code I stuck in my configuration.yaml file.

xxx.mydomain.com is the URL I access homeassistant from the internet and 192.168.x.x is the IP I use to access it from within my network.

I honestly don’t remember why, but remember seeing that in some documentation. I’ll see if I can dig it up.