Google Nest Device Access Console now available

Yes it was intentionally removed because it was derived information that duplicates the information you’d get by monitoring if an event timestamp changes.

It’s no longer needed now you can configure Pub/Sub using an authorization code.

2 Likes

Great news, thanks again Wouter for the quick answer and the effort to get this out there. I have 2 thermostats and 5 Nest/Drop cams, will be happy to test them out…

1 Like

One of the improvements is that you can configure the image width (or height) on the image channels so you get a nicer picture if you increase it. :slight_smile:

Internally the SDM binding implementation now uses the openHAB OAuth2 client for both SDM and Pub/Sub which simplifies all the OAuth2 code in the binding. That’s also why both now use authorization codes. These are also easier to manage compared to files.

You may also notice that the binding size has been reduced significantly because it no longer packages any dependency.

4 Likes

Thanks for the awesome work. I have gone through the whole google auth mumbo jumbo, then installed your binding and retrieved a new authorization code with the refresh tooken.
However, when I try to save the thing config, it gives me and invalid_grant saying the ath token is malformed:

2021-05-31 09:35:42.182 [ERROR] [oauth2client.internal.OAuthConnector] - grant type authorization_code to URL https://accounts.google.com/o/oauth2/token failed with error code invalid_grant, description Malformed auth code.

Now probably this is due to my failure of following instructions - but does anybody have a hint on where to look at?

Edit:
I think I got the tokens through (re-pasted all the stuff and it worked) - but now I’m stuck with the following thing state:

Status: 
OFFLINE
COMMUNICATION_ERROR
Exception in oauth communication, grant type authorization_code: org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header

I’m on OH3.1 M4 (using the 3.0.3 binding jar) - the device list reqeust with curl works fine and gives me a json of all my devices…

EDIT2: OK please forget this post - I have used dschoepels step by step guide, but now used your new guide and it works like a charm: openhab-addons/bundles/org.openhab.binding.nest at nest-sdm-api · wborn/openhab-addons · GitHub

Thank you so much,

Bob

Thank-you @wborn for the quick response!

Many thanks @wborn, I can confirm it is working great for my Nest learning thermostat. Meanwhile as M5 is released I moved on to the 3.1 version.

I struggled for a while obtaining the authorisation codes where I consistently got the error “No partner connections found”. In the end I suspect that my anti tracking settings (router / browser?) were causing this as exactly the same links worked outside of my home today…

Even though the whole Nest to Google story is gracefully resolved (save the Nest Protect) by the hard work of @BHigg and @wborn for me it is a clear reminder that this is the last cloud-based home automation product I will ever purchase. It is disappointing how Google crippled a great product after they bought Nest.

1 Like

@mvbergen I cannot get past the step to obtain the authorization code. I seem to be having the same problem you were having; “No Partner Connections Found” right after I hit the Next button on the device selection screen. Tried this outside my network and still getting same problem. Any additional hints you can give to why this was happening to you?? Not finding much searching Google for this specific problem. I have tried deleting everything and starting from scratch but no luck there… Perhaps there is some limit I have hit with the SDM system and its just not telling me that…

Does your SDM Authorization Code URL also have the &response_type=code part in it? It was initially missing in the docs but it was later corrected.

So the full URL to get a SDM Authorization Code should be:

https://nestservices.google.com/partnerconnections/{{ProjectID}}/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&access_type=offline&prompt=consent&client_id={{ClientID}}&response_type=code&scope=https://www.googleapis.com/auth/sdm.service

Where you replace {{ProjectID}} and {{ClientID}} with the right values.

2 Likes

@wborn suggestion fixed the exact same problem for me.

That was the problem, this request worked perfectly now that I am doing it right.
Thanks so much for the quick response and keeping me from banging my head against the wall today!

2 Likes

Hi,

this looks really promissing - I tried to follow the steps in the readme. I struggle with the auth code where I get an google page saying “an error occurred” without any further information. Somebody with the same problem - or even better - a solution? Thanks
MM

Almost no one is going to run into this problem but I thought I’d post here just in case anyone is in the same boat as me. Apparently my migration from the Nest account to Google account got bungled. As far as Nest is concerned I’m using my Google account. As far as Google Home is concerned I’ve no Nest devices.

If you are in the same situation, the Device Access Console won’t work. When you attempt to get to the auth token it will tell you that there are no Nest devices to access and it won’t give you one without at least one Nest device.

I have been working with Google tech support. I even got phone calls from a real person. But my situation remains unresolved. I’m reaching a point where I’ll either have to create a whole new Google account just for my Nest devices or transfer everything to my wife’s account. But that’s going to be a ton of work so it’ll have to wait until I really need to.

Following up I have my 2 thermostats and 5 nest cams connected.

My system is an OH 3.0.2 Release running on:
Raspbian GNU/Linux 10 (buster),
Kernel = Linux 5.10.17-v7l+,
Platform = Raspberry Pi 4 Model B Rev 1.2

I am seeing the following error every 30 minutes in the log. Since there is no reference to the nest binding, not sure this is related or a problem with OH core. The only binding I have running on this system is the Nest SDM binding.

