[RELEASE] Google SDM API - Nest integration

Wow, that is quite a bit different. So, I add a device tile to point to the new google nest camera device. I selected the "template" attribute and the "image" attribute. The actual device has all the capture switches turned on. I pressed the initialize, refresh and take buttons but the dashboard tile is still blank. I made the tile 2x high and 3x wide.

The take button is a no-op (you'll see a warning in the logs) - since the api doesn't support an on-demand capture. As mentioned above, it's all event-driven - so if you are getting events from the Nest app but nothing in Hubitat, there may be an issue with the event subscription from Google to HE

So, let I the camera rest for a few hours. I am getting live video from the camera with the nest app or the nest web page. Here's the log from the HE device.


So, as you mentioned earlier, the camera is supposed to periodically push an image. I don't see that happening here. My dashboard tile for the camera has remained blank.

Any ideas?

On the App page, there is a link to Debug Buttons -- go there, and click the Subscribe to Events button -- either with the Logs open in a separate tab, or view Past Logs after. Let's see if there is an error on the event subscription with Google.

Is there any way to pull the home/away status of the Nest thermostat?

The API does not support Home/Away, at this point.

1 Like

I logged the API for about 30 minutes and I made one thermostat change. I also pressed all three buttons on the camera device page. The thermostat is working as expected.


Here is the log from the camera and we can see at least when I pressed the button for a snapshot which is not supported, it did respond.

I have gotten nothing else from the camera so far.

I have tried several times. When I paste the project ID and the client ID into the URL, I get a Cant Link to message.

After the latest Hubitat update and update to the app, I hit the Discover button again, and then it came through. Not sure why it wasn't before.

Pasting into what url? Are you running a recent version of the app? The only copy/paste in a url that I recall was early on, in generating the OAuth link - that logic has been implemented in the App. If you are using the latest version and following the latest readme, I need more details (perhaps screenshots?) of what you are trying to do, and where you are stuck.

All of these logs are generated within Hubitat - I suspect that the event subscription for Google Pub/Sub to forward events to Hubitat was not created successfully. In the App page, there is a toggle for Debug Logs -- enable it. Then click the link for Debug buttons - then on the page it directs you to, click on Subscribe to Events. Once you have clicked on that, check the "Past Logs" for any errors/success.

What do I change on the page?


Looks like it might be enabled.

Believe it or not, it didn’t like me doing it from Mac OS. I did the same steps from Windows and I was able to get this knocked out. Thanks for the help though.

Sorry - I'm referring to settings in the Hubitat App page:


The screenshot you posted show that the topic is enabled for events. You can check for a subscription in the GCP Console -- again the crossover of two projects in the Google space.

Ok, so in regards to the Google SDM API in Hubitat, I have clicked the subscribe to events and saved. The GCP Console link took me to a page where it does not look like I am subscribed.


However, my thermostat is working and my camera is not.

Yes, Hubitat is authorized with Google and your devices - so it can send commands, but since the subscription is missing, it doesn't receive events.

Check the Past Logs in Hubitat, I expect there will be an error for when the event subscription was attempted.

Also check (again on the GCP side) that the Pub/Sub API is enabled for your GCP Project

I would say that Pub/Sub API is enabled.
subscribed
Past logs on Hubitat do not have anything for the Google SDM Api, the thermostat or the camera.
The events log for the camera shows this.

Hmm - do your past logs tend to roll rather quickly? If that is the case, can you open the Log stream in one tab, and click the Subscribe to Events debug button in another tab? It should always generate an info log at a minimum...

I clicked on the refresh button in the office camera and I will keep the log window open.


I don't think I am likely to see any other logs. Part of that is because you mentioned that the Snapshots are initiated on the google side and then they connect to the Hubitat device. On the Nest app, I turned on everything I could including motion events. Any time I walk in front of the camera, the Nest app logs an event, but nothing happens in the Hubitat device log for the Google SDM API.

On the other hand, when I change the temperature on the thermostat, it does put an entry into the log.

Does the API not keep checking if there is a person in front of the camera? Is it just a one event fired and then done?

For example, I have porch lighting tied to the camera's "presence" (i.e. a person in front of the doorbell cam). What I found last night was that after the 15 sec timeout the camera goes back to the idle state and doesn't re-register that I'm still standing there.

Sure, I can up the timeout to X sec, but how long is enough? What I need to be outside for X+1 sec?

Not a slight against your code whatsoever. Your work is great--keep it up!
Currently it just seems like the Google API doesn't work well enough to use as a constant motion sensor, right? They will only re-fire a "person" event if you, for instance, step out frame and then back in.