New: the AI firewall watches every module and explains each incident in plain words. See how it works

Rules card: triggers (“When”)

Every Rules-card trigger – value changes and stays so for, connection states, alarms, times, every N minutes, sun, days of the month, Run now.

The When block lists the triggers of a rule: “Any of these starts the rule.” A rule has 1 to 10 triggers. Click Add a trigger and choose the kind under What.

Kind (What)Starts the rule when
A value changesA stored value of a device changes in the way you choose.
A device connects or disconnectsA device comes online, goes offline or goes quiet.
An alarmAn alarm is raised or cleared.
A time of dayA clock time comes, on chosen weekdays.
Every so oftenEvery N minutes.
Sunrise or sunsetThe sun rises or sets at the place, with an offset.
Days of the monthA time comes on chosen days of the month and/or months.
Only when I press Run nowNever by itself; you start it with Run now.

After a trigger fires, the Only if conditions are checked; then the Then actions run. See Conditions and Actions.

A value changes

Pick the Device (one device, or every device of a profile in the place), the Value (a key), and How it changes:

ChoiceFires when
changesThe value is different from the last one (the first value counts too).
rises above xThe value goes from not above x to above x.
falls below xThe value goes from not below x to below x.
becomes xThe value turns equal to x.
stops being xThe value turns not equal to x.
comes into the range x and yThe value enters [x, y] (both ends included).
leaves the range x and yA number outside [x, y] arrives after one inside.

Comparisons follow the alarm rules: numbers (and number-like text) compare as numbers, becomes / stops being compare anything else as text, and “above”/”below” on a non-number never match.

It fires on the edge, the moment the match turns true, not on every message while it stays true. A temperature that rises above 28 fires once; it fires again only after the value has been at or below 28 and rises again.

and stays so for

Set and stays so for to a number of minutes (or at once). The rule then starts only if the match is still true after that time. A message that ends the match cancels the wait. The wait survives a restart of the platform. Longest: 24 hours (1,440 minutes).

Example: rises above 28 and stays so for 5 minutes: the fan starts only if the room stays hot for 5 minutes.

Which messages count

The trigger reacts after the value is stored: saved telemetry, and attribute updates that carry the key. A device of the profile counts on its own: with Every profile, each device has its own edge and its own “stays so for”.

A device connects or disconnects

ChoiceFires when
comes onlineThe device connects (under the profile’s online rule).
goes offlineThe device goes offline.
goes quietThe device sent nothing for the profile’s Inactivity timeout.

See Connection status and activity. To act only when a device stays offline, use goes offline, then Wait, then a choice “if the device is offline” (the ready rule Tell people when a device stays offline does exactly this).

An alarm

FieldMeaning
DeviceOne device or every device of a profile. On a card whose place is a device, also on this place (the device itself).
is raised / is clearedA new alarm opens, or an alarm is resolved. A severity change or an acknowledgement does not fire.
at leastA minimum severity, or any severity.
Alarm type (optional)Only alarms of this type, for example high_temperature.

A time of day

At a time (HH:MM, 24 hours) On chosen weekdays, or Every day. See Time, sunrise/sunset, dates and holidays for which time zone applies.

Every so often

Every 1 to 1,440 minutes, counted from when the rule’s flow starts, not from the full hour. Combine it with a time window condition for “every 15 minutes during working hours” (the ready rule Do something every so often during working hours).

Sunrise or sunset

Sunrise or Sunset, an offset in minutes after (negative: before) from −180 to 180, and optionally weekdays. The place needs a location: “Sunrise and sunset need this place’s location: set it on the place first.” For a device home, the location of the nearest asset above the device is used. Details: Time, sunrise/sunset, dates and holidays.

Days of the month

A time (At) on chosen days of the month (1 to 31) and/or In chosen months, or on weekdays. “Choose days of the month or days of the week, not both.” Example: at 06:00 on the 1st of every month; at 08:00 every day in June, July and August.

At least one of months, days of the month or weekdays must be chosen.

Only when I press Run now

The rule never starts by itself. Use it for sequences you start by hand from the card, for example a flushing program. A rule with this trigger still checks its Only if conditions.

Several triggers

Any trigger starts the rule. Each trigger fires separately; if two fire close together, the Options decide whether the second run waits, runs alongside or is ignored. See Actions.

Limits

LimitValue
Triggers per rule10
“stays so for”up to 24 hours
Every so often1 to 1,440 minutes
Sun offset−180 to 180 minutes
Devices one profile row stands for200

In JSON

The API stores triggers like this (ids are short row names):

"when": [
  { "id": "t1", "kind": "value", "target": { "deviceType": "<profileId>" }, "key": "temperature", "change": "above", "value": 28, "forSec": 300 },
  { "id": "t2", "kind": "status", "target": { "device": "<deviceId>" }, "to": "offline" },
  { "id": "t3", "kind": "alarm", "target": { "home": true }, "event": "raised", "minSeverity": "major" },
  { "id": "t4", "kind": "time", "at": "07:30", "days": [1, 2, 3, 4, 5] },
  { "id": "t5", "kind": "every", "minutes": 15 },
  { "id": "t6", "kind": "sun", "event": "sunset", "offsetMin": 15 },
  { "id": "t7", "kind": "date", "at": "06:00", "daysOfMonth": [1] },
  { "id": "t8", "kind": "manual" }
]

Weekdays are 1 (Monday) to 7 (Sunday). Rule severities are written in lower case (critical … info).