[RELEASE] Google SDM API - Nest integration

I just wanted to confirm if this is the only way to integrate Nest products into Hubitat?

I haven't migrated my Nest account over to Google yet, so is there an alternate/free option I have?

Or is this the only route going forward (including paying the non-refundable $5 fee)?

At the moment (and I stress at the moment) this is the only way to integrate with Nest unless you already had it integrated before they killed off the works with nest program.

Unfortunately we are at the mercy of Google here. We don’t know what the future holds, or if they will even continue to support this api down the road. I personally have held off buying any new nest products until I saw the new API have parity with the old api. Unfortunately, this version is lacking in a few different ways (ex: no support for nest protect). Paying the $5 is a gamble, but it’s a one time fee so no big loss down the road.

1 Like

I just wanted to confirm if I have functionality as is expected.

For my Nest thermostat, if I change the temperature, I don't see it updated right away on the Hubitat's thermostat device page. I have to click the Refresh button and then I see the updated temperature.

For my Nest Doorbell, it doesn't seem to be updating anything whatsoever. All I see is this:
image
And nothing I've tried has gotten anything to change (e.g. waving my hand in front of the camera/doorbell, making sounds, and even pressing the doorbell).

Sounds like there is a problem with your event subscription (created for Google to forward events to HE) -- can you check your logs to see if there was an error around the time of Authorization?

These are all the logs from today since I installed it.
image

The second 403 happened when I tried clicking the Subscribe to Events button in the debug buttons.

Ok -- the 403 error indicates we have a "permissions" issue when trying to create the subscription. Could be several factors, from enabling the pub/sub topic on your Device Access project, to enabling the pub/sub API on your Google Cloud project (they can't make this easy) -- I'd suggest checking those items first. You're certainly not the first to run into this, there are multiple posts about it in this feed -- I'll try to scroll back and dig up some links

I think my pub/sub topic is enabled just fine on the Device Access Project:

But I'm not sure about my GCP. When I enabled it there it just took me to a dashboard looking page but I don't see any sort of Hubitat project here. All I see are some projects that I think I did in college. :sweat_smile:

Otherwise the GCP portion seems "enabled". I'm not sure if that's enough.
image

Hmm - see which one (if any) has matching OAuth client-id?

If that doesn't yield anything useful, check this post, which links to Google's steps for creating a manual "pull" subscription: [Beta] Google SDM API - Nest integration

Oh hm, good call. The API Project has the OAuth that was created today. I assume this isn't correct, right? Was I supposed to create a new project and then associate it? I don't remember which step I did that did this.

I don't think you necessarily have to have a unique GCP project - I only have one project, for this integration... But I think APIs are enabled on a per-project basis. Maybe you enabled pub/sub api on the other GCP entry?

From the pub/sub api page, click "Manage", and make sure the "API Project" is selected in the drop-down near the top

"API Project" was appearing in the drop down near the top. However the pub/sub api was not enabled on it. So I enabled it and resubscribed, got no errors, and then tested the cam and saw motion logged in the logs!

Thanks for the support as well as the great repo!

One more question, for the image that's logged does it store a history of them or just the last one that was captured? If the former, where do you access the history?

1 Like

Legitimately, just the latest capture. Technically previous captures could be rebuilt from the device event history, specifically the rawImg attribute - which is a base64-encoded string representing the jpeg image bytes. If image history is a goal, I'd recommend some other unit which polls your Hubitat to download and archive the images -- of course if more folks are interested in offline archiving, I could look into a configurable "push" target...

1 Like

The functionality as is seems fine to me. I don't see myself personally using the still images. The video feed from the Nest app is probably more useful. I was mainly actually worried about it storing too many images and then the Hubitat running out of storage. :laughing:

If you aren't using the still images at all, there are toggles on the Device pages where you can disable image downloads for any/all event triggers... If you want to download just in case, you may want to tweak some combination of image size (on the App page) and event history (on the Device page, default 100) to avoid over-bloating your hub db size

1 Like

Do you know if it's possible for this integration to get the Nest Temperature sensor data? And also choose which sensor to use? I have 2 sensors + the thermostat itself

Or is that not made available by Google (I wouldn't be surprised :weary:)?

I'm hoping it is possible because the Nest app does not provide much customization to the schedule you can set up for when to switch to using a certain sensor.

1 Like

Nothing obvious in the API for this - I don't have any additional temp sensors myself. This post mentions the relationship in sensors and the displayed/reported api temp.

1 Like

We're all hoping and waiting for Google to provide enhancements and additional support (such as Protect smoke/CO units) in the future!

1 Like

Set the events to 1 on the camera device page and it doesn't take up much room. Just saves the last image.

image

I find it useful for seeing what the camera last saw at a glance page.

There a way to get the live camera feeds to dashboards with this?

I've been playing with that -- I can get the stream url and keep it active, but don't think any of Hubitat's native dashboard templates can play the stream. I have a couple wall-mounted tablets running Fully Kiosk - which claims to be able to play rtsp streams, but no luck with that either, using a simple manually-configured Link tile. Only program I have used successfully to this point to play the stream is ffplay...

Will probably publish the code so far soon, just providing an attribute with the stream url. If anyone has suggestions on how to play the stream, I'm all ears -- think there will have to be a secondary program on a separate system, like ffserver, to transcode for HE dashboard to play