Use Cases & Templates
Ready-to-import rule templates demonstrating what Event Engine can do. Download a template, import it into the web UI, customise the placeholders, and you're running.
.json file.
You can also POST directly to the API: POST /local/acap_event_engine/rules?action=import
1 — Notifications & Data Transmission
Push alerts to people and push data to systems. The camera becomes an edge sensor node that detects, formats, and delivers — over HTTP, MQTT, SMTP, or directly into time-series databases.
1.1 Environmental Sensor Data Transmission
An Axis environmental sensor periodically reads sensor values and transmits them to external systems. Three templates cover the main approaches.
1.1a — Power BI Real-Time Dashboard
Push sensor data directly to a Power BI streaming dataset via its REST API — the camera feeds the dashboard with no gateway in between.
- A schedule trigger fires every 60 seconds
- A Device Event Query action fetches cached sensor data (temperature, humidity, CO₂) and injects them as
{{trigger.FIELD}}variables - An HTTP Request action POSTs a JSON array to the Power BI streaming dataset endpoint
1.1b — Direct InfluxDB Ingestion (Grafana)
Write time-series data points directly into InfluxDB — the camera is the data pipeline, ready to query in Grafana.
- A schedule trigger fires every 60 seconds
- A Device Event Query fetches cached sensor data
- An InfluxDB Write action writes a data point with temperature, humidity, CO₂ as fields and the camera serial as a tag
1.1c — MQTT to Home Assistant
Publish sensor data over MQTT using Home Assistant topic conventions — sensors appear in HA with retained state updates every 60 seconds.
- A schedule trigger fires every 60 seconds
- A Device Event Query fetches cached sensor data
- An MQTT Publish action sends a retained JSON payload to
homeassistant/sensor/<serial>/environment/state
1.2 Multi-Platform Motion Alerts
When motion is detected during office hours, send an alert with a camera snapshot to Slack, Microsoft Teams, and email simultaneously.
- A Device Event trigger subscribes to Motion Detection (active = true)
- A Time Window condition restricts to weekdays 08:00–18:00
- Three actions run in sequence: Slack webhook, Teams webhook, and Email — each with snapshot attachment
1.3 Daily Activity Digest
Buffer all motion events throughout the day and send a single summary email at 18:00 — a daily activity report for facility managers.
- A Device Event trigger fires on motion detection
- A Notification Digest action buffers each event as one line with timestamp
- A second schedule trigger at 18:00 ensures the digest flushes daily
2 — Device Control
Automate camera hardware: imaging, PTZ, overlays, privacy masks, illumination, audio, wiper — in response to events, schedules, or external commands.
2.1 Sunrise / Sunset IR & Light Management
At sunset, switch to night mode and turn on the IR illuminator. At sunrise, switch back to day mode. Times follow the sun — no fixed schedule.
- Two rules use astronomical schedule triggers (sunset and sunrise)
- The sunset rule sets IR Cut Filter to night and Light Control on at 80% intensity
- The sunrise rule mirrors it: IR to day, light off
2.2 Event-Driven Privacy Zones
Privacy masks follow a GDPR schedule but can be overridden instantly during emergencies via MQTT or webhook.
2.2a/b — Scheduled Privacy (Business Hours)
- Two rules with daily schedule triggers — 08:00 and 18:00 weekdays
- A Variable Compare condition skips if emergency override is active
- Privacy Mask actions enable or disable the named mask
2.2c/d — Emergency Override
- An MQTT Message trigger on
building/emergency/+with an HTTP Webhook fallback - The emergency rule sets
system.privacy_mode = override, disables the mask, and shows a warning overlay - The clear rule restores
system.privacy_mode = normal— scheduled rules resume
2.3 PTZ Auto-Tracking with Guard Tour Resume
A PTZ camera runs a guard tour. On human detection, pause the tour, go to a close-up preset, hold 30 seconds, then resume.
- An AOA Scenario trigger fires on human detection
- Guard Tour stop → PTZ Preset go to close-up → Delay 30s → Guard Tour start
2.4 Motion → Audio Clip
Play a pre-uploaded audio clip through the camera speaker when motion is detected — deterrent or staff alert.
- A Device Event trigger subscribes to Motion Detection
- An Audio Clip action plays the selected clip
2.5 Scheduled Wiper
Run the camera wiper every morning at 07:00 to clear overnight condensation or debris.
- A schedule trigger fires daily at 07:00
- A Wiper action starts the primary wiper
3 — Security & Surveillance Automation
Combine detection triggers with conditions and multi-step action chains for intrusion response, access control, and occupancy monitoring — entirely on the edge.
3.1 Perimeter Intrusion Response
Person detected in a restricted zone after hours while armed → full response: recording, siren, I/O alarm, Telegram snapshot, live-stream overlay.
- An AOA Scenario trigger detects humans in the perimeter
- Time Window (19:00–06:00) + Variable Compare (
system.armed = true) must both pass - Five actions: Recording → Siren/Light → IO Output (30s) → Telegram (snapshot) → Overlay Text (60s)
3.2 Smart Access Control
I/O input from a card reader. Business hours: release door, record, count. After hours: alert only.
- An I/O Input trigger on port 1 (rising edge) from the card reader
- Business hours rule: Time Window 08:00–18:00 → IO Output (door strike 5s) + Recording + Increment Counter
- After-hours rule: Time Window 18:00–08:00 → Recording + Telegram alert with snapshot
3.3 Occupancy Monitoring with Escalation
AOA counts people. Warning overlay at 20, Slack alert + I/O indicator at 30.
- Schedule triggers every 30 seconds poll AOA counts via AOA Get Counts
- Warning rule: occupancy ≥ 20 → Overlay Text
- Critical rule: occupancy ≥ 30 → Slack webhook + IO Output
4 — Speaker Display
Drive the screen on Axis speaker-display devices (e.g. C1710). Data can come from MQTT messages, HTTP webhooks, or direct polling of another Axis device.
4.1 Live Queue Ticket Display
Ticketing system publishes MQTT updates → display shows current ticket number and queue length instantly.
- An MQTT Message trigger on
queue/reception/update - A Speaker Display action renders ticket number and wait count on a dark-blue background
{"current":"A047","waiting":3} to the topic. Adjust the topic in the template.
4.2 Air Quality Monitor (MQTT)
Three rules work together: live dashboard on green, critical alert override in red, all-clear to resume.
4.2a — Live Data Dashboard
MQTT trigger on sensors/airquality/data → display CO₂, PM2.5, temp, humidity on green background. Suppressed when alert is active.
4.2b — Critical Alert Override
MQTT payload critical → set system.airquality_alert = active → red scrolling alert that persists until cleared.
4.2c — All Clear
MQTT payload clear → reset variable → brief green confirmation → live dashboard resumes.
sensors/airquality/data and threshold status to sensors/airquality/status.
4.3 Direct Axis Sensor → Speaker Display
The display polls an Axis air quality sensor directly every 60 seconds — no MQTT broker, no gateway, no middleware.
- A schedule trigger fires every 60 seconds
- A Device Event Query targets the remote sensor and queries
Environment / AirQuality - A Speaker Display action renders
{{trigger.CO2|0}},{{trigger.Temperature|1}},{{trigger.Humidity|0}}
remote_host, remote_user, remote_pass with the sensor's IP and credentials.
4.4 Webhook-Driven Speaker Display
A BMS or automation platform POSTs air quality data over HTTP — no MQTT broker required. Each POST instantly updates the screen.
- An HTTP Webhook trigger receives POSTs with a JSON payload
- A Speaker Display action renders the values, held for 5 minutes or until the next POST
http://<ip>/local/acap_event_engine/fire?token=airquality-display-update with body {"payload":{"co2":750,"pm25":8,"temperature":21.5,"humidity":45}}
5 — System Management
Control the engine's operational mode, maintain counters and variables, and provide observability — the building blocks that other rules depend on.
5.1 Arm / Disarm via MQTT
A single MQTT publish arms or disarms all rules that gate on system.armed.
- Two rules listen on
cameras/{{camera.serial}}/arm— payloadarmordisarm - Each sets
system.armedand logs to syslog
5.2 Daily Counter Reset
Reset daily counters (door_access, motion_count) to zero at midnight.
5.3 MQTT Heartbeat
Publish a status payload every 60 seconds so monitoring systems can detect device silence.
5.4 Maintenance Mode via MQTT
MQTT enable/disable maintenance mode — suppresses alert rules and shows an overlay on the live stream.
5.5 Remote Rule Control via MQTT
Dynamically enable or disable any rule by ID from a central automation system.
REPLACE_WITH_TARGET_RULE_ID with the UUID from the target rule's settings panel.
6 — Cross-Device Automation
Detect on camera A, check state on camera B, act on device C. A single Event Engine instance orchestrates a multi-device workflow.
6.1 I/O Input → Remote I/O State → Speaker Display
Door sensor opens on camera A. Only alarm if camera B's sensor is also active — then show alert on a remote speaker display.
6.2 AOA → Remote Occupancy Condition → Alert
Camera A detects a person, but only alerts if camera B also counts occupancy > 0 — confirming it's not a false positive.
6.3 Remote Sensor Data Relay
Poll environmental data from a remote Axis sensor every 60 seconds and publish over MQTT with decimal formatting.
7 — Advanced Patterns
Templates demonstrating the full depth of the engine: compound triggers, counter-driven escalation, cron scheduling, evidence failover, ACAP lifecycle management, VMS integration, and network-aware conditions.
7.1 Counter-Driven Escalation
Count every motion event during the day. When the count hits 50, escalate once — Slack alert, variable update, and optional rule chain.
7.1a — Increment the Counter
Every motion event increments motion_count by 1. Pair with 5.2 (midnight counter reset) to keep it daily.
7.1b — Escalate at Threshold
When motion_count >= 50, the counter_threshold trigger fires. A counter condition double-checks, then escalates via Slack and optionally chains to another rule.
REPLACE_WITH_TARGET_RULE_ID with the UUID of a rule to chain to. Remove the run_rule action if chaining is not needed.
7.2 Compound Trigger — Tailgate Detection
A door sensor and motion detection each fire independently on legitimate events. A tailgate occurs when both happen within 8 seconds of each other.
trigger_logic: "AND"+trigger_window: 8— both I/O input and motion must fire within 8 seconds- Time Window restricts to after-hours (18:00–08:00)
- Recording (30s) → Telegram snapshot alert → IO Output (alarm relay 5s)
7.3 Night-Only Recording
Record motion only during darkness. No fixed time window — adapts to actual sunrise/sunset at the camera's location across the year.
- Device Event trigger on motion detection
- Day/Night condition passes only when the sun is below the horizon
- Recording (30s) + overlay text showing detection time
7.4 Snapshot Evidence with FTP Fallback
POST a snapshot to the primary evidence server. If the upload fails, the on_failure chain automatically reroutes to FTP backup storage.
- AOA human detection, armed + after-hours
- HTTP Request with
attach_snapshot: truePOSTs the base64 image to the evidence server - If HTTP fails (any error) →
on_failureruns: FTP Upload to backup + Send Syslog warning
7.5 ACAP Service Watchdog
A critical ACAP must stay running. Poll its state every 10 minutes; if it's inactive, restart it, restore a device parameter, and publish an alert.
- Cron trigger
*/10 * * * *fires every 10 minutes - Device Event State condition checks the ACAP's running event — passes only when the ACAP is NOT active
- ACAP Control start → Set Device Parameter restore → syslog warning → MQTT alert
event_key with your ACAP's running event path, and package with its package name.
7.6 Paging Console Scheduled Announcement
Broadcast a pre-configured announcement on an Axis C6110 paging console at the top of every business hour.
- Cron trigger
0 8-17 * * 1-5— top of every hour, 08:00–17:00, Mon–Fri - Paging Console Execute triggers the pre-configured paging action by UUID
REPLACE_WITH_PAGING_ACTION_UUID with the action UUID from the C6110 web interface.
7.7 VMS Event Bridge
Trigger from the UI or any external system to emit a VAPIX event that your VMS (ACS, Milestone) is subscribed to — bridging Event Engine automation into VMS workflows.
- Manual trigger (UI "Fire Now" or
POST /fire) or HTTP Webhook from any system - Fire VAPIX Event emits
RuleFired— the VMS subscribes to this and triggers its own workflow - MQTT Publish + Syslog provide parallel paths
7.8 Security Event Audit Logger
Whenever a critical security rule fires, log it — with condition_logic: OR, only when the system is armed OR any motion activity has been seen today.
- Rule Fired trigger watches a security rule by UUID
condition_logic: "OR"— logs ifsystem.armed = trueormotion_count > 0- Syslog (warning) + MQTT audit topic with variable interpolation
REPLACE_WITH_SECURITY_RULE_ID with the UUID of the rule to audit.
7.9 Network-Gated Motion Alert
Confirm the notification endpoint is reachable before acting. Silently skip when connectivity is lost — prevents dead-queue flooding in isolated or occasionally-connected deployments.
- Motion detection trigger fires
- HTTP Check condition GETs the health endpoint — passes only if HTTP 200 + body
okwithin 5 seconds - Time Window + endpoint check both pass → Slack alert with snapshot fires
url and expected_body in the condition with your actual health endpoint.
7.10 Raw Binary Snapshot Upload
POST a raw JPEG snapshot directly to an evidence archive. Unlike http_request with attach_snapshot (which encodes to base64 inside JSON), snapshot_upload sends an RFC-compliant binary image/jpeg body — smaller wire size, no decode step on the server.
- Motion trigger fires; armed + after-hours conditions must both pass
- Snapshot Upload GETs a warm JPEG from
channel 1and POSTs it as raw binary with authorization header max_executions: 500, max_exec_period: ""— hard lifetime cap to prevent storage flooding
url and REPLACE_WITH_API_TOKEN in the headers. The receiver must accept Content-Type: image/jpeg binary bodies.
7.11 Paging Console Context Button
Dynamically swap a paging console panel button between an Emergency All-Call action and normal operations — driven by MQTT alarm state. The button a security officer presses always reflects the current posture of the site.
7.11a — Arm: Assign Emergency Action to Slot 1
On site/alarm/state payload armed: GET the page layout, patch slot 1 to the emergency action UUID, PUT it back.
7.11b — Disarm: Restore Normal Action to Slot 1
On site/alarm/state payload disarmed: patch slot 1 back to the standard operations action UUID.
REPLACE_WITH_PAGE_UUID with the C6110 page UUID and the action UUIDs with those from your paging console configuration.
7.12 Dual-Zone Breach — AND_ACTIVE
A door sensor and motion detection must be simultaneously active to trigger a breach alert. A door that briefly opens with no concurrent motion (delivery, false latch) is ignored. Motion with the door closed (cleaning staff, animals) is ignored. Only genuine co-occurrence raises the alarm.
trigger_logic: "AND_ACTIVE"— rule only fires while both triggers are simultaneously in their active state- After-hours Time Window condition passes
- Recording (45s) starts; MQTT breach alert publishes (QoS 1)
- If MQTT broker is unreachable,
on_failurelogs a syslog error — so the alert is never silently lost - Telegram snapshot notification sent in parallel
AND + trigger_window fires if both triggers fire within N seconds of each other (sequential OK). AND_ACTIVE requires genuine simultaneous presence — both trigger states must be active at the same moment.
Template Summary
| # | Template | Category | Description |
|---|---|---|---|
| 1.1a | sensor-data-powerbi | Data | Sensor → Power BI streaming dataset |
| 1.1b | sensor-data-influxdb | Data | Sensor → InfluxDB for Grafana |
| 1.1c | sensor-data-mqtt-homeassistant | Data | Sensor → MQTT to Home Assistant |
| 1.2 | multi-platform-motion-alerts | Notifications | Motion → Slack + Teams + Email with snapshot |
| 1.3 | daily-activity-digest | Notifications | Buffer events → daily email summary |
| 2.1a | sunset-night-mode | Control | Sunset → IR night + illuminator on |
| 2.1b | sunrise-day-mode | Control | Sunrise → IR day + illuminator off |
| 2.2a | privacy-mask-enable | Control | 08:00 → enable privacy mask |
| 2.2b | privacy-mask-disable | Control | 18:00 → disable privacy mask |
| 2.2c | privacy-mask-emergency-override | Control | Emergency → disable masks + override |
| 2.2d | privacy-mask-emergency-clear | Control | Emergency cleared → restore masks |
| 2.3 | ptz-track-and-resume-tour | Control | AOA → stop tour → PTZ → resume |
| 2.4 | motion-audio-clip | Control | Motion → play audio deterrent |
| 2.5 | schedule-wiper | Control | Daily 07:00 → camera wiper |
| 3.1 | perimeter-intrusion-response | Security | Human + armed + after-hours → full response |
| 3.2a | access-control-business-hours | Security | Card reader → door release + recording |
| 3.2b | access-control-after-hours-alert | Security | Card reader after hours → Telegram alert |
| 3.3a | occupancy-warning | Security | Occupancy ≥ 20 → warning overlay |
| 3.3b | occupancy-critical | Security | Occupancy ≥ 30 → Slack + IO output |
| 4.1 | queue-ticket-display | Display | MQTT ticket → live queue number |
| 4.2a | air-quality-display | Display | MQTT sensor → live dashboard |
| 4.2b | air-quality-alert | Display | MQTT critical → red scrolling alert |
| 4.2c | air-quality-clear | Display | MQTT clear → resume dashboard |
| 4.3 | direct-sensor-air-quality-display | Display | Direct vapix_query → speaker display |
| 4.4 | webhook-air-quality-display | Display | HTTP webhook → speaker display |
| 5.1a | arm-system-via-mqtt | System | MQTT arm → set system.armed = true |
| 5.1b | disarm-system-via-mqtt | System | MQTT disarm → set system.armed = false |
| 5.2 | daily-counter-reset | System | Midnight → reset counters to zero |
| 5.3 | mqtt-heartbeat | System | Every 60s → publish status heartbeat |
| 5.4a | maintenance-mode-enable | System | MQTT → activate maintenance mode |
| 5.4b | maintenance-mode-disable | System | MQTT → deactivate maintenance mode |
| 5.5a | enable-rule-via-mqtt | System | MQTT → enable target rule by ID |
| 5.5b | disable-rule-via-mqtt | System | MQTT → disable target rule by ID |
| 6.1 | cross-device-io-condition-speaker-display | Cross-Device | I/O → remote I/O condition → display |
| 6.2 | cross-device-aoa-condition-alert | Cross-Device | AOA → remote occupancy → display + MQTT |
| 6.3 | remote-sensor-data-relay | Cross-Device | Schedule → remote query → MQTT with |N |
| 4.3 | direct-sensor-display | Displays | VAPIX query → overlay text + MQTT |
| 4.4 | webhook-display | Displays | HTTP Webhook → overlay text + MQTT |
| 7.1a | motion-count-increment | Advanced | Motion → increment_counter (+1) |
| 7.1b | motion-count-escalate | Advanced | counter_threshold → Slack + run_rule, 1/day |
| 7.2 | compound-trigger-tailgate | Advanced | I/O AND Motion (8s window) → recording + Telegram |
| 7.3 | night-only-recording | Advanced | Motion + day_night(night) → recording |
| 7.4 | snapshot-upload-ftp-fallback | Advanced | AOA → http_request + on_failure → ftp_upload |
| 7.5 | acap-watchdog-cron | Advanced | Cron + vapix_event_state → acap_control + set_device_param |
| 7.6 | paging-scheduled-announcement | Advanced | Cron → paging_console_execute |
| 7.7 | vms-event-bridge | Advanced | Manual/Webhook → fire_vapix_event + MQTT |
| 7.8 | security-audit-logger | Advanced | rule_fired → condition_logic OR → syslog + MQTT |
| 7.9 | network-gated-alert | Advanced | Motion + http_check → Slack with snapshot |
| 7.10 | raw-snapshot-upload | Advanced | Motion + armed → snapshot_upload (binary JPEG), lifetime cap |
| 7.11a | paging-button-arm | Advanced | MQTT armed → paging_console_button (set emergency slot) |
| 7.11b | paging-button-disarm | Advanced | MQTT disarmed → paging_console_button (restore normal slot) |
| 7.12 | dual-zone-and-active | Advanced | Door + Motion AND_ACTIVE → recording + MQTT (on_failure → syslog) |
Customisation Guide
Every template is designed to be imported and then customised in the web UI:
| What to change | Where |
|---|---|
| Webhook URLs (Slack, Teams) | Replace placeholder URLs with your actual endpoints |
| MQTT topics | Adjust the topic hierarchy to match your broker structure |
| InfluxDB | Set server URL, database/bucket, and credentials |
| Telegram | Insert your bot token and chat ID |
| Email (SMTP) | Configure SMTP in Settings tab; only recipients need changing per rule |
| I/O ports | Match port numbers to your camera's physical wiring |
| AOA scenarios | Match scenario IDs to your configured analytics scenarios |
| PTZ presets / Guard tours / Privacy masks | Use names matching your camera configuration |
| Thresholds and timings | Adjust cooldowns, hold durations, and value thresholds |
| Remote device credentials | Set IP, username, and password for cross-device rules |
| Decimal formatting | Append |N to numeric variables for precision (e.g. {{trigger.Temperature|2}}) |