[RELEASE] Google SDM API - Nest integration

I had not even looked at/for any events in my doorbell until today (I had a delivery that sent me a notification through the nest app itself, so I know an event was triggered.)

I am not seeing any activity in my logs.

I deleted the app and recreated on the last updated yesterday. I have also deleted subscription and resubscribed to events. It found both my doorbells. What am I missing on getting the events to log? and/or getting them into a rule for actions?

It shows last activity as yesterday (Looks like the same time the app was updated maybe?)

Do you have a lastEventTime and/or lastEventType attribute on the device(s)? If not, would need to see logs around the delete/create of event subscription. You could try hitting the Discover button and see if that triggers events.

I do not. I did the discover when I redid the app after the last update.
After I updated, I deleted all the devices, removed the app, and then started over from scratch. That is the time stamp I posted above from yesterday.

App version is 2.3, Doorbell driver is version 1.1

Just redid the whole thing. Went out and made the camera recognize me, pushed the doorbell button, and nothing in the logs.

I am sure that I am just not holding my mouth right. Will play with it a bit later.

Edited to add: I went into the Nest settings (Native site) and turned on notifications for "motion" in some of the zones I have set up. Ten minutes later, it started working. :man_shrugging:

Turned the "motion" notifications off, and it appears to still be working. (I use "person" and "package", but with "Motion" I get Waaaaay too many false positives.)

Unfortunately I can't get the authorization link to appear after saving the project ID and Google Credentials json information in the form. Tried a few times, just can't get the link to appear. The logs say "Login refresh failed: groovyx.net.http.HttpResponseException: Bad Request" Each time I try to set it up. Have tried 3 times so far from scratch.

I take this to mean a full DELETE of the App, and re-install? I updated the HTTP error handling tonight (app-0.2.4) to get better logs -- but the "Login refresh failed" is expected if you have not yet completed the initial authorization.

Beyond this, if you click the "Settings" gear in the top-right on the App page, DM me a screenshot of the current Settings and Application State -- this will help to see which attribute is missing to allow the authorization link to load.

It requires Settings credentials and projectId, and Application State accessToken in order to load.

Well good news, I just updated to your latest release and that seemed to do the trick. Thank you so much for offering to help, This is an awesome app!

2 Likes

Mine has been working perfectly the last days.
Just curious, what are some uses for the image attribute that people are using apart from showing it in the dashboard?
I'm using the person motion events as triggers for my alarm system, but nothing else.

Awesome job so far, this is working great!

Can I make a small request to have the lastEventTime in our local time zone?

Thanks

1 Like

Okay, so now that I have it working, playing with a notification rule

This works to get phone and household notifications from the change of "last even type". I only want notifications of packages or people (the wind and changes in light cause too many false positive motion event)

Also, the "Package" type seems to be masked almost everytime by the "Person" event. I am thinking it's the activity timer (15 seconds default) that is preventing the update of event type from Person to Package (maybe?)

Anyhow, this works for now until I can work on a simulated Motion sensor that is triggered only on Person or Package.

EDITED TO ADD: You don't necessarily NEED the variable. I just use it as it makes the rule easier to clone (less things to change in the cloned rule - It also adds the possibility of using more than one device in the rule. I just do not know what would happen if BOTH devices had an updated event type at the same time. Also, if you run on motion becomes active, it never got the status change to Person from Motion... I think this is also related to the 15 second activity time)

Now, I need to set some time and/or mode constraints

How difficult would it be to create child motion sensors for the "Package", "Motion", and "Person" events that would be able to be used in HSM? Personally, I only care if a person is detected in the camera. We live in the country, so deer, foxes, rabbits, light changes, wind, etc give me all kinds of nonessential motion detection.

I use a custom attribute where motion is person as the trigger

On the above trigger I am sending a telegram notification with the url to the image. Is the URL unique to each event image or does it always go the the most recent image?

Yes, I am using the same one in RM (See previous post). I am talking about HSM. You can only choose Motion Sensors and Open/Close sensors in HSM.

HSM Options

I am thinking of trying to create a virtual motion sensor and update it to active when a person is detected. I was just wondering if that would be something useful to have in the app/device driver as well.

I see sorry about that.

Assuming you're pulling the src= url from the image attribute - this always points to the most recent image. The ts timestamp attribute in the url is just to force the dashboard to refresh it, otherwise it sees the same value in the attribute and doesn't reload the tile.

Interesting thought - it would probably be pretty straightforward to have (optional) child devices as virtual motion sensors, that trigger on a certain event type. I'll think over a possible implementation.

@lpakula's add-on also provides this as a filtering of the motion "active" changes on the camera, doorbell, and display devices - so you could limit it to just ”Person" events. If you want distinct motion triggers for different event types, though, would need a child/virtual device.

The api/event stream from google doesn't provide a "Package" event type, even though the Nest app does. We'll see if it gets added later on

Using this as a workaround until then: ("Front Door Person" is a virtual motion sensor with a 15 second inactivity timer)

Yeah, I just right clicked on the image for the url.

Is there a way in the api to associate an image with an event?

I actually had it showing "Package" in a latest event type (Only managed to make it work once by tossing a box on my porch from out of range - EERILY similar to how the handlers treat my deliveries LOL)

Hoping someone can help.. i tried to get this setup twice now and getting the same error in the HE logs:

errorLogin failed -- Bad Request: [error:invalid_request, error_description:Missing required parameter: refresh_token]

I wish Google wouldn't make things so complicated.. super frustrating.. I've got a valid Project in the Device Access Console which has a Project ID (set in HE). I've also got a GCP project with OAuth setup and copied the contents of the JSON into the driver field.. but, I haven't seen any authorize button.

Please let me know -- guessing I'm missing something simple

2 Likes