[RELEASE] Google SDM API - Nest integration

Check your Device Access Project to ensure that the Event Pub/Sub topic is enabled on that side, usually the 404 here is a "topic not found"

Yes, it is enabled (and has been). Have tried disabling and reenabling it, also.

OK. I think I got it working, although not terribly sure how or what I did wrong to begin with.

I created a new set of OAuth credentials in Google Cloud, then pasted the same OAuth client id into DAP. I then deleted the application from my hubitat, and reinstalled it. Now, the subscription seems to be working. Again, no idea why this worked - I put it down to my own human error.

I have a client id and a client secret. I also have the JSON file. In the Hubitat Setup of the "Google SDM API" it asks for the "Google Device Access - Project ID". I entered what I thought was right but I am not sure where to check that on the google console. I pasted in the JSON contents to the "Google credentials json" field in the app. I clicked DONE. I came back into the app and I click the "Auth Link" and it immediately goes here.


I'm guessing either it is done or that's bad. Any suggestions?

"Google Device Access - Project ID" is a UUID (32-character hexadecimal, format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx), whereas the GCP project id includes a text string.

This page indicates that OAuth did not complete successfully -- you should get a Google page to enter your login credentials and confirm that you want to authorize access to your devices.

Make sure your OAuth config on the GCP side includes https://cloud.hubitat.com/oauth/stateredirect as a valid redirect URL

Hmmm....I have correct redirect URL. On the Google Page it let me create an alphanumeric Project name. The UUID Project ID you mention I am not seeing anywhere on the google console.

If you go to the Device Access Console -- this should show you the UUID project ID that is needed.

So, I found the project id finally. I deleted the old JSON and started over. I got a new JSON but now I don't have any new project and the old project is not matching up.

Ok -- so you found the Device Access project id (UUID) -- check.
New credentials.json (copied to Hubitat) -- check.
Go back to the Device Access Console and click into that project, and edit the OAuth client ID to match what is specified in the new JSON

The "Device Access Console" above is giving me an option to create another new Project. I have three so far. By the way, thanks for your help. I am very techie, but I just don't see how to do this.

I can get the JSON created and downloaded. How do I find the Project ID that matches that JSON without creating yet another project where I can create another JSON and then can't find the project ID again.

Yep, seems Google made this overly complicated...

It is two projects on the Google side -- Device Access and Google Cloud -- each with their own project-id (one UUID, one alphanumeric) -- it is the OAuth client ID (within the credentials.json from GCP) that ties the two together for our purposes -- instead of creating a new project, click into one of your existing projects, and edit this value to match what you most recently got from GCP.

If you want, you can DM me details from both sides and I can help identify which pieces need to go where.

I am this page.


My project is named Hubitat-VMSMAN. It has a 0Auth client ID. Somewhere I got a JSON. I think from this. Not sure. It might have been one of the other attempts. So, I run my own Jitsi server. Any chance you can guide me through this on https://jitsi.scottibyte.com/Help

Any thoughts on monitoring Nest Protect? Is any Protect data exposed in the API?

My Nest Camera is detected and a device was created for it in HE. It never shows present. The Nest App can see an image on the camera though. I have pressed the initialize and the refresh buttons and no luck yet.


I am not a Nest Aware subscriber. Is that necessary to access the camera from the API?

It will only show present for 15 seconds after last motion is present. I believe you have to have it set up to detect (notify) on motion in the actual NEST or google app. I do not think you have to have a subscription for notifications. I believe you only need that for more storage of events, zones, and face (person) detection. I may be wrong on that. But, I have the subscription and it only shows present on mine for the notifications on person. (Because I have motion detection off in my app and use person detection for less fake/spammy alerts)

If you are getting notifications from the Nest app or Google and it is still not showing present then HE app may not be set up correctly.

Protect data/control not exposed yet -- it is at the top of my list if/when Google adds it.

As to your camera events, as @tray_e mentioned, the Presence/Motion/Sound runs an internal timer and reverts to the corresponding "idle" state -- each of these timeouts is configurable per-device, via the Preferences. No Nest Aware subscription necessary (that I'm aware of) -- but it does rely on a successful event subscription between the Hubitat App and Google, which is handled under the hood (but might have failed -- check your past logs from when we finally completed the Auth).

Best way to test it is to enable Debug Logs in the App and Device preferences, then go walk past it, wave at it, etc. You should get App logs for the events from Google, as well as Device logs for "Motion active", "Motion inactive", etc

These are the nest settings I am talking about. I only get presence detected on the items that are checked. This is in the nest app or website (I don't know if the settings are available via the Google Home app)

Details

Tray, What do you actually do to access an image? I am used to creating an image tile in a dashboard with a URL to the Snapshot URL for the respective camera.

In this case, I have an HE device of type "google nest camera". It never seems to show present and upon looking at the Google Nest application options for the camera I am not seeing much other than turn the camera on or set it to turn off when you are home and on when away. My camera is on all the time, but I am not sure how to use the device to see what it sees.

The Google api is a bit different -- it allows us to download the image associated with a motion/person/sound event, but we have to grab it within 30s -- so this is done autonomously by the App and it is stored within the device attributes as a base64-encoded string -- rawImg, and html-rendered -- image.

From the Hubitat Dashboard, you can select the device, add a Tile using the Attribute template, and select the image attribute. Note that this only displays on Local dashboards at the moment, as the paths for local/cloud are different -- and it seems the response size is limited for cloud queries.

Honestly, I do not grab photos from HE. My app notifications on my phone have them and my TVs are Android TVs. So, I did not feel the need to add that burden to HE. However, they were available on the tiles automatically once they were triggered in the nest app before not getting them was an option.