Triggering Unifi camera (Unifi Protect) person detection in Home Assistant.
Since recent Unifi Protect API updates the entities in Home Assistant appear to flip too quickly for Home Assistant automations to detect (less then 0.5 seconds). Checking the state of entities such as camera-name.detections for person or on either doesn’t work or works unreliably.
What does seem to work reliably is creating a automation and selecting type “webhook”. Copy the webhook address and save for later. Open Unifi Protect and navigate to alarms and create a new alarm. For the trigger check “Person”, under scope choose the cameras you wish to include. Under webhook paste the url copied above and expand advanced. Check POST under advanced. I also set “Ignore repeated actions” to 5 minutes to avoid spamming my HA insatnce. Now each time any of the cameras selected detects a person it should reliably trigger your automation in HA.