-
-
Notifications
You must be signed in to change notification settings - Fork 0
Input Messages
The node accepts two kinds of input on its single input port:
readings (sensor values) and commands (control words in
msg.payload). This page owns both.
-
Command gate — if
msg.payloadis a recognized command string (any case), it is handled as a command. Commands always win over value coercion, in both type modes — a command word can never function as a boolean sensor value. -
Topic gate — a non-command message must carry a non-empty
msg.topic(the source's identity). Missing topic → the message is a rejectedreading(ignored: true) on output 4. -
Coercion gate — the payload must coerce under the node's
Type Modes. Failure → rejected
reading(ignored: true, withmsg.rejectedValue). - Accepted — the source's latest value updates, the aggregate recomputes, the appropriate reading-class event emits, and the trigger evaluates. See Events for what fires when.
A reading is any non-command message: msg.topic names the sensor,
msg.payload carries the value. Numeric mode accepts anything
Number() can parse (including numeric strings); Boolean mode matches
against the True/False value lists. Sources are learned automatically
on first reading — see Sources Freshness and Quorum.
All commands are case-insensitive strings in msg.payload.
msg.topic is ignored on commands. Invalid, redundant, or
out-of-place commands are never silently dropped and never logged as
warnings — they emit on output 4 with ignored: true and the
attempted value attached.
| Command | Extra properties | Effect |
|---|---|---|
query |
— | Full state snapshot on output 3. No side effects. |
disable |
— | Freezes latch decisions: a warranted Trigger/Release is suppressed to output 4 with ignored: true. Readings, freshness, and quorum tracking continue. Redundant → ignored: true. |
enable |
— | Unfreezes and immediately re-evaluates: a transition suppressed while disabled fires genuinely at that moment on outputs 1/2 + 4. Redundant → ignored: true. |
reset |
— | Clears learned sources, values, and the latch; returns to waiting. Expected sources stay on the roster as never-seen. Runtime overrides and the disabled flag survive — reset clears data, not configuration. |
remove |
msg.removetopic |
Drops one source (a decommissioned sensor), recomputes, and re-evaluates. Unknown topic → ignored: true with the attempted topic. |
settrigger |
msg.settrigger (+ msg.settriggern for At least N) |
Sets the trigger at runtime. Numeric mode: a number, guarded against the release side when a distinct release exists. Boolean mode: a preset name (any, majority, all, atleastn) or a fraction 0–1. Takes effect immediately. See Trigger and Release. |
setrelease |
msg.setrelease (+ msg.setreleasen) |
Sets the release at runtime; same forms plus sameastrigger. Validated against the trigger direction. Takes effect immediately. |
setstale |
msg.setstale (+ msg.setstaleunits: milliseconds, seconds, minutes, hours) |
Sets the staleness window; 0 disables staleness. Takes effect immediately in both directions — a shrunk window can expire sources on the spot, a widened one can freshen them. See Sources Freshness and Quorum. |
When a distinct release exists, settrigger and setrelease guard
each other symmetrically — a value that would invert the pair is
rejected. To move both thresholds, send the commands in the order that
keeps the pair valid at each step: for Above-mode moving both values
down, setrelease first, then settrigger. Details in
Trigger and Release.
See it all in action: Examples Runtime Commands.
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