-
-
Notifications
You must be signed in to change notification settings - Fork 0
Examples Runtime Commands
mchristegh edited this page Jul 15, 2026
·
1 revision
Every aspect of the node driven by message at runtime: the disable/enable suppression cycle, moving thresholds live (including a deliberate rejection), changing the staleness window, removing a source, and reset.
Import: Import → Examples → node-red-contrib-sensor-consensus → 04-runtime-commands.
Demonstrates: Input Messages (the full command set) and Trigger and Release (release-follows-trigger and the symmetric guards).
-
Press
sensorA = 58andsensorB = 59. Mean 58.5 — untriggered baseline. -
Press
disable, thensensorA = 66. The mean is now 62.5, which warrants a Trigger — but the node is disabled, so output 1 stays silent and output 4 showstriggeredwithignored: true. Disable freezes decisions, not data: the reading was accepted and the aggregate moved. -
Press
enable. The suppressed transition fires genuinely, right now, on outputs 1 + 4 — the enable command re-evaluates immediately. -
Press
settrigger 70. With no distinct release configured at runtime, the release follows the trigger — and because set-commands re-evaluate in place, the latched node releases on the spot (62.5 < 70). One command, observable consequence. -
Press
setrelease 65, thensettrigger 50. The second command is rejected (triggersetwithignored: true,triggerSet: 50): 50 sits on the wrong side of the now-distinct release 65. Thresholds guard each other symmetrically — see Trigger and Release for the pair-move ordering that makes big moves possible. -
Press
setstale 30s. Sources now expire after 30 seconds of silence — wait it out and watchsourcestalearrive on output 4. -
Press
remove sensorAto drop a decommissioned sensor (the node recomputes and re-evaluates), andresetto clear everything back towaiting. Note that thesettriggeroverride survives the reset — reset clears data, not configuration. -
Press
queryat any point to see the current state of all of the above in one snapshot on output 3.
- No command failure in this flow is silent, and none appears in the
Debug sidebar as a warning — rejections are
ignored: trueevents on output 4 with the attempted value attached, so your flows can react to them like anything else. - Commands are case-insensitive; the
disableinject actually sendsDISABLEin the original flow to prove it.
Getting Started
Reference
Features
Examples
- Examples Basic Numeric Averaging
- Examples Staleness and Quorum
- Examples Boolean Voting
- Examples Runtime Commands
Test Script Coverage
- Overview
- Test Suite 1 — Output routing & envelope shape
- Test Suite 2 — Aggregation functions
- Test Suite 3 — Boolean mode
- Test Suite 4 — Commands
- Test Suite 5 — Threshold set-commands & release-follows-trigger
- Test Suite 6 — Status labels
- Test Suite 7 — Staleness, quorum policies, heartbeat
- Test Suite 8 — Persistence
Support