UniFi Protect person detected notifications on your phone.

Get a High-priority push notification when a UniFi Protect camera spots a person, with a button to open the event clip.

How it works

Three steps to your first push

STEP 01

Install the recipe

One click in Studio gives you a personal webhook URL.

STEP 02

Paste your URL into UniFi Protect

Add it as a webhook for Person.

STEP 03

Get a push on your phone

With the text, sound and buttons from the recipe.

Setup

How to set up the UniFi Protect person webhook

  1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL.
  2. In UniFi Protect, go to Settings > Alarm Manager and click Add Alarm.
  3. Set the trigger to Person and select the camera(s) it should watch.
  4. Under actions, add a Webhook with method POST and paste your webhook URL?tz=Europe/Amsterdam as the URL, using your own time zone.https://••••••••/•••••••• your personal URL, shown after install
  5. Save the alarm, then press Test to send a sample event.
  6. Add your time zone to the webhook URL so the notification shows the local time:
  7. ```
  8. your webhook URL?tz=Europe/Amsterdam
  9. ```
  10. Use your own [time zone name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). UniFi only sends a UTC timestamp; without `tz`, the time is left out of the message.
  11. Alarm Manager sends every alarm to the same webhook shape. This recipe only reacts when the alarm contains a person trigger, so it stays quiet if you point other alarms at the same integration.
  12. Give the alarm a descriptive name, like "Front Door Person". The payload only identifies the camera by its MAC address, so the alarm name is what tells you where it happened.
  13. The **View clip** button uses `eventLocalLink`, which only resolves on your home network (and shows a certificate warning). Away from home it won't load.
The code

What runs when the webhook arrives

Studio calls handleRequest(request) with the incoming webhook and sends the message it returns. It's yours after install; change anything.

transform.js
1// UniFi Protect → person detected
2// Fires when a UniFi Protect camera's smart detection spots a person.
3//
4// Set this up as an Alarm Manager alarm in UniFi Protect with a "Person"
5// trigger and a Webhook action pointing at your JustPush Studio integration URL.
6
7// UniFi only sends a UTC timestamp, not your console's time zone, so the time zone comes
8// from the webhook URL: ?tz=Europe/Amsterdam. Without one (or with an unknown name) the
9// time is left out rather than shown in the server's time zone.
10function localTime(timestamp, request) {
11 const timeZone = typeof request.query?.tz === "string" ? request.query.tz.trim() : ""
12
13 if (!timestamp || !timeZone) return null
14
15 try {
16 return new Date(timestamp).toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit", timeZone })
17 } catch {
18 return null // not a time zone name this runtime knows
19 }
20}
21
22function handleRequest(request) {
23 const alarm = (request.body || {}).alarm
24
25 // Guard: ignore anything that isn't a UniFi Protect alarm payload.
26 if (!alarm || !Array.isArray(alarm.triggers)) {
27 console.log("Not a UniFi Protect alarm payload — skipping")
28 return null
29 }
30
31 // Alarm Manager sends every alarm to the same webhook, so only handle people.
32 // A single alarm can list the same trigger more than once; the first is enough.
33 const person = alarm.triggers.find((trigger) => trigger?.key === "person")
34
35 if (!person) {
36 console.log(`Ignoring "${alarm.name ?? "unknown"}" alarm — no person trigger`)
37 return null
38 }
39
40 const seenAt = localTime(person.timestamp, request)
41
42 // The payload only carries the camera's MAC, so the alarm name is the most
43 // readable hint of where this happened (e.g. "Front Door Person").
44 const where = alarm.name ? ` — ${alarm.name}` : ""
45
46 // The local link only resolves on your LAN, and only when the event was recorded.
47 const eventLink = alarm.eventLocalLink
48
49 return {
50 title: "🚶 Person detected",
51 message: (seenAt ? `Spotted at ${seenAt}` : "Someone was spotted") + where,
52 topic: "UniFi Protect",
53 priority: 1, // High — worth a look, but not as urgent as someone ringing the bell
54 // sound: "incoming", // any of Studio's sounds, e.g. incoming, bugle, siren
55 buttons: eventLink ? [{ cta: "View clip", url: eventLink }] : [],
56 }
57}
Payload

The UniFi Protect person webhook

This is what UniFi Protect sends to your URL for person. It is a sample, trimmed to the fields recipes use.

person · sample.json
1{
2 "alarm": {
3 "name": "Front Door Person",
4 "sources": [],
5 "triggers": [
6 {
7 "key": "person",
8 "device": "FAKE_MAC",
9 "eventId": "testEventId",
10 "timestamp": 1783505319282
11 }
12 ],
13 "eventPath": "/protect/events/event/testEventId",
14 "conditions": [
15 {
16 "condition": {
17 "type": "is",
18 "source": "person"
19 }
20 }
21 ],
22 "eventLocalLink": "https://192.168.1.1/protect/events/event/testEventId"
23 },
24 "timestamp": 1783505319286
25}
FAQ

UniFi Protect person detected notifications: questions

Does this work on iPhone and Android?

Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification.

Do I need to write code?

No. Install the recipe in Studio, paste your webhook URL into UniFi Protect and you are done. The code is there if you want to change the text, the sound or the buttons.

Can I change what the notification says?

Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save.

What does it cost?

JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.

Ready when you are

UniFi Protect on your phone in two minutes.

Install the recipe, paste one URL, done. Free for 30 days, no credit card required.