UniFi Protect’s Smart Detection Zones / Line Crossing & HA

Morning all,

Has anyone managed to get notifications from UniFi Protect in to HA for detection events, line crossing or just motion in specific detection zones (eg on the drive, at the front door etc.)?

I’ve searched histories, logs, settings & forums with no luck.

Running up to date HA on a Pi, UDM SE with G4 Pros and the UniFi Protect official plugin. Assume someone heavily involved in writing code for these will read this at some point, so thanks for all the hard work you’ve put in.

Cheers,

S.

1 Like

I also would love to see crossing line detections and even more I would be very happy about seeing which smart detection zone actually triggered.
For example I’m observing my garage with two cars. I would like to trigger events based on each car by zone. In Unifi you can setup multiple zones for smart detections, but HA will only tell you that a vehicle was detected by saying “On/Off” :frowning:

I am in the same boat, any progress?

+1 from me as well, this feature would be awesome

With the latest version of protect 4.1.31, it adds an alarm manager and you can use webhooks as actions. There is a trigger for line crossing so this is now possible to trigger an automation in HA

Has anyone accomplished this?

I would like to have two zones in UniFi protect but only trigger an automation in Home Assistant with one of them.

The solution above is a little bit too much to understand for me.

I found this so I will give it a try…

I have webhooks from Protect to Home Assistant working.

Like Holdestmade said above there is the possibility of Line Crossing as an alert type.

There does not appear to be the possibility on the UniFi Protect side however to target a specific zone that had motion to send the correct webhook.

I will leave this in place as it seems to be a better solution than the integration in Home Assistant.

That said I am still disappointed as I wanted to know within Home Assistant which zone caused the trigger. Right now I can live with Line Cross.

Another pain point is that we can’t have a different alert / webhook based on the direction of travel A > B, B > A across the Line Cross.

Have you looked in the webhook response json ? There might be that data in there

That is a great thought. Thank you for the suggestion! I just had a look and it does not appear to be the case…

It has the MAC of the camera


trigger:
  platform: webhook
  webhook_id: unifi-protect-smart-detection-driveway-vehicle-3hB_F9JvDKGLNqLIH8AgpvP8
  json:
    alarm:
      name: Alarm - Smart Detection - Driveway - Vehicle
      sources:
        - device: 942A6F401F75
          type: include
      conditions:
        - condition:
            type: is
            source: vehicle
      triggers:
        - key: vehicle
          device: 942A6F401F75
          eventId: 677e93da03331703e4006d7f
    timestamp: 1736348636424
1 Like