Alert Rules
Overview
WEDA's monitoring workflow has two parts that work together:
- Alert Rule — evaluates incoming values from a data object against trigger and reset conditions
- Notification Channel — defines how an alert message is delivered, such as by email, Teams, LINE, or webhook
You define alert rules on specific data objects, and each rule references one or more notification
channels by channelId. When the trigger condition is met for the configured delay, WEDA sends the
alert message through the selected channels. See Notification Channels
to configure delivery endpoints first.
An Alert Rule monitors a specific data-object value on a device. WEDA evaluates the rule whenever new telemetry arrives.
Each rule has three evaluation parameters:
| Parameter | Description |
|---|---|
alertLevel | A comparison expression that defines when an alert is triggered, such as >=75 |
alertResetLevel | A comparison expression that defines when the value has returned to its normal range, such as <70 |
delay | The number of seconds to wait before sending the alert after the trigger condition is first met |
When the trigger condition is first met, WEDA starts the delay timer. If a new value meets the reset condition before the timer expires, the pending alert is canceled. Otherwise, WEDA sends the alert when the timer expires.
Deduplication only applies during the delay window. Once the alert has fired, WEDA does not wait for the reset condition before evaluating again — if the anomaly persists, subsequent evaluations can trigger additional alerts. Design your notification handling to tolerate repeated alerts for a sustained condition.
Supported conditions
Alert conditions support numeric, Boolean, and string values. Include the comparison operator in the condition string.
| Data type | Trigger condition example | Reset condition example |
|---|---|---|
| Number | >=75 | <70 |
| Boolean | ==true | ==false |
| String | =="error" | !="error" |
Supported comparison operators include >, >=, <, <=, ==, and !=. The condition must be
compatible with the data object's dataType. Only a single comparison expression is supported per
condition — compound conditions using && or || are not supported.
Operations
Alert rules are scoped to a specific data object on a device.
| Operation | API | Description |
|---|---|---|
| Create Alert Rule | POST /api/v1/devices/{deviceId}/data-objects/{dataObjectId}/alert-rules | Define a new rule |
| List Alert Rules | GET /api/v1/devices/{deviceId}/data-objects/{dataObjectId}/alert-rules | List rules on a data object |
| Get Alert Rule | GET /api/v1/devices/{deviceId}/data-objects/{dataObjectId}/alert-rules/{alertRuleId} | Get one rule by ID |
| Update Alert Rule | PATCH /api/v1/devices/{deviceId}/data-objects/{dataObjectId}/alert-rules/{alertRuleId} | Update rule or notification settings |
| Delete Alert Rule | DELETE /api/v1/devices/{deviceId}/data-objects/{dataObjectId}/alert-rules/{alertRuleId} | Remove an alert rule |
| Update Rule Status | PUT /api/v1/devices/{deviceId}/data-objects/{dataObjectId}/alert-rules/{alertRuleId}/status | Enable or disable a rule without deleting it |
Create Alert Rule
POST /api/v1/devices/{deviceId}/data-objects/{dataObjectId}/alert-rules
See Create Alert Rule for the full field reference.
Response 201 Created
Notification message
The notification object is required. Specify the destination with channelIds and recipients,
then use one of the following methods to define the message:
- Provide
templateIdand, when required by the template,variables. - Provide both
subjectandcontentdirectly.
Do not combine templateId with subject or content in the same request.
dataObjectName matches the targetThe current release does not cross-validate the URL's dataObjectId against the request body's
dataObjectName — dataObjectId scoping is not yet enforced server-side. Make sure
dataObjectName accurately identifies the data object you intend to target. A future release will
enforce ID-based scope validation.
Update Alert Rule
PATCH /api/v1/devices/{deviceId}/data-objects/{dataObjectId}/alert-rules/{alertRuleId}
See Update Alert Rule for the full field reference.
delay is not preserved if omittedIf a PATCH request does not include delay, it is reset to 0 — not left unchanged. This applies
even to a notification-only update (e.g. changing only channelIds or the message content):
omitting delay still resets it. Always include the rule's current delay value in every PATCH
request unless you intend to change it to 0.
Scenario
A monitoring engineer sets up a temperature alert on a factory device. The temperature sensor
(AI_0) should send an alert if its value reaches 75°C and does not return below 70°C during the
10-second delay:
Constraints
alertLevelandalertResetLevelmust be valid expressions compatible with the data object'sdataType.alertLevelandalertResetLevelmust not be identical. Define distinct trigger and recovery ranges to avoid alert oscillation.channelIdsmust reference existing notification channels.- Disabling a rule stops it from evaluating new telemetry without deleting the rule configuration.
- Only one Alert Rule can exist per Device + Data Object combination — you cannot create multiple rules with different conditions or notification settings on the same data object.
Related
- Find the
dataObjectIdto attach a rule to: Data Objects - Set up notification channels: Notification Channels
- Apply a rule to a computed value: Transfer Functions