[RELEASE] Google SDM API - Nest integration

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.

After 12 hours, the log never received anything from the camera.

Just switch up the logic you use in your rule. Trigger on presence arrival and not on lack of presence. Ring doorbell when someone arrives... Turn on the Front Porch light for 5 minutes when someone arrives... Turn on backyard flood lights for 10 minutes when someone arrives.

That is already what I'm doing (see here). The issue is I have the light ramp down after a minute, so even if I'm still by my doorbell it'll turn off. Not sure if there's a way to keep it on while I'm still there with how the SDM API works.

I haven't done any concrete characterization of what you are describing -- but I have seen repeat events (within the default 15-sec timeout) for Motion -- perhaps you can augment your rule (or have a secondary rule) which checks for Motion before turning off the light?

I have a quick question - What do I use to read the away setting on Nest? I want to avoid my rules kicking in when the thermostat is set to away.

Home/Away mode isn't supported by the API yet. Whether you're in Eco mode or not is supported. So assuming you have your home go to Eco mode when you're away, you could hook off of that instead!

Have to be careful with "Eco" -- my understanding is that the "Manual Eco" supported by the api is different from the auto eco triggered by home/away status - that simply reflects in the api as an automatic change in setpoint...

1 Like

Almost 24 hours monitoring the logs on the Google SDM API. I have seen my thermostat changes show in the log and I have seen multips "Refreshing access_token from Google". I have not seen any messages from the camera at all.

The logs for thermostat changes are generated when we send commands. Beyond "refresh", which simply retrieves current attributes, there aren't any manual commands to send to cameras.

So far I haven't seen anything to dispute my suspicion that this is an error on Subscribe to Events - which is run automatically when we first authorize. Seeing the logs generated when this is clicked will confirm or deny this, and help us get to the next step.

Released app:0.5.0, with accompanying driver updates -- camera:0.3.0, display:0.3.0, doorbell:0.3.0.

This adds a new preferences toggle on these devices to "Enable Video Stream" -- when enabled, it will update a new attribute streamUrl which is the link to the RTSP stream for that device. The app/driver takes care of periodically refreshing the stream to keep it active -- the URL contains a streamToken, which must be current when you initially connect your client/transcoder. If for any reason the stream lapses, the App will generate a new stream on the next refresh interval -- the new URL can be used to reconnect the stream client.

1 Like

When I click on "Subscribe to Events" in the Google SDM API debug buttons, whilst I have a log page open to The google SDM API, here's all I can see.

Wow, so I upgraded to your latest code bits. For the first time ever, the camera sent log data. Not sure what the warnings mean.


The interesting thing is that the camera connected and had log data for the first time ever. It seems like I needed to turn on Motion events on the camera before it would do anything.

It seems to capture an image when it seems motion.

On another note, now that I am getting an "RTSPS" stream, do I need to have public access for the camera turned on, because the stream URL does not seem valid.

Ha -- glad things have started working for you, whatever the trigger was. Public access is not required for the stream, but only specific programs are able to "play" it (standard browsers/extensions do not have this capability). I've used ffplay successfully in testing it -- Transcoders such as Blue Iris or TinyCam have been reported as compatible, as well.

@vmsman pointed out a possible confusion -- there is the "Current States" section, which has all of the device attributes - it is the streamUrl here that you want.

Further down the page are the "State Variables", which also has a streamUrl - this one does not include the token, as I maintain separate variables for ease of update on each refresh. The base url does not change, but the token does. I'll rename the state variable in the next update.

1 Like

So, here is what I'm trying to do:

I have few rules that trigger heat/cool based on a zooz temperature and motion sensor for my office room. Everything works fine now and triggers and runs the HVAC as needed.

My worry is this might override my home/away settings if I don't account for it in my rule.

Any thoughts?

Should this streamUrl be playable using VLC? I tried multiple times and all I get is an error that "the input can't be opened".
I made sure I got the one with the token.

edit: just tested with ffplay and it works

Account for it in your rules using conditional restrictions.

If using RM4:
If Mode != Away