Skip to content

Input Messages

mchristegh edited this page Jul 15, 2026 · 1 revision

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.

How a message is processed (gating order)

  1. Command gate — if msg.payload is 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.
  2. Topic gate — a non-command message must carry a non-empty msg.topic (the source's identity). Missing topic → the message is a rejected reading (ignored: true) on output 4.
  3. Coercion gate — the payload must coerce under the node's Type Modes. Failure → rejected reading (ignored: true, with msg.rejectedValue).
  4. 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.

Readings

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.

Commands

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.

Moving a hysteresis pair at runtime

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.

Clone this wiki locally