Unifi Protect custom webhook vs Home Assistant trigger

Hi everyone,

Have no idea where else to ask, to trying also here.

I am currently struggling with webhook automation trigger.

Behavior is very strange.

Use case is, custom alarm within Unifi camera to trigger automation for outdoor lights.

  1. If I sent the POST via Postman, the automation is triggered.
  2. If the same POST is sent via unifi, nothing - the trace in automation is empty - not called. I have no idea where the data could be lost.
  3. The Unifi camera motion detection works fine, but detects also motion from sidewalk.

Does anyone have experience with those?

(Set to POST, only local false)I cannot use Unifi entity within this camera, as there is no support for zones (need to ignore cars and persons on the sidewalk). HA Greed, whole infrastructure is Unifi.

Thanks for any idea, Tom

Use MotioneEye in between?
It supports zones etc…

Never heard of that. Some kind of software? I am kind of fresh user, never saw linux, never compile anything. Unifi stuff is connect to power hit next few times and forget.Got HA installed by my friend, I am able to add Sonoff or Ikea stuff and do basic automations. So please, like with idiot :smile:

Have a look here and in particular the link to github page, it describes how to do this

Search results in these posts:

https://community.home-assistant.io/search?q=unifi%20webhook%20order%3Alatest

Sorry, but there are only replies with no success from everyone. I did not found not single user with heureka - its working. There are many manual and how to, but my webhook doesnt reach HA and I have no idea why. Unifi says its detected and webhook triggered. But HA is dead. When I hit webhook from Postman, it works. Like a firewall between unifi and HA connected to unifi.

I do have it working, what format is your webhook in unifi ? Did you copy it from the HA automation trigger ?

MotionEye is an official add-on for HA.

It will process any video stream.
It also has recording and snapshot options as well as motion detection (including zones).

This is my working setup, is yours similar ?

Try using this webhook debugger from the post below. It will generate a notification with the json response from unifi.

Below you can see a response I got when a vehicle entered zone 1

{
  "alarm": {
    "conditions": [
      {
        "condition": {
          "source": "person",
          "type": "is"
        }
      },
      {
        "condition": {
          "source": "vehicle",
          "type": "is"
        }
      },
      {
        "condition": {
          "source": "animal",
          "type": "is"
        }
      }
    ],
    "name": "Webhook Debugger Objects",
    "sources": [
      {
        "device": "E438830EF67B",
        "type": "include"
      },
      {
        "device": "EC71DB626A93",
        "type": "include"
      }
    ],
    "triggers": [
      {
        "device": "xxxxxxxxxxxx",
        "eventId": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
        "key": "vehicle",
        "zones": {
          "line": [],
          "loiter": [],
          "zone": [
            1
          ]
        }
      }
    ]
  },
  "timestamp": 1739524761139
}