Logic blocks

The four blocks that combine and test conditions. They have no settings worth speaking of — the interesting part is how they remember values between events.

1.AND and OR

Two inputs, one output. AND is true when both are true; OR is true when either is.

Detail
InputsTwo pins, labelled A and B.
OutputTrue or false.
ParametersNone.

How they remember

This is the part that trips people up. The block does not wait for both inputs to arrive together. It stores the last value seen on each pin and re-evaluates every time either one changes.

  • A pin that has never received a value counts as false. So an AND whose second input has not fired yet is false, not "waiting".
  • Only pins that are actually wired are counted. An unwired pin is not treated as a permanent false that blocks the gate.
  • The output is re-sent on every input event, even when the answer has not changed.
Because the result is re-sent on every event, do not wire an AND straight into something expensive or audible. A sensor chattering on one input will keep re-firing the gate. Put a Delay or a Delayed on/off in between, or drive a block that only acts on change.
For "motion AND after sunset", wire the motion trigger to one pin and a Time condition to the other. The Time condition answers immediately when asked, so the gate always has a current value for it.

2.NOT

Inverts whatever arrives.

Detail
InputOne pin.
OutputThe opposite: true becomes false, false becomes true.
ParametersNone.

It keeps no state at all — each value that arrives is inverted and sent straight on. Until something arrives it has never run and has no output.

The commonest use is a window contact: the contact reports open as true, and a NOT turns that into "closed" for a gate that should only act with the window shut.

3.Compare

Turns a number into a true or false — the block that makes a temperature or a lux reading usable as a condition.

Detail
InputOne pin — the value to test.
OutputTrue or false.
ParametersOperator and Value — the fixed number to compare against.
OperatorTrue when
equalsThe input equals the value.
not equalsThe input differs from the value.
>The input is greater.
≥The input is greater or equal.
<The input is less.
≤The input is less or equal.
  • The comparison value is fixed in the block — it cannot be wired from another block. To compare two live values, subtract them upstream or use separate gates.
  • Values are compared as numbers. A reading that is not a number will not satisfy a greater-than or less-than test.
  • It evaluates and emits on every value that arrives.
Compare is what gives you the daylight lock the Lighting Controller does not have yet: lux sensor → Compare (< 30) → AND with the motion trigger.

4.What counts as true

Every logic block converts whatever arrives into true or false the same way.

ValueTreated as
true, 1True
false, 0False
"true", "1", "on", "yes"True
"false", "0", "off", "no"False

A number is measured against zero, whether it arrives as a number or as text: 0, "0" and "0.0" are all false, and any other value is true. A dimmer at 0 % therefore reads as off, as you would expect.

Text that is not a number and not one of the words above is treated as true — a status string such as "closed" will satisfy a gate. Where a device reports words rather than a clean on/off, put a Compare block in front of the logic rather than feeding it in raw.