Type: how-to · Last reviewed: 2026-07-18
Applies to: Pulse Historian · edge/on-prem · managed cloud
Goal: raise an alarm when a tag crosses a limit — either automatically from the tag's engineering limits, or explicitly via the monitor API.
Prerequisites:
https://<plant-server>:3030) and a token — see Query from the terminal § Get a token.tagmeta). Canonical example: steam_temp on acme-power / plant-1 / boiler-2./exactapi/monitor/* route returns 501 if it failed to init).There are two ways to get a rule. Most of the time you want the first.
You rarely write rules by hand. When you save a tag's metadata with a low/high limit (limLo / limHi), the monitor auto-creates the matching threshold rule.
Set the high limit on steam_temp via its tagmeta record (metadata CRUD):
curl -k -X PUT "https://plant-server:3030/exactapi/tagmeta/$TAGMETA_ID" \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{"limHi": 540}'
// → 200
{ "id": "…", "dataTagId": "steam_temp", "limHi": 540, "unitsId": 8 }
The monitor picks this up and creates an AllOfN, > 540 rule for steam_temp. Nothing else to do.
Changing
limHilater force-closes any open alarms on the old rule and the new threshold takes over — the alarm config tracks your engineering limits automatically. Detail → Monitor § threshold-change alarm close.
Use this when you need a rule type other than a plain threshold (e.g. tolerate noise with KOfN), or a custom window.
POST the rule. collection_id is the org/site/unit/grid 4-tuple:
curl -k -X POST https://plant-server:3030/exactapi/monitor/rule \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{
"collection_id": "acme-power/plant-1/boiler-2/default_grid",
"tag_index": 4, "tag_name": "steam_temp",
"name": "steam_temp - High Limit",
"rule_type": "AllOfN",
"rule_config": { "threshold": 540.0, "comparison": "GreaterThan" },
"window_duration_ms": 60000
}'
// → 201
{ "id": "3f2a…-uuid" }
Pick the rule_type that fits the signal — full rule_config shapes for KOfN, Percentage, and GOAT are in the Monitoring API § Rules:
| Rule type | Fires when | Good for |
|---|---|---|
AllOfN |
every point in the window breaches | steady limits |
KOfN |
≥ k of n points breach | noisy signals |
Percentage |
≥ X % of present points breach | sample-rate-independent |
GOAT |
value approaches a known record within a margin | approach-to-limit warnings |
List rules for the tag and confirm yours is there and enabled:
curl -k "https://plant-server:3030/exactapi/monitor/rule?collection_id=acme-power/plant-1/boiler-2/default_grid&tag_index=4" \
-H "Authorization: Bearer $TOKEN"
Then drive the tag past the threshold (or wait for real data) and check for an open alarm:
curl -k "https://plant-server:3030/exactapi/monitor/alarm/events/active" -H "Authorization: Bearer $TOKEN"
{ "events": [ { "rule_type": "AllOfN", "threshold": 540.0, "trigger_value": 543.2, "status": "OPEN" } ], "total_count": 1 }
When the alarm opens, an operator is also notified (bell badge, desktop toast, live browser feed) — see How you get notified.
| Symptom | Cause | Fix |
|---|---|---|
Every /monitor/* call → 501 |
Monitor subsystem didn't initialize | Check server logs; confirm the DB is up |
400 on rule create |
Missing required field or bad comparison |
comparison ∈ GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, Equal, NotEqual |
| Rule created but never fires | Wrong tag_index, or window too short vs sample rate |
Verify tag_index/tag_name; widen window_duration_ms |
Auto-rule not created after setting limHi |
Limit written to the wrong tagmeta, or value non-numeric |
Confirm the tagmeta row's dataTagId/unitsId; send a numeric limit |