The IF / GUARD / DO Model
Model resilient field automation in three deterministic stages:
- IF (Trigger): Attribute threshold, state transition, offline watchdog, or Cron schedule.
- GUARD (Safety Check): Off-peak tariff window, companion sensor health, daily trigger cap, or debounce duration.
- DO (Action): Dispatch downlink RPC commands, open/resolve alarms, or route Email/SMS/Webhook notifications.
Example Closed-Loop Rule
{
"name": "Cooling Tower Conductivity Blowdown",
"trigger": { "attribute": "conductivity_us", "op": ">", "value": 1800, "durationSec": 60 },
"guard": { "makeupValveOk": true, "maxTriggersPerDay": 3 },
"action": { "command": "OPEN_BLOWDOWN_VALVE", "params": { "seconds": 90 } }
}
Concurrency-Safe Updates (Exact CAS)
Rule and action edits use Compare-And-Swap (CAS) version checks so concurrent collaborators never silently overwrite one another’s changes.