Event Engine Use Cases & Templates
User Manual GitHub

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.

How to import: Open the Event Engine web UI → Rules tab → click Import → select the downloaded .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

schedule (interval) vapix_query http_request

Push sensor data directly to a Power BI streaming dataset via its REST API — the camera feeds the dashboard with no gateway in between.

  1. A schedule trigger fires every 60 seconds
  2. A Device Event Query action fetches cached sensor data (temperature, humidity, CO₂) and injects them as {{trigger.FIELD}} variables
  3. An HTTP Request action POSTs a JSON array to the Power BI streaming dataset endpoint
Setup: In Power BI, create a Streaming dataset (API type) with columns: timestamp (DateTime), camera_serial (Text), camera_model (Text), temperature (Number), humidity (Number), co2 (Number). Copy the push URL into the template.

1.1b — Direct InfluxDB Ingestion (Grafana)

schedule (interval) vapix_query influxdb_write

Write time-series data points directly into InfluxDB — the camera is the data pipeline, ready to query in Grafana.

  1. A schedule trigger fires every 60 seconds
  2. A Device Event Query fetches cached sensor data
  3. 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

schedule (interval) vapix_query mqtt_publish retain

Publish sensor data over MQTT using Home Assistant topic conventions — sensors appear in HA with retained state updates every 60 seconds.

  1. A schedule trigger fires every 60 seconds
  2. A Device Event Query fetches cached sensor data
  3. 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.

vapix_event (Motion) time_window slack_webhook teams_webhook email cooldown 30s attach_snapshot
  1. A Device Event trigger subscribes to Motion Detection (active = true)
  2. A Time Window condition restricts to weekdays 08:00–18:00
  3. 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.

vapix_event (Motion) schedule (daily_time) digest event buffering
  1. A Device Event trigger fires on motion detection
  2. A Notification Digest action buffers each event as one line with timestamp
  3. 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.

schedule (astronomical) ir_cut_filter light_control max_executions 1/day
  1. Two rules use astronomical schedule triggers (sunset and sunrise)
  2. The sunset rule sets IR Cut Filter to night and Light Control on at 80% intensity
  3. 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)

schedule (daily_time) variable_compare privacy_mask max_executions 1/day
  1. Two rules with daily schedule triggers — 08:00 and 18:00 weekdays
  2. A Variable Compare condition skips if emergency override is active
  3. Privacy Mask actions enable or disable the named mask

2.2c/d — Emergency Override

mqtt_message http_webhook set_variable privacy_mask overlay_text cooldown 10s
  1. An MQTT Message trigger on building/emergency/+ with an HTTP Webhook fallback
  2. The emergency rule sets system.privacy_mode = override, disables the mask, and shows a warning overlay
  3. 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.

aoa_scenario guard_tour ptz_preset delay cooldown 60s
  1. An AOA Scenario trigger fires on human detection
  2. 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.

vapix_event (Motion) audio_clip cooldown 10s
  1. A Device Event trigger subscribes to Motion Detection
  2. 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.

schedule (daily_time) wiper
  1. A schedule trigger fires daily at 07:00
  2. 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.

aoa_scenario time_window variable_compare recording siren_light io_output telegram overlay_text cooldown 120s max_executions 10/hr attach_snapshot
  1. An AOA Scenario trigger detects humans in the perimeter
  2. Time Window (19:00–06:00) + Variable Compare (system.armed = true) must both pass
  3. Five actions: RecordingSiren/LightIO 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.

io_input time_window io_output recording increment_counter telegram cooldown 3s attach_snapshot
  1. An I/O Input trigger on port 1 (rising edge) from the card reader
  2. Business hours rule: Time Window 08:00–18:00 → IO Output (door strike 5s) + Recording + Increment Counter
  3. 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 (interval) aoa_occupancy aoa_get_counts overlay_text slack_webhook io_output cooldown 25s
  1. Schedule triggers every 30 seconds poll AOA counts via AOA Get Counts
  2. Warning rule: occupancy ≥ 20 → Overlay Text
  3. 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.

