AND Gate with Dynamic Inputs
This is a custom Node-RED function node that implements an AND gate with dynamic inputs. The AND gate requires all input values to be true in order to produce a true output. The function node accepts messages with msg.payload and msg.input properties, and maintains the state of the input values across multiple messages.
Node Name: AND-gate
User Guide Summary:
The AND-gate node has 1 output.
When triggered, the AND-gate node compares the selection quantity to the input quantity. When all inputs are true, it will emit a true value.
It accepts 1 input, and is driven by the ‘input-select’ node.
Where each ‘input-select’ node represents a virtual input on the corresponding AND-gate.
If you wish to skip the input-select node:
Accepts a msg.payload of type JSON Object, i.e:
{"Input":1,"Value":true}
{"Input":2"Value":true}
If both inputs are true, and the quantity of inputs in the AND-gate is exceeded, it will emit a true value: {"Value":true} , else it will emit {"Value":false}.