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
- Open Device Profiles and open a profile.
- 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
- Click Add rule and choose Threshold rule or Device offline rule, or click Edit on a rule.
- Fill in the drawer (see below). Switch between Form and JSON at the top.
- Click Add to list (new rule) or Update the list.
- Repeat for other rules. The tab shows “n rules changed and not saved yet: nothing applies until you save.”
- 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
| Field | What you set |
|---|---|
| Type | The 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 title | What people see, at most 300 characters. Placeholders: {{device.name}}, {{value}}, {{key}}, {{threshold}}, {{severity}}, {{type}}. A new rule starts with {{device.name}}: {{value}}. |
| Enabled | On or off. |
| Severity | One 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. |
| Key | A telemetry key. The box offers the profile’s declared keys and takes free text. |
| Operator | >, >=, <, <=, ==, !=. |
| Value | A number, true or false, a text, or attribute:<name> for a per-device limit. |
| Only from topic | Under Advanced: compare only messages from this MQTT topic. Empty = any topic. |
| How long the condition must hold | Count 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. |
| Runbook | Text 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
| Field | What you set |
|---|---|
| Alarm title | Default {{device.name}} is offline. |
| Open after (seconds offline) | 10 to 604,800 (7 days). Default 600. |
| Severity | Default Warning. |
| Runbook, Enabled | As 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:
| Part | JSON field | Page |
|---|---|---|
| Combined conditions (several comparisons with all/any) | severities[].condition with all / any | Alarm conditions reference |
| An explicit clear condition | clear | Clear conditions and late readings |
| Dampening settings | dampening | Debounce, hysteresis and dampening |
| Notifications: recipients, channels, minimum severity, reminders | notify | Alarm notifications in depth |
| Replaying out-of-order readings | evaluateBackfill | Clear 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
| Limit | Value |
|---|---|
| Rules per profile | 50 |
| Severities per rule | 5 (each once) |
| Comparisons per condition | 16 |
| Nesting of all/any groups | 4 levels |
| Type | 128 characters, A-Z a-z 0-9 _ . : - |
| Title | 300 characters |
| Runbook | 10,000 characters |
| Key | 128 characters |
| Text value | 256 characters |
| Debounce raise and clear | 1 to 86,400 |
| Recipients | 20 |
| Offline delay | 10 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.

