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

Alarm rules on device profiles

Define threshold and offline alarm rules once per device profile – the form, the JSON mode, saving, versions, limits and every part of a rule.

Alarm rules are set on a device profile and apply to every device of that profile. A rule opens an alarm when its condition holds and clears it when the condition is over. The rules run in the root flow’s alarm step for every message of the profile’s devices.

Open the rules

  1. Open Device Profiles and open a profile.
  2. Open the Alarm rules tab.

You see the profile’s rules with their type, kind (Threshold or Device offline), their condition in short, and an Enabled switch. Anyone with View alarms and alarm rules sees them; changing them needs Edit the alarm rules of device profiles (Admin by default). Without it the tab says “You can view the rules but not change them.”

Add or change a rule

  1. Click Add rule and choose Threshold rule or Device offline rule, or click Edit on a rule.
  2. Fill in the drawer (see below). Switch between Form and JSON at the top.
  3. Click Add to list (new rule) or Update the list.
  4. Repeat for other rules. The tab shows “n rules changed and not saved yet: nothing applies until you save.”
  5. Click Save rules. Discard throws the unsaved changes away.

Saving replaces the profile’s whole rule set. A rule whose definition or switch changed gets a new version; an unchanged rule keeps its version and its state. The new rules reach every worker within about two seconds. If someone else saved the same profile at the same moment, you get “The alarm rules changed at the same time; try again.”

Threshold rule: the form

FieldWhat you set
TypeThe alarm’s name. Letters, digits and _ . : -, at most 128 characters, unique in the profile. One open alarm per device and type. A new rule starts as high_value.
Alarm titleWhat people see, at most 300 characters. Placeholders: {{device.name}}, {{value}}, {{key}}, {{threshold}}, {{severity}}, {{type}}. A new rule starts with {{device.name}}: {{value}}.
EnabledOn or off.
SeverityOne line per severity: the severity, then Key, Operator and Value. Add a severity adds a line (at most five, each severity once). The highest true line wins.
KeyA telemetry key. The box offers the profile’s declared keys and takes free text.
Operator>, >=, <, <=, ==, !=.
ValueA number, true or false, a text, or attribute:<name> for a per-device limit.
Only from topicUnder Advanced: compare only messages from this MQTT topic. Empty = any topic.
How long the condition must holdCount in Readings in a row or Seconds (device time), then the raise and clear numbers (1 to 86,400).
Hysteresis (clear margin)An absolute margin on the clear side.
RunbookText shown with the alarm: what to check and what to do (at most 10,000 characters).

Details of conditions, debounce and hysteresis: Alarm conditions reference and Debounce, hysteresis and dampening.

Device offline rule: the form

FieldWhat you set
Alarm titleDefault {{device.name}} is offline.
Open after (seconds offline)10 to 604,800 (7 days). Default 600.
SeverityDefault Warning.
Runbook, EnabledAs above.

Its type is always device_offline, so a profile has at most one. See Offline alarms.

What only JSON mode shows

The form covers the common shape. These parts exist only in JSON mode:

PartJSON fieldPage
Combined conditions (several comparisons with all/any)severities[].condition with all / anyAlarm conditions reference
An explicit clear conditionclearClear conditions and late readings
Dampening settingsdampeningDebounce, hysteresis and dampening
Notifications: recipients, channels, minimum severity, remindersnotifyAlarm notifications in depth
Replaying out-of-order readingsevaluateBackfillClear conditions and late readings

The form keeps these parts when you edit other fields. A rule with combined conditions opens in JSON mode with the note “This rule uses combined conditions or other settings the form does not show: edit it as JSON.” JSON mode is strict: a field Hermetry does not know is refused, so a stored rule never carries an ignored setting.

A complete rule

{
  "type": "high_temperature",
  "title": "{{device.name}}: {{value}} °C",
  "severities": [
    { "severity": "CRITICAL", "condition": { "key": "temperature", "op": ">", "value": 90 } },
    { "severity": "MAJOR", "condition": { "key": "temperature", "op": ">", "value": { "attribute": "max_temp" } } }
  ],
  "debounce": { "mode": "duration", "raise": 60, "clear": 120 },
  "hysteresis": 2,
  "notify": {
    "recipients": [ { "kind": "role", "role": "ADMIN" }, { "kind": "email", "email": "oncall@example.com" } ],
    "minSeverity": "MAJOR",
    "repeatEverySec": 1800
  },
  "runbook": "Check the cooling fan and the door seal. Clear with a note when fixed.",
  "enabled": true
}

Keys the rules check

When you save, every condition key must be a telemetry key: no spaces and not a bare number (“A key names a telemetry key: no spaces and not a number.”). A key that looks like a number, such as a register number 40001, is accepted if the profile declares it. A key the profile does not declare is only a warning: “Not a telemetry key of this profile: … The rule fires only on devices that send these keys; save is still possible.”

Removing, disabling and renaming

  • Remove asks “Remove type?” and warns “When you save, its open alarms are resolved.” They are resolved when you save.
  • Switching a rule off stops its evaluation. An alarm it already opened stays open until you clear it by hand or switch the rule on again.
  • If you rename a telemetry key in the profile, the profile lists the alarm rules that read the old key and can rewrite them to the new one in one step. Each rewritten rule gets a new version.
  • A profile whose alarm rules exist cannot be deleted until the rules are removed; the delete lists them.

Limits

LimitValue
Rules per profile50
Severities per rule5 (each once)
Comparisons per condition16
Nesting of all/any groups4 levels
Type128 characters, A-Z a-z 0-9 _ . : -
Title300 characters
Runbook10,000 characters
Key128 characters
Text value256 characters
Debounce raise and clear1 to 86,400
Recipients20
Offline delay10 s to 7 days

Beyond thresholds

Alarm rules compare a value with a fixed number or a device attribute. They cannot compute (no “setpoint + 10”), follow a schedule or compare two devices. For that, use a Rules-card rule or a flow, both of which can raise and clear alarms with the same lifecycle. Ready examples: Alarm rule cookbook.