Google Smart Device Management API (for Nest devices)

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
Mintgroen
Posts: 3
Joined: Tuesday 27 October 2020 21:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Google Smart Device Management API (for Nest devices)

Post by Mintgroen »

Since Google took over Nest and killed the Nest API if you (without reading) migrated your Nest account to a Google account. A new API is opened up by Google, for a mere $5.

https://developers.google.com/nest/device-access

https://developers.google.com/nest/device-access/api

Nice intro:

https://www.youtube.com/watch?v=4Rkzf9g ... e=emb_logo

I managed to walk thru the registering without much hassle and have a working API now. I can Get the devices, the device statusses and even do a manual post from the cmd line. But...

If the GET/POST strings were static, I can get my data and control without much hassle... but the google Smart Device Management API access token has a life of 3599 seconds. So you need to refresh the token every hour and then GET/POST, adding some complexity to a script.

Does someone have a script handling the refreshing of the token and GET/POST info from/to the Nest devices handy?

I think it would it be a nice suggestion to add to the Domotics Devices.
Mintgroen
Posts: 3
Joined: Tuesday 27 October 2020 21:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Google Smart Device Management API (for Nest devices)

Post by Mintgroen »

I got a message that there was a new reply, bummer it was spam. :ugeek:

I've not been patient so I've found a solution to my need for the API connection. I have found it in Node RED, did some tinkering in the past days and the API is up and running. relaying info back to Domoticz via MQTT.

The NODE red flows I've created based on a post on the Home Assistant forum:
Screen Shot 2020-11-09 at 08.56.17.png
Screen Shot 2020-11-09 at 08.56.17.png (107.49 KiB) Viewed 1485 times
I already ran thru the Guide on the Google device-access API to obtain the projectid, token and refresh token.

The top flow runs every 3500 seconds, that is the refesh of the token and et as a context data (within the flow in this case).

The the 2nd flow gets the data from the API with the token so you can copy/paste the json objects.

The 3rd flow runs every minute, gets the data from the SDM API injects/transforms that data and forwards the thermostat temp/humidity data to my MQQT broker to update the Domoticz devices.

The Catch flow is to send a telegram message to my phone, I want to be notified in case the API does not work.
bobMuk
Posts: 6
Joined: Saturday 19 November 2016 16:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Google Smart Device Management API (for Nest devices)

Post by bobMuk »

I got as far as registering and paying the $5 the day they announced the API - but haven't had time to go any further!

Are you willing to post your scripts and any useful info for getting setup with the API?
Mintgroen
Posts: 3
Joined: Tuesday 27 October 2020 21:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Google Smart Device Management API (for Nest devices)

Post by Mintgroen »

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest