Alarm Management
The Alarm module evaluates live data points against rules and produces actionable alarms. It supports threshold, comparison, and status conditions, multi-channel notifications, escalation tiers, and rich statistics for dashboards.
Interface Screenshot

Captured from the live Smart Site system with the English UI. See the
zh-CNcounterpart for the Chinese-UI screenshot.
1. Core Concepts
- Alarm Rule — A condition attached to a tag that, when true, raises an alarm
- Alarm Event — A concrete occurrence with state (
active,acknowledged,cleared) - Alarm Group — A bundle of related rules for batch acknowledgment and notification routing
- Escalation — A tiered policy that re-notifies or reroutes if an alarm stays unacknowledged
The alarm engine is implemented in @ss-node/ss-alarm and runs as a pipeline step (alarm-check.step.ts) after data is read.
2. Alarm Rule Types
| Type | Trigger Condition | Example |
|---|---|---|
| Threshold | value crosses a numeric boundary | temp > 80 |
| Comparison | value differs from another tag or a setpoint | actual != setpoint |
| Status | value equals a discrete state | motorState == 2 (fault) |
| Device Offline | no heartbeat within the configured window | offline > 60s |
Each rule defines:
- Severity —
low/medium/high/critical - Delay — Minimum duration the condition must hold before raising (debounce)
- Recovery — Auto-clear when the condition becomes false (optional)
3. Functional Areas
3.1 Alarm Rules CRUD
- Create rules per tag from the device detail page or System → Alarms
- Define condition expression, severity, delay, and recovery behavior
- Enable / disable rules without deleting them
- Group rules into alarm groups for collective handling
The ConditionEvaluator parses and evaluates rule expressions safely.
3.2 Alarm Triggering
- The pipeline reads a new value for a tag
AlarmCheckStepfinds rules attached to that tagConditionEvaluatorevaluates each rule- If true beyond the delay,
AlarmDebouncerconfirms the alarm AlarmServicepersists anAlarmentity and emitsalarm.raisedon the EventBus- The WebSocket gateway pushes the alarm to subscribed clients
3.3 Alarm Notifications
Notifications are delivered through pluggable channels that implement NotificationChannel:
| Channel | Implementation | Notes |
|---|---|---|
| (SMTP integration) | HTML templates per severity | |
| SMS | SmsNotificationChannel |
Provider config in system settings |
| Webhook | WebhookNotificationChannel |
POST JSON payload to a URL |
| TTS | TtsNotificationChannel |
Voice call for critical alarms |
Channels are configured globally and selected per alarm group. The AlarmNotificationService fans out an alarm to all enabled channels for its group.
3.4 Alarm Escalation
The AlarmEscalatorService implements tiered escalation:
- Tier 1 — Notify the on-call user immediately
- Tier 2 — If unacknowledged after X minutes, notify the team lead
- Tier 3 — If still unacknowledged after Y minutes, notify the manager / broadcast
Each tier can use different channels. Escalation stops as soon as the alarm is acknowledged.
3.5 Alarm Suppression
To avoid noise during maintenance:
AlarmSuppressionService— suppress alarms for a tag or device for a time windowDeviceOfflineSuppressionService— when a device goes offline, suppress dependent alarms to prevent a storm
3.6 Alarm Statistics and Charts
The AlarmStatisticsService and its controller expose:
- Alarm counts by severity over a time range
- Top N tags with the most alarms
- Mean time to acknowledge (MTTA) and mean time to recover (MTTR)
- Trend charts for the dashboard
4. Operational Guidance
4.1 Acknowledging an Alarm
- Open System → Alarms or watch the realtime alarm banner
- Select the active alarm
- Click Acknowledge — requires the
alarm:ackpermission - Optionally enter a comment
- Escalation stops; the alarm remains active until it clears
4.2 Creating a Threshold Rule
- From the device detail page, pick a tag
- Click Add Alarm Rule → choose Threshold
- Set operator (
>,<,>=,<=,==,!=) and threshold value - Choose severity and delay
- Save — the rule is active immediately
5. FAQ
Q: An alarm fires repeatedly every scan. A: Enable the debounce delay so the condition must hold for a configured duration before re-raising. Also confirm the recovery behavior is set to auto-clear.
Q: Notifications are not being sent.
A: Verify the alarm group has channels enabled and that channel credentials are set in System → Settings. Check the AlarmNotificationService logs for delivery errors.
Q: A device went offline and I got hundreds of alarms.
A: The DeviceOfflineSuppressionService should suppress dependent alarms. Confirm it is enabled and that the offline threshold is reasonable. Suppress the tag manually during maintenance if needed.
Q: How do I mute alarms for planned maintenance?
A: Use AlarmSuppressionService to create a suppression window for the tag or device. Alarms raised during the window are still recorded but suppressed from notification.
6. Related Links
../../03-device/README.md../../09-websocket/README.md../../10-script/README.md- Alarm Package