I am also seeing my thermostats go offline and back on line about every 3-15 minutes, and pub/sub communication errors (Failed to send JSON POST request: Total timeout 60000 ms elapsed) causing the bridge to go offline.

18:19:34.265 [ERROR] [org.jupnp.transport.spi.StreamClient ] - Request: HttpRequest[GET HTTP/1.1]@29533c failed
java.lang.NullPointerException: Missing SslContextFactory
at java.util.Objects.requireNonNull(Objects.java:246) ~[?:?]
at org.eclipse.jetty.io.ssl.SslClientConnectionFactory.(SslClientConnectionFactory.java:54) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.HttpClient.newSslClientConnectionFactory(HttpClient.java:1175) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.HttpDestination.newSslClientConnectionFactory(HttpDestination.java:137) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.HttpDestination.(HttpDestination.java:94) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.PoolingHttpDestination.(PoolingHttpDestination.java:25) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.(HttpDestinationOverHTTP.java:32) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.http.HttpClientTransportOverHTTP.newHttpDestination(HttpClientTransportOverHTTP.java:51) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.HttpClient.destinationFor(HttpClient.java:546) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.HttpClient.send(HttpClient.java:579) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:728) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:681) ~[bundleFile:9.4.20.v20190813]
at org.jupnp.transport.impl.jetty.JettyStreamClientImpl$1.call(JettyStreamClientImpl.java:155) [bundleFile:?]
at org.jupnp.transport.impl.jetty.JettyStreamClientImpl$1.call(JettyStreamClientImpl.java:1) [bundleFile:?]
at org.jupnp.transport.spi.AbstractStreamClient$RequestWrapper.call(AbstractStreamClient.java:204) [bundleFile:?]
at org.jupnp.transport.spi.AbstractStreamClient$RequestWrapper.call(AbstractStreamClient.java:1) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]

Working really well on OH3.0.1 in Docker, thank you very much for this!

My apartment complex fitted Nests to every apartment because of the ‘Cool to Dry’ function, and being able to control it from OH is great.

I really do wish manufacturers would bake in local comms for ‘Smart’ devices, so the cloud stuff wasn’t necessary, but my internet connection here is decent, so it shouldn’t be an issue. I really like the Shelly devices for this exact reason - MQTT baked right in.

NB: The only step I had to do in addition to those listed was a restart of OH3, after the Pub/Sub setup was done. After that, a scan of the Nest binding found my thermostat (it didn’t find it before the restart).

Thank you for these updates @wborn. One question…

I built the changes in your repo myself and have been using them over the past month or so without issue. However today when I looked in my Google Cloud account, I noticed the google.pubsub.v1.Subscriber.ModifyAckDeadline Pub/Sub method received over 3.6 million requests in the past 30 days.

Is this behavior expected? The forecasted cost on my Google Cloud account is up 42k% over the previous month as a result.

I had horrible issues with google as well. However, I was already migrated and shortly after getting the Device Access Console working, my devices all disappeared from my Google/Nest account. Google support wasn’t very helpful. The only action they could provide was to factory reset a dozen or so Nest devices and including them in my google account again. I wasn’t pleased because I had another Nest “Structure” (vacation home) and I could not monitor my thermostat during the winter. I also wasn’t supposed to travel during covid restrictions so I had no way off resetting the device in a timely manner. The Nest devices are great when everything is working, but I hate the reliance on cloud.

I’ve actually had several calls with a real person and had my issue kicked up to the developers. But it’s been long enough now that I think the answer is going to be “can’t reproduce, won’t fix.”

I think the key was I provided all the information I could think of when I started the forum thread and I was meticulous in following the instructions the forum support person asked my to do even though I knew they wouldn’t work because I had already done them. Doing that I was able to convince them that something was wrong.

From there I got a call and did all that was asked of me and we were able to discover that my Nest structure was somehow still around in the Nest App but Google Home was completely unaware of that structure. And it seems that as long as that structure is there Google Home can’t see any of my Nest devices.

I’m probably going to move the devices over to my wife’s account. I don’t have a strong need for Nest support in OH really, but it’d be great if I could see the feed on my Hubs when the doorbell rings again.

Hey! The PR with the SDM changes got merged recently. :slight_smile: So you can use the SDM API by just installing the Nest Binding in recent 3.1 snapshots (build 2431 or newer).

4 Likes

Great news, just installed on a RPI 4 running 3.1.0-SNAPSHOT and all 5 cameras and 2 thermostats are online and sending updates…

Is there a way to display the camera live stream in OH? I have no issue doing this outside of OH using ffplay, but I can’t for the life of me figure out if there is a way to do that in OH 3? Is it just so obvious that I am missing something? No amount of digging around the Community or the web has given me an approach that works…

I think so far there is no way to get the camera live stream directly - Maybe via the IP camera binding and the rtsps stream? But I think you’d have to update the thing configuration as the rtsps link keeps changing.
I run a tflite model on my camera snapshots and I use ffmpeg to grab a snapshot and then copy it to the html(static) folder after the inference.