Unifi Protect zone detections

I've been playing with the new Protect drivers lately. They are working very well. Thank you for the new functionality.

I don't know what information is available behind the scenes. If a camera has more than one detection zone is it possible to distinguish what zone triggered the event? If so can that information be brought into the integration?

Tagging @bertabcd1234

I have not see any of this data come over the API myself, but if you enable debug logging on the NVR and camera device (the camera is probably enough unless the data is different enough from the rest that it's not making it that far), you'll see the "raw" data coming in. If anything there looks promising to distinguish, please share it, either here if you feel comfortable or in a PM with me if not.

I'm not sure I'd expect this, though, based on a glance of what the API provides otherwise (though their documentation is quite limited and it's hard to tell what is an actual limit or just not documented well). You could probably set up Maker API or a Rule with a local endpoint trigger and do something with Alarm Manager, however, for more advanced cases, which is do-able without the integration though certainly something that could also be used along with it.

1 Like

I have two distinct smart detect zones setup (default, Test Zone). Unfortunately, I don't see any reference to either. I don't know if I can dive deeper into the data/API.

That's too bad. I would like to create separate triggers for on and off property. So close to being the ultimate motion sensor. So far the feral cats in the neighborhood have not been giving me any false alerts.

If you have debug logging enabled on the Protect Console (or NVR) device on your hub, there isn't anything deeper -- that's all the data it's sending.

Most of that should make its way to the camera, too, which it looks like is where you were looking above, but the console/NVR device might have a bit more. If it does, there's no guarantee it will be what you're looking for, but it's about the only other place you can look.

Alarm Manager, as I referenced above, might help you do more advanced things. Not sure if this is one of them, but it seems to be pretty specific in what "triggers" you can use. This is how I did person detection before this integration.

Oooh, debug on Protect, not the Hubitat Protect integration. Let me look at that.

I'm not finding the bits I'm looking for. That's too bad as this integration is providing so much. It would be so easy if Protect passed the zone information as well. I'll have to suggest that to Ubiquiti and they might add it in a few decades. :wink:

I may be able to use crossing lines to get most of the way there.

Thanks for the insights.

I still wish zones were reported, but I can work with crossing lines. If anybody else is interested, I first setup an alarm in Protect.

Then I setup a virtual motion sensor with "Auto Inactivate" set to 30 seconds. This is to mimic the behavior of my PIR sensors. Finally I setup a Rule Machine rule to send me a notification.

I use the local variable isActive so that the routine only sends me one alert if the rule is triggered before the sensor resets. Oops, I see I can remove the "Cancel Delayed Actions" from an earlier iteration.

Ultimately I won't be using this for messaging. That was just for testing. I want to tie it into my outside lighting app to either supplement or replace my PIR sensors.

So far it has been pretty reliable and not prone to false triggers like the PIR sensors.