Google-Nest Offical Device Access Console Finally Released!

I’m currently playing around with the APIs directly.

Device status works great.
I’ve been fighting with the RTSPS streams - nothing I’ve used (VLC on Windows, VLC on Ubuntu, mplayer, ffmpeg) can seem to play them.
Haven’t tried thermostat controls yet.

3 Likes

Woohoo! Badnest has been working fairly well for me but it’ll be nice to get a true integration! Hopefully people detection and such will be able to be used as a trigger.

I wish they could give access to Nest Guard at least for Individual access

Looks like people and motion detection should be available as triggers. Some nice option in there, all of which are being used by people with blue iris and the like already but now available to those of us who needed the “easy” button.

Great! Yeah, I had previously used zoneminder with some generic cameras but switching to nest definitely passed the wife test and is mostly just less frustrating. Except for the whole no API (until now) thing.

1 Like

Yeah, Nest protect is missing and also no way of setting the Home/Away status. I should have looked that up before giving them the $ 5.

1 Like

I reckon they’ll add it - at least I hope so. I paid the $5, at this point I’ve paid Google a lot of money over the years - what’s an extra 5 bucks gonna do, right?

My great wish though is for Nest Guard support - like proper support as well, not the crap they had under WWN. I want to be able to read the status of my alarm, as well as the individual sensors attached to it. Ideally, setting the alarm state too but I doubt they’ll allow that. I’d settle for a decent read-only view.

Haven’t seen the Nest Guard devices in the supported devices overview:

Supported devices:

  • Nest Thermostat
  • Nest Cam
  • Nest Hello
  • Nest Hub Max

I do see the “room” in the console view but thats read-only:
Device Access | Google Developers

1 Like

Same here. What’s 5 more bucks. LOL.

Since my old Nest integration is still working for now, I’ll be waiting for a new HA integration before I start mucking around with it. “If it ain’t broke, don’t fix it.” (Or something. LOL)

Well, yeah I sorta had that opinion - my Nest account was old and I held off doing the Google migration to keep my HA integration working. But TBH, without the doorbell chime events and no Nest Guard integration, I didn’t really need it to be integrated.

My thermostats basically just manage themselves now so I rarely need to actually control them, and the doorbell pushes info to me whenever I need it, so which app the notification launches is kinda irrelevant to me. Home/Away is also managed entirely within the Nest ecosystem (it would be more accurate if integrated, but it’s good enough for me).

So I took the plunge, migrated the account and now my Nest is basically an island, disconnected from all the other systems. It’s actually fine, I don’t really miss it. I will integrate it again once the updated HA component comes out, but really only for the chime event integration (and any future Nest Guard stuff :crossed_fingers:) I have some nice automation plans for those!

3 Likes

This is phenomenal, so many additional features available vs pre previous Nest API.

1 Like

Hi Folks,
Managed to put together some basic calls using node-red as the middle-ware to at least give me status on the thermostat - it is a bit fugly, but it’s working… I will say, trying to get the Oauth component setup was a pain in the rear - for folks trying to figure it out, here is where I would start - https://developers.google.com/nest/device-access/get-started

What the guide doesn’t tell you is that when you setup your Oauth creds, you need to make sure to include https://www.google.com as an authorized URI (screen shot below) - otherwise it doesn’t finish it’s setup when you go through the account authorization steps - this took me a while to figure out.

Once you get your auth code, you can follow the steps to get your access code and refresh code - it looks like the access codes expire after an hour - so my node-red flow is setup to use the refresh code to get the current access code, and then use the latest access code to query for the values, before setting the values for the Various entities. I am sure this could be more elegantly done - I am just happy to have it working for the moment - happy to hear other’s thoughts or feedback.

-Dan

P.S. The BB won’t let me post more than one image in a post, so will post the NR flow in a reply to this post.

3 Likes

NR Flow:

Any luck with this? Doesn’t look like anything supports RTSPS

Hi Dan,
Would you be so kind to share your flow with me?

Best regards
Christian

I recalling don’t get Google, Nothing works with GSuite. Hey Google it’s your product make it work :crazy_face:

So I assume this will only work if you’ve migrated your Nest account to a Google account?
Hope we get an updated HA integration soon. I hate how Google killed the old API before they had a replacement but I like how the new API has more functionality for things like the doorbell and cameras.

Similar approach:
Screenshot 2020-09-24 075736

An hourly flow refreshes the access_token and stores it as a flow variable, so that other flows don’t have to repeat or compete.

The creds function node has the following code:

let clientId = 'xxx';
let clientSecret = 'yyy';
let refreshToken = 'zzz';
msg.url = "https://www.googleapis.com/oauth2/v4/token";
msg.method = "POST";
msg.payload = {
    "client_id": clientId,
    "client_secret": clientSecret,
    "refresh_token": refreshToken,
    "grant_type": 'refresh_token'
};
return msg;

The token http request node has Method set to - set by msg.method -

To enumerate all devices, I use the following params function node

let projectId = 'nnn';
msg.url = "https://smartdevicemanagement.googleapis.com/v1/enterprises/" + projectId + "/devices"
msg.method = "GET";
msg.headers = {
    'Authorization': 'Bearer ' + flow.get('access_token'),
    'Content-Type': 'application/json'
};
return msg;

Change the output of the devices http node to return a parsed JSON object. You then have all the data at your disposal, e.g. to create HA sensors. Use a debug node to explore msg.payload.

The next step would be to respond to events, but for that I’d rather wait for the HA integration rather then roll a competing bus in node-red.

7 Likes

@pissten - Hi Christian,
I think @mbuscher’s technique is actually much more elegant - would advise using his method down below.

-Dan

1 Like

I’m having a hard time retrieving the access token and refresh token, using the command from google quick start guide.

curl -L -X POST 'https://www.googleapis.com/oauth2/v4/token?
client_id=oauth2-client-id&
client_secret=oauth2-client-secret&
code=authorization-code&
grant_type=authorization_code&
redirect_uri=https://www.google.com'

I have ofcourse entered my own Oauth2 credentials :slight_smile: But i get a error message from the curl command:

curl: (3) Illegal characters found in URL