OTDeck

Docs · Commissioning tools

Watch rules

A watch rule keeps an eye on one value and tells you when something is wrong: a temperature above a limit, a pressure outside its band, a counter that stopped updating, a point that reports a fault. Rules in the title bar opens the panel; the number next to it is how many rules you have, and a red count appears only while a rule is in alarm.

What a rule watches

The same values as the trend panel:

  • MQTT: one topic (no + or #), the bare payload or a JSON field (value, a.b[2].c), or a Sparkplug B metric;
  • Modbus: a register of a polled range (the range and the address);
  • OPC UA: a node of the watch list;
  • BACnet: the present value of an object (analog-input:1; OTDeck adds the device when the connection is open).

Copy the source of a trend in the dialog takes the source, the label and the unit of a series already on the trend panel.

Rules do not poll anything. They are evaluated in the app on the values the connection already receives (MQTT messages, Modbus polls, OPC UA data changes, BACnet COV or polls). A rule whose value does not arrive says Not receiving values and why: the connection is closed, the OPC UA node or BACnet object is not on the watch list (Add to watch list fixes that), the Modbus register is not in a polled range, or the MQTT topic is not subscribed.

Conditions

Condition Goes active when Clears when (deadband D)
Above X value > X value ≤ X − D
Below X value < X value ≥ X + D
Outside low–high value < low or value > high low + D ≤ value ≤ high − D
Inside low–high low ≤ value ≤ high value < low − D or value > high + D
Equals X |value − X| ≤ D (D is the tolerance) |value − X| > D
Changes |value − previous value| > D the next value does not change by more than D
No update (stale) no value for N seconds (after the first one) a value arrives
Bad quality or fault OPC UA bad status, BACnet fault flag or bad read, failed Modbus poll, MQTT payload that is not a number a good value arrives

A bad value never moves a value condition (above, below, bands, equals, changes). The deadband of Outside must be less than half the band, or the rule could never clear.

On-delay: the condition must hold this many seconds before the rule goes active; a short spike does not count. For stale the delay counts from the moment the value went stale.

States

normal → active (since when, at which value) → acknowledged → normal. Ack acknowledges an active rule; when the condition clears the rule returns to normal, acknowledged or not (the event log says which). Editing a rule starts it again from normal.

Colours follow ISA-101: everything is grey; only a rule in alarm is coloured, red while not acknowledged and amber once acknowledged.

Mute (the ⋯ menu: 15 minutes, 1 hour, 8 hours) holds back a rule’s notifications. Its state and the event log go on as usual.

Notifications

When a rule goes active OTDeck sends a system notification (macOS, Windows, Linux) with the rule, the condition, the value and the connection; clicking it brings OTDeck forward. The sound is off unless the rule asks for it (With sound). Notifications are limited so a flapping value cannot flood the screen: at most one per rule every 10 seconds and 10 in any minute; what the minute’s limit holds back is sent as one “N more rule notifications” summary. macOS asks once for permission; if it is declined the panel still shows everything.

Where it is kept

  • rules.json in the app directory: the rules (versioned like trends.json). Each rule names its connection; rules of connections deleted in the meantime are dropped on the next start. A damaged file or one from a newer OTDeck is set aside as rules.json.bad.
  • rule-events.jsonl: every state change (time, rule, connection, from, to, value, condition). It rotates at 1 MiB into rule-events.1.jsonl, so the two files stay under 2 MiB.
  • The Events tab shows the last 200 transitions since OTDeck started.
  • The commissioning report has a Watch rule events section with the transitions of the period.

Limits

  • Free: 2 rules; Pro and Team: up to 200. On Free a third rule is refused with one line about Pro; after a downgrade the rules past the second stay in the list as Paused (Free plan) and are not evaluated.
  • Names up to 120 characters, units 32, topics 1 024; thresholds must be finite numbers; on-delay and stale times up to 24 hours.
  • Agents (otdeck-mcp) do not see or change rules.