mqtt_message speaker_display
  1. An MQTT Message trigger on queue/reception/update
  2. A Speaker Display action renders ticket number and wait count on a dark-blue background
Setup: Configure your ticketing system to publish {"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_message variable_compare speaker_display

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_message set_variable speaker_display while_active cooldown 60s

MQTT payload critical → set system.airquality_alert = active → red scrolling alert that persists until cleared.

4.2c — All Clear

mqtt_message set_variable speaker_display

MQTT payload clear → reset variable → brief green confirmation → live dashboard resumes.

Setup: Configure your air quality gateway to publish JSON readings to 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.

schedule (interval) vapix_query (remote) speaker_display format specifier |N
  1. A schedule trigger fires every 60 seconds
  2. A Device Event Query targets the remote sensor and queries Environment / AirQuality
  3. A Speaker Display action renders {{trigger.CO2|0}}, {{trigger.Temperature|1}}, {{trigger.Humidity|0}}
Setup: Replace 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.

http_webhook speaker_display
  1. An HTTP Webhook trigger receives POSTs with a JSON payload
  2. A Speaker Display action renders the values, held for 5 minutes or until the next POST
Setup: POST to 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.

mqtt_message set_variable send_syslog payload filter
  1. Two rules listen on cameras/{{camera.serial}}/arm — payload arm or disarm
  2. Each sets system.armed and logs to syslog

5.2 Daily Counter Reset

Reset daily counters (door_access, motion_count) to zero at midnight.

schedule (daily_time) set_variable send_syslog

5.3 MQTT Heartbeat

Publish a status payload every 60 seconds so monitoring systems can detect device silence.

schedule (interval) mqtt_publish

5.4 Maintenance Mode via MQTT

MQTT enable/disable maintenance mode — suppresses alert rules and shows an overlay on the live stream.

mqtt_message set_variable overlay_text send_syslog payload filter

5.5 Remote Rule Control via MQTT

Dynamically enable or disable any rule by ID from a central automation system.

mqtt_message set_rule_enabled send_syslog payload filter
Setup: Replace 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.

io_input io_state (remote) speaker_display (remote) cooldown 30s cross-device

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.

aoa_scenario aoa_occupancy (remote) speaker_display (remote) mqtt_publish cooldown 60s cross-device

6.3 Remote Sensor Data Relay

Poll environmental data from a remote Axis sensor every 60 seconds and publish over MQTT with decimal formatting.

schedule (interval) vapix_query (remote) mqtt_publish format specifier |N retain cross-device

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

vapix_event (Motion) increment_counter cooldown 5s

Every motion event increments motion_count by 1. Pair with 5.2 (midnight counter reset) to keep it daily.

7.1b — Escalate at Threshold

counter_threshold counter set_variable slack_webhook run_rule send_syslog max_executions 1/day

When motion_count >= 50, the counter_threshold trigger fires. A counter condition double-checks, then escalates via Slack and optionally chains to another rule.

Setup: Replace 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.

io_input vapix_event (Motion) time_window recording telegram io_output trigger_logic AND trigger_window 8s attach_snapshot cooldown 30s
  1. trigger_logic: "AND" + trigger_window: 8 — both I/O input and motion must fire within 8 seconds
  2. Time Window restricts to after-hours (18:00–08:00)
  3. 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.

vapix_event (Motion) day_night (night) recording overlay_text cooldown 30s
  1. Device Event trigger on motion detection
  2. Day/Night condition passes only when the sun is below the horizon
  3. 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_scenario variable_compare time_window http_request ftp_upload send_syslog on_failure chain attach_snapshot
  1. AOA human detection, armed + after-hours
  2. HTTP Request with attach_snapshot: true POSTs the base64 image to the evidence server
  3. If HTTP fails (any error) → on_failure runs: 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.

schedule (cron) vapix_event_state acap_control set_device_param send_syslog mqtt_publish cron schedule cooldown 300s
  1. Cron trigger */10 * * * * fires every 10 minutes
  2. Device Event State condition checks the ACAP's running event — passes only when the ACAP is NOT active
  3. ACAP Control start → Set Device Parameter restore → syslog warning → MQTT alert
Setup: Replace 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.

schedule (cron) paging_console_execute send_syslog cron schedule
  1. Cron trigger 0 8-17 * * 1-5 — top of every hour, 08:00–17:00, Mon–Fri
  2. Paging Console Execute triggers the pre-configured paging action by UUID
Setup: Replace 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 http_webhook fire_vapix_event mqtt_publish send_syslog
  1. Manual trigger (UI "Fire Now" or POST /fire) or HTTP Webhook from any system
  2. Fire VAPIX Event emits RuleFired — the VMS subscribes to this and triggers its own workflow
  3. 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 variable_compare counter send_syslog mqtt_publish condition_logic OR
  1. Rule Fired trigger watches a security rule by UUID
  2. condition_logic: "OR" — logs if system.armed = true or motion_count > 0
  3. Syslog (warning) + MQTT audit topic with variable interpolation
Setup: Replace 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.

vapix_event (Motion) http_check time_window slack_webhook attach_snapshot cooldown 30s
  1. Motion detection trigger fires
  2. HTTP Check condition GETs the health endpoint — passes only if HTTP 200 + body ok within 5 seconds
  3. Time Window + endpoint check both pass → Slack alert with snapshot fires
Setup: Replace 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.

vapix_event (Motion) variable_compare (armed) time_window snapshot_upload send_syslog lifetime max_executions cap cooldown 10s
  1. Motion trigger fires; armed + after-hours conditions must both pass
  2. Snapshot Upload GETs a warm JPEG from channel 1 and POSTs it as raw binary with authorization header
  3. max_executions: 500, max_exec_period: "" — hard lifetime cap to prevent storage flooding
Setup: Replace the 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

mqtt_message (armed) paging_console_button send_syslog

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

mqtt_message (disarmed) paging_console_button send_syslog

On site/alarm/state payload disarmed: patch slot 1 back to the standard operations action UUID.

Setup: In both templates replace 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.

io_input (door sensor) vapix_event (Motion) time_window recording mqtt_publish telegram trigger_logic AND_ACTIVE mqtt on_failure → syslog attach_snapshot cooldown 30s
  1. trigger_logic: "AND_ACTIVE" — rule only fires while both triggers are simultaneously in their active state
  2. After-hours Time Window condition passes
  3. Recording (45s) starts; MQTT breach alert publishes (QoS 1)
  4. If MQTT broker is unreachable, on_failure logs a syslog error — so the alert is never silently lost
  5. Telegram snapshot notification sent in parallel
AND_ACTIVE vs AND: 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

#TemplateCategoryDescription
1.1asensor-data-powerbiDataSensor → Power BI streaming dataset
1.1bsensor-data-influxdbDataSensor → InfluxDB for Grafana
1.1csensor-data-mqtt-homeassistantDataSensor → MQTT to Home Assistant
1.2multi-platform-motion-alertsNotificationsMotion → Slack + Teams + Email with snapshot
1.3daily-activity-digestNotificationsBuffer events → daily email summary
2.1asunset-night-modeControlSunset → IR night + illuminator on
2.1bsunrise-day-modeControlSunrise → IR day + illuminator off
2.2aprivacy-mask-enableControl08:00 → enable privacy mask
2.2bprivacy-mask-disableControl18:00 → disable privacy mask
2.2cprivacy-mask-emergency-overrideControlEmergency → disable masks + override
2.2dprivacy-mask-emergency-clearControlEmergency cleared → restore masks
2.3ptz-track-and-resume-tourControlAOA → stop tour → PTZ → resume
2.4motion-audio-clipControlMotion → play audio deterrent
2.5schedule-wiperControlDaily 07:00 → camera wiper
3.1perimeter-intrusion-responseSecurityHuman + armed + after-hours → full response
3.2aaccess-control-business-hoursSecurityCard reader → door release + recording
3.2baccess-control-after-hours-alertSecurityCard reader after hours → Telegram alert
3.3aoccupancy-warningSecurityOccupancy ≥ 20 → warning overlay
3.3boccupancy-criticalSecurityOccupancy ≥ 30 → Slack + IO output
4.1queue-ticket-displayDisplayMQTT ticket → live queue number
4.2aair-quality-displayDisplayMQTT sensor → live dashboard
4.2bair-quality-alertDisplayMQTT critical → red scrolling alert
4.2cair-quality-clearDisplayMQTT clear → resume dashboard
4.3direct-sensor-air-quality-displayDisplayDirect vapix_query → speaker display
4.4webhook-air-quality-displayDisplayHTTP webhook → speaker display
5.1aarm-system-via-mqttSystemMQTT arm → set system.armed = true
5.1bdisarm-system-via-mqttSystemMQTT disarm → set system.armed = false
5.2daily-counter-resetSystemMidnight → reset counters to zero
5.3mqtt-heartbeatSystemEvery 60s → publish status heartbeat
5.4amaintenance-mode-enableSystemMQTT → activate maintenance mode
5.4bmaintenance-mode-disableSystemMQTT → deactivate maintenance mode
5.5aenable-rule-via-mqttSystemMQTT → enable target rule by ID
5.5bdisable-rule-via-mqttSystemMQTT → disable target rule by ID
6.1cross-device-io-condition-speaker-displayCross-DeviceI/O → remote I/O condition → display
6.2cross-device-aoa-condition-alertCross-DeviceAOA → remote occupancy → display + MQTT
6.3remote-sensor-data-relayCross-DeviceSchedule → remote query → MQTT with |N
4.3direct-sensor-displayDisplaysVAPIX query → overlay text + MQTT
4.4webhook-displayDisplaysHTTP Webhook → overlay text + MQTT
7.1amotion-count-incrementAdvancedMotion → increment_counter (+1)
7.1bmotion-count-escalateAdvancedcounter_threshold → Slack + run_rule, 1/day
7.2compound-trigger-tailgateAdvancedI/O AND Motion (8s window) → recording + Telegram
7.3night-only-recordingAdvancedMotion + day_night(night) → recording
7.4snapshot-upload-ftp-fallbackAdvancedAOA → http_request + on_failure → ftp_upload
7.5acap-watchdog-cronAdvancedCron + vapix_event_state → acap_control + set_device_param
7.6paging-scheduled-announcementAdvancedCron → paging_console_execute
7.7vms-event-bridgeAdvancedManual/Webhook → fire_vapix_event + MQTT
7.8security-audit-loggerAdvancedrule_fired → condition_logic OR → syslog + MQTT
7.9network-gated-alertAdvancedMotion + http_check → Slack with snapshot
7.10raw-snapshot-uploadAdvancedMotion + armed → snapshot_upload (binary JPEG), lifetime cap
7.11apaging-button-armAdvancedMQTT armed → paging_console_button (set emergency slot)
7.11bpaging-button-disarmAdvancedMQTT disarmed → paging_console_button (restore normal slot)
7.12dual-zone-and-activeAdvancedDoor + 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 changeWhere
Webhook URLs (Slack, Teams)Replace placeholder URLs with your actual endpoints
MQTT topicsAdjust the topic hierarchy to match your broker structure
InfluxDBSet server URL, database/bucket, and credentials
TelegramInsert your bot token and chat ID
Email (SMTP)Configure SMTP in Settings tab; only recipients need changing per rule
I/O portsMatch port numbers to your camera's physical wiring
AOA scenariosMatch scenario IDs to your configured analytics scenarios
PTZ presets / Guard tours / Privacy masksUse names matching your camera configuration
Thresholds and timingsAdjust cooldowns, hold durations, and value thresholds
Remote device credentialsSet IP, username, and password for cross-device rules
Decimal formattingAppend |N to numeric variables for precision (e.g. {{trigger.Temperature|2}})