Skip to content

Type Modes

mchristegh edited this page Jul 15, 2026 · 1 revision

The node operates in exactly one of two modes, selected in the edit dialog — never inferred per message. One node instance = one type mode = one group of like sensors. Mixing humidity readings and door contacts in a single instance has no coherent meaning; deploy one instance per group.

Numeric mode

Payloads are converted with Number() — real numbers and numeric strings ("21.5") both coerce; anything else is a rejected reading (ignored: true, with msg.rejectedValue).

The aggregate is the configured function over the fresh sources' latest values:

Function Behavior
Mean Arithmetic mean
Median Middle value (odd count) or average of the two middle values (even count) — a robust default for 3+ noisy sensors
Min / Max Worst-case style automations
Trimmed Mean Drops the single highest and single lowest fresh value, then averages the rest. Requires ≥ 3 fresh sources; below that it silently falls back to Mean — and says so honestly, reporting mean(fallback) in msg.aggregation rather than pretending.

Boolean mode

The aggregate is the fraction of fresh sources reporting true (0.0–1.0), and the thresholds become vote rules — see Trigger and Release.

Coercion is case-insensitive and whitespace-trimmed, against two configurable lists:

List Default
True Values true, on, yes, 1
False Values false, off, no, 0

Native booleans true/false and the numbers 1/0 always coerce regardless of the lists. Anything matching neither list is a rejected reading — an unrecognized value never silently skews the vote.

Two rules that surprise people:

  • Custom lists replace the defaults. Configure open / closed for door contacts and a sensor sending "true" is now rejected. Include the defaults in your lists if you want both vocabularies.
  • Command words always win. A payload of reset (any case) is the reset command even in Boolean mode, even with a topic — so command words can never be used as sensor values. See Input Messages.

Choosing a mode for edge cases

  • On/off states reported as 0/1 numerics can go either way: Boolean mode gives you vote rules and minority reports; Numeric mode with Mean gives you the same fraction as a plain number.
  • String states beyond two values (e.g. open/closed/tilted) are not supported in this version — that enum/most-common-value mode is a recorded deferral in the design document.

See it in action: Examples Basic Numeric Averaging (numeric) and Examples Boolean Voting (boolean, with custom lists).

Clone this wiki locally