[RELEASE] Google SDM API - Nest integration

Anybody knows of a good way of sending the camera image attribute as a notification on android?
I tried sending the image attribute as a string to a notification, then using tasker to intercept that notification and removing the "<img src=" and replacing with the hub IP to the beginning, then creating another notification based on that, but it was too hacky for my taste.
Ideally what I would like would be to generate a snapshot of the camera feed at the moment of the notification, but since I don't think the API enables that, I'm happy with the last captured image.
Thank you!

I’d be interested in this, unfortunately last I tried this html was stripped out due to security concerns.

Yes, this is what I ended up doing for the outdoor cameras. I am using presence and sound in the garage.

I do get the occasional "false motion alert" in the Nest app, and like you say, it's almost always due to headlights, or the sun ducking behind a cloud (or vice versa).
Either way, it's far far far less than the API apparently provides events for. Perhaps Nest is consuming those events, and then doing further analysis on them to determine whether to alert in-app. It's too bad those aren't the events we could subscribe to. :slight_smile:

Regardless, thanks again for this integration!

Is there a way to edit it if I used google.com instead of https://cloud.hubitat.com/oauth/stateredirect? I didn't notice that change in the github until I had my project created.

Never mind I see post 24 @tray_e said how to change it. Thanks.

1 Like

Thanks for this! Took me quite a bit of debugging and forum reading to get it working but worth it :grinning:

The app was able to discover my Nest Hub Max Display, but my Nest Thermostat isn't showing up. Thoughts?

It's a single call to discover all authorized devices in your account. Any errors in your logs after clicking the Discover button?

If not, I'd suggest clicking the Authorize link again, and double-check that all of your devices/types are selected to authorize access to the app

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: