Skip to content

Automation variables ​

Every trigger fills a set of variables that later steps use as {{event.label}}, in a notification, the body of an HTTP Request, or a condition. Every value is text: numbers come as digits, lists as comma-separated text, objects as JSON. How to wire steps and name your own variables is on Building automations.

If / Else and Switch suggest the values a variable can take for the trigger or sensor you picked.

Detection event ​

VariableValue
event.idID of the event
event.cameraIdID of the camera
event.stateactive, or ended on Event End
event.typesEverything the event contained so far, comma-separated[1]
event.typeFirst entry of event.types, usually what started the event: motion or audio
event.labelThe detected object (person, vehicle, animal), otherwise the audio event, otherwise event.type
event.confidenceBest score from 0 to 1, 0 when nothing reported one (plain motion)
event.facesRecognized names, comma-separated
event.platesRecognized license plates, comma-separated

Faces, plates and the detected object travel with the segments, the stretches in which an object is tracked. Event Start, Event Update and Event End don't carry them: event.faces and event.plates stay empty and event.label falls back to the audio event or event.type. To send who or what was seen, set Trigger on to Segment Start, Segment Update or Segment End.

Audio events are doorbell, glass_break, siren, speaking, gunshot, dog_bark, baby_cry, alarm, scream, cat, car_alarm and smoke_alarm.

Sensor change ​

VariableValue
sensor.propertyThe property that changed, one of the sensor's Properties
sensor.valueThe new value: true or false for on/off and detected states, a number for levels and readings, text for names and labels
sensor.previousValueThe value before the change
sensor.sensorTypeThe kind of sensor, such as contact, motion, object, face, licensePlate or temperature
sensor.sensorIdID of the sensor
sensor.assignedCameraIdsIDs of the cameras the sensor belongs to, comma-separated

A value with several parts also appears field by field: a PTZ position as sensor.value.pan, a list of recognized names as sensor.value.0, sensor.value.1 and sensor.value.length.

System event ​

system.eventType holds the event picked in the trigger: system:started, system:shutdown, camera:added, camera:removed, camera:connected, camera:disconnected, camera:frameworker:started, camera:frameworker:stopped, camera:property:changed, sensor:added, sensor:deleted, plugin:started, plugin:stopped, plugin:error or plugin:notification.

VariableSet byValue
system.cameraId, system.cameraNameCamera eventsThe camera
system.propertyProperty ChangedThe settings group that changed: name, sources, detectionSettings, ptzAutotrack, recordingSettings, notificationSettings, zones, frameWorkerSettings or interfaceSettings
system.pluginId, system.pluginNamePlugin eventsThe plugin
system.statusPlugin Started, Plugin Stopped, Plugin Errorstarted, stopped or error
system.sensorId, system.sensorType, system.sensorNameSensor Added, Sensor DeletedThe sensor

Plugin sends a notification adds system.title, system.subtitle, system.body, system.tag, system.severity (info, warn, error or critical) and every data field the plugin attaches. The NVR plugin sets system.type to detection, episode, text-alert, text-alert-end, camera_online, camera_offline, storage_paused, storage_resumed, storage_path_rejected or cloud_reauth, and depending on the type system.cameraId, system.cameraName, system.eventId, system.episodeId, system.alertId and system.alertTitle.

Webhook ​

A webhook is called with POST and a JSON object as body.

VariableValue
webhook.bodyThe whole body as JSON text
webhook.<field>Each top-level text, number or true/false field: {"room": "hall"} gives webhook.room with hall
webhook.headersThe request headers as JSON
webhook.methodPOST

MQTT message ​

VariableValue
mqtt.topicThe topic the message arrived on, useful with wildcards
mqtt.payloadThe payload as text
mqtt.<field>Each top-level text, number or true/false field of a JSON object payload

Geofence ​

VariableValue
geo.evententer or leave
geo.userThe user who moved
geo.zoneName of the zone
geo.lat, geo.lonThe reported position
geo.distanceDistance to the zone's center in meters, rounded

Schedule and Manual start a flow without variables.

Results of actions ​

VariableStepValue
snapshotCapture SnapshotThe JPEG as base64
snapshot.base64Capture SnapshotThe JPEG as a data URL, data:image/jpeg;base64,…
http.statusHTTP RequestStatus code, such as 200
http.bodyHTTP RequestThe response as text, base64 for images and other binary data
http.base64HTTP RequestA binary response as a data URL
http.json, http.<field>HTTP RequestA JSON response as text, and each of its top-level fields
plugin.detectedPlugin Calltrue or false
plugin.labelsPlugin CallFound labels, comma-separated
plugin.detections, plugin.resultPlugin CallThe detections and the full result as JSON
plugin.durationMsPlugin CallRun time in milliseconds
assistant.answerAsk the assistantThe answer as text
assistant.repliedAsk the assistantfalse when the assistant found nothing worth telling
camera.id, camera.nameCamera ControlThe camera it changed
previous.successMost actionstrue or false for the last step that ran
previous.resultMost actionssnapshot_captured, snapshot_failed, detected, not_detected, no_response, assistant_replied or assistant_silent

Time and arithmetic ​

{{time.now}} is the current time in milliseconds since 1970, in any flow.

{{= … }} calculates with numbers: {{= event.confidence * 100 }} gives the confidence in percent. It knows +, -, *, /, % and parentheses, rounds results with decimals to two places, and counts a variable that isn't a number as 0.


  1. motion and audio, the objects person, vehicle and animal, face and license_plate, a classifier result such as bird, and the event types a camera reports itself: contact, doorbell, switch, light, siren, security_system, line-crossing, occupancy, smoke, leak, gas, carbonMonoxide, heat, cold, vibration, tamper, problem, power, lock and garage. ↩︎

All product names, logos and brands belong to their respective owners. Naming them does not imply any affiliation or endorsement.