Google Nest Device Access Console now available

Thanks @dschoepel.
I created a new Service Account and added a JSON key.
Just not sure how to download the JSON key file format. There’s no option for it in the GCP menus.

UPDATE: Please disregard. I found the file.

It’s working now. Thanks @dschoepel!!!

1 Like

Wondering if anyone knows anything about this message I got from Google a few days ago regarding my Google Cloud Platform free account expiring… seems like it was a 3 month trial and now they want me to upgrade:

Clicking on that link takes me here…

… and those links take you here to discuss what is included in the “free tier” and here to discus pricing.

Apparently when you create the free account you get $300 in free credits and also access to “20+ free products”, though I cannot confirm that the Smart Device Management API is one of them. I am wondering if anyone has experience with this. I am sure I will lose access if I let the trial expire without upgrading. If anyone has upgraded after their trial expired, did using the Smart Device Management API result in any actual charges or deductions from the $300 in free credit that came with the account? Thanks in advance :+1:

Marcus,

I and most folks likely took a different route on this one. I have not signed up for the google cloud platform services (trial or otherwise). What I did was spend $5 USD for Device Access Registration. Here is an excerpt from that site…

Before creating your first project, you must register for Device Access. Registration consists of the acceptance of the Google API and Device Access Sandbox Terms of Service, along with a one-time, non-refundable fee (US$5) per account.

You will not be able to create a project until you have accepted both Terms of Service and paid the registration fee. This applies to all users, both individual users and those looking to create a commercial offering.

Perhaps you had done this and also signed up for their Cloud trial. I don’t think the two are related. You should be able to use the Device Access program without having the Google Cloud Services.

Interesting… thanks for the response. I also paid the $5 fee to register for Device Access, so I guess in addition to that i must have activated Google Cloud Services :thinking:

1 Like

Hello everyone! I’ve finished my work on the PR that adds SDM support to the Nest Binding and marked it as ready for review. :slightly_smiling_face:

If you want to help with testing/reviewing, here are some links to JARs:

There’s also an updated README.md which documents how everything should be configured.

6 Likes

Thx Wouter!! I think a lot of people were waiting for this. I will give it a try.

Do I read correctly that I need the 3.0 version when I am on the current (M4) 3.1 Milestone Build?

1 Like

Yes that is correct! The Units of Measurements library was updated so all recently compiled add-on snapshot builds cannot be used with 3.1.0.M4. Luckily there will be a 3.1.0.M5 soon. :slight_smile:

So use the “org.openhab.binding.nest-3.0.3.20210530.jar” with OH 3.0.0, 3.0.1, 3.0.2, 3.1.0.M1, 3.1.0.M2, 3.1.0.M3, 3.1.0.M4.

If you are using a recent 3.1.0 snapshot build or the forthcoming 3.1.0.M5, use “org.openhab.binding.nest-3.1.0.20210530.jar”

3 Likes

There’s now also a JAR with all changes backported to 2.5.x (for those who still like to use a retro OH version). :slight_smile:

Thank-you @wborn for all your hard work on this! I have the 3.1.0 jar file installed and my cameras are online. I noticed there is no detect channel type (ie. person_event#detect). Was that intentional? How does OpenHAB get alerted as to when motion/person/sound is detected? Thanks — Randy

Awesome News Wouter! Many thanks for keeping after this one. Two Thumbs up for sure!!!

Looking at the instructions, I don’t see any way to specify the service account information (i.e. authentication needed to get events sent to the nest devices from pub-sub). In the original version from @BHigg there was a service account path parameter that was used to point the binding to the .json file that held the service account details. This was typically placed in the config/services folder.

Is this no longer needed or still on the radar to get implemented?

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.