Alarm Management
ThinkLink provides a built-in alarm system that allows devices and assets to raise, track, and clear alarm events. Alarms are triggered by the Trigger Model through the ALARM RPC, and can optionally send email notifications to configured groups.
1.1. Overview
The alarm workflow consists of three parts:
- Trigger Model — runs after each uplink, evaluates conditions, and calls the
alarmRPC withaction: "new"oraction: "clear". - ALARM RPC — the built-in
ALARMfunction processes the call and creates or clears the alarm record in the platform. - Alarm Management UI — the operations team views active alarms, inspects history, and manually clears alarms when needed.
1.2. Alarm Levels
| Level | Description |
|---|---|
low | Informational. No immediate action required. |
mid | Warning. Should be investigated. |
high | Error. Requires prompt attention. |
urgent | Critical. Immediate action required. |
1.3. Configuring Alarms
Step 1 — Mount the ALARM RPC
ThinkLink includes a built-in general-purpose alarm RPC named ALARM. Mount it on the target device or asset:
Path: Maintenance → Device Management → [select device] → Details → RPC → Add
Select ALARM from the list. The ALARM RPC accepts the following parameters (all passed from the trigger model):
| Parameter | Description |
|---|---|
name | Unique alarm event name. |
action | "new" to raise, "clear" to resolve. |
title | Alarm title displayed in the UI. |
desc | Alarm description. |
level | Severity: "low", "mid", "high", or "urgent". |
notify | Array of notification group names [...]. Dispatched per group when the alarm is raised or cleared. |
Step 2 — Configure a Trigger Model
Write a trigger script that evaluates device telemetry and returns an actions array calling the alarm method. Mount the trigger model on the same device.
See Trigger Model for the full script reference and examples.
Step 3 — (Optional) Configure Email Notification Groups
To receive email alerts, configure a notification group in:
Path: System Management → Notification Groups
Store the group names on the device (e.g. device.server_attrs.notify) as a plain array, read it inside your trigger script, and pass it as the notify parameter to the alarm RPC.
1.4. Alarm Event Lifecycle
Uplink data arrives
│
▼
Trigger script runs
│
condition met? ──No──▶ return null (no action)
│ Yes
▼
action = "new"
ALARM RPC called
│
alarm already identical? ──Yes──▶ suppressed (no duplicate)
│ No
▼
Alarm record created
Email sent (if group configured)
│
▼
condition clears
action = "clear"
ALARM RPC called
│
▼
Alarm record resolved1.5. Viewing Alarms
Path: Alarm → Alarm List
The alarm list displays all active and historical alarm events with the following fields:
| Field | Description |
|---|---|
| Alarm Name | The unique alarm_name of the event. |
| Device | The device or asset that raised the alarm. |
| Title | The alarm title. |
| Level | Severity level with color coding. |
| Description | Detailed description of the alarm. |
| Created At | Timestamp when the alarm was first raised. |
| Status | Active or Resolved. |
1.6. Clearing Alarms
1.6.1. Automatic Clear via Trigger Script
The recommended approach is to handle both raising and clearing in the same trigger script. Set action to "clear" by default, and only switch to "new" when the condition is met. Each uplink then automatically clears the alarm once the condition is no longer satisfied — no manual action required.
let action = ACTION.clear; // default: clear
if (tdata.temperature >= 80) {
action = ACTION.new; // condition met: raise alarm
}1.6.2. Checking Whether an Alarm Is Active
Inside an RPC script (not the trigger script), use the alarms input parameter to inspect the current active alarms for the device:
function rpc_script({ device, params, alarms, logger }) {
let alarmInfo = alarms["high_temp_alarm"];
if (alarmInfo !== undefined) {
// The alarm is currently active
// alarmInfo.title, alarmInfo.level, alarmInfo.desc are available
} else {
// No active alarm with this name
}
}alarms is a key–value map, keyed by alarm_name. A key present in the map means the alarm is active; a key absent (or undefined) means no alarm is raised.
The ALARM RPC also uses alarms internally for deduplication: if an identical alarm (same name, title, desc, and level) is already active, a repeated "new" action is suppressed automatically.
1.6.3. Manually Clearing an Alarm
If the trigger condition has been resolved but the platform alarm was not automatically cleared (e.g. the clear action was not configured), an operator can manually clear the alarm:
- Navigate to
Alarm → Alarm List. - Locate the target alarm entry.
- Click Clear in the operation column.
- The alarm status changes to
Resolvedand is removed from the active alarm view.
1.7. Complete Configuration Example
The following shows a full end-to-end alarm setup for a fill-level sensor.
Device server_attrs (set via RPC or platform UI):
{
"alarm_depth": 20,
"notify": ["ops-team"]
}Trigger Model script:
function trigger_script(device, thingModelId) {
const ACTION = { no: "no", new: "new", clear: "clear" };
let tdata = device?.telemetry_data?.[thingModelId];
if (tdata?.depth === undefined) { return null; }
let name = "low_level_alarm";
let title = "Low Level: [" + device.name + "]";
let level = "high";
let desc = "";
let action = ACTION.clear;
let notify = device?.server_attrs?.notify ?? [];
if (tdata.depth <= device.server_attrs?.alarm_depth) {
desc = "[" + device.name + "] fill level is critically low";
action = ACTION.new;
}
return {
delayms: 0,
abort_previous_timer: true,
actions: [{
method: "alarm",
params: {
_eui: device.eui,
action: action,
name: name,
title: title,
level: level,
desc: desc,
notify: notify
}
}]
};
}ALARM RPC (built-in, no modification needed) is mounted on the device with method name alarm.
✅ Once configured, the alarm will be raised automatically every time
depthdrops below the threshold, and cleared when it recovers. Each uniquenamerepresents an independent alarm event — multiple alarm types can coexist on the same device.