The Unifi Protect integration is amazing. The person and object detection exposed through sensors effectively makes PIR motioni sensors obsolete and are also a great solution for presence. This is huge!
Unifi’s latest AI cameras do on-camera face detection and have a great UI for face recognition, training, and matching. If this capability could be exposed through the integration, in the same style as the double-take integration for Frigate, we would be able to do things like:
Supress outdoor motion alerts for known people
Auto unlock or welcome
Person-specific presence routines
and so much more. Please give us access to the Unifi Protect face recognition features in HA.
Would be a great addition. In the meantime you could use the new alarm manager and webhooks in the latest EA version of protect. It does have triggers on known faces
Just a note, I’ve been screwing around with this and it is promising but not of any practical usefulness is of limited usefulness because the parameters for the webhook API have not been documented. AFAICT there is not a way to know that a particular face has been detected, for example. Let me know if you come up with any other information. Thanks!
the webhook call from unifi protect set to a post, actually sends the info which known face was recognised. Can be used with a value template un an automation.
if your interested let me know I can post the details.
Create an automation with trigger webhook in HA. copy out the webhook ID generated or create your own.
Unifi protect create an Alarm, new alarm. Choose devices and recognition type that trigger the alarm. obviously it will have to be face recognition. Section action choose webhook and enter. http://192.168.1.102:8123/api/webhook/xxxxxxxxxxxxxxxxxx. Instead of xxxxxx you webhook ID
Protect sends several variables including the name of the person detected. You can filter that with the following:
value_template: “{{ trigger.json.alarm.triggers[0].value == ‘Boris’ }}” this value temple will filter for the name Boris or who ever is Known in the Protect DB.
btw this Automation a webhook debugger helped me to see what protect actually sends in the webhook. you can filter for several other variables.
Oh there is one more issue. For some reason unifi protect only acts on a recognised face at the end of smart detection, think same goes for licenses plates. So standing infront of the cam and waiting for the webhook finally to trigger won’t work. The detection event/process has to stop.
Not happy with it, but I did a messy workaround by defining Smart detection zones. Stepping out of the zone ends the event and sends the webhook.
Hey Boris /Mrechs
did you have joy with his - Im a relative newbie bur have all the gear to activate it but im unsure of the webhook basics ( cant seem to make it work )
Hey Mckrick, yes it’s working nicely for me. Dont use my keys anymore to enter the flat. If you can explain your problem to me, I might be able to help you. You have to configure in the protect alarm manger a webhook action first and then an automation in HA that gets trigger by the webhook. The actual url and webhook ID is defined by HA though. how far did you get ?