Skip to content

Trigger and Release

mchristegh edited this page Jul 15, 2026 · 1 revision

The decision core: how the aggregate becomes a latched trigger, and every rule around moving the thresholds.

The latch

The trigger latches: output 1 fires exactly once per untriggeredtriggered transition, stays silent while latched (the aggregate keeps flowing on output 4), and re-arms only when output 2 fires. If your Trigger output seems to have "stopped working," check whether the node is simply still latched — msg.consensusState on any event or a query will tell you.

Numeric mode

  • Direction. Trigger When selects rising (aggregate ≥ trigger value) or falling (aggregate ≤ trigger value). "Humidity too high" is Above; "freezer too warm is temperature too low" style automations are Below.
  • Hysteresis. The Release Value sits on the opposite side of the trigger and uses strict inequality (Above-mode releases when the aggregate drops below the release value). With no hysteresis, an aggregate sitting exactly on the threshold therefore stays latched instead of flapping.
  • Blank values. A blank Trigger Value means not set — the node reports but never triggers. A blank Release Value means same as trigger.

Release-follows-trigger

When no distinct release exists (blank, or equal to the trigger, and no setrelease override), the effective release is the effective trigger, dynamically: a runtime settrigger moves both together, so a no-hysteresis threshold can be moved freely.

Once a distinct release exists, settrigger and setrelease guard each other symmetrically: a value that would put the pair on the wrong side of each other is rejected (ignored: true, attempted value attached), because an inverted pair fires Trigger and Release on every reading in the band — exactly the flapping hysteresis exists to prevent.

Moving both thresholds of a hysteresis pair: send the commands in the order that keeps the pair valid at each step. Above-mode, moving both down: setrelease first, then settrigger. Above-mode, moving both up: settrigger first.

Misconfigured pairs are sanitized. If the dialog is saved with the release on the wrong side of the trigger, the node startup ignores the release (treats it as same-as-trigger) and logs a single warning to the Debug sidebar — the only warning this node ever logs.

Boolean mode

The trigger rule is a vote over the fresh sources:

Rule Satisfied when
Any at least one fresh source is true
Majority fraction ≥ 0.5 — note an exact split holds a latch
All every fresh source is true
At least N at least N fresh sources are true

The Release Rule defaults to Same as trigger: release the moment the trigger rule stops being satisfied. Choosing a looser release rule — trigger on All, release below Majority — is the boolean form of hysteresis: one flaky sensor can no longer toggle your output.

Runtime overrides accept a preset name (atleastn needs its count in msg.settriggern / msg.setreleasen) or a raw fraction 0–1. See Input Messages for the command forms.

Set-commands act immediately

settrigger and setrelease re-evaluate on the spot — if the current aggregate satisfies the new threshold, the transition fires right then, without waiting for the next reading.

See it in action: Examples Basic Numeric Averaging (hysteresis), Examples Boolean Voting (vote rules), and Examples Runtime Commands (moving thresholds live, including a deliberate wrong-side rejection).

Clone this wiki locally