Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
Massimo 7557f5ca76 Changed Category vor 5 Jahren
boolean-logic-ultimate Changed Category vor 5 Jahren
.gitattributes Initial commit vor 5 Jahren
.gitignore Fixed persistent state deletion upon node update/delete vor 5 Jahren
CHANGELOG.md Delete persistent states when a new unexpected topic arrrives vor 5 Jahren
LICENSE Update LICENSE vor 5 Jahren
README.md Badges vor 5 Jahren
package-lock.json Initial Release vor 5 Jahren
package.json Delete persistent states when a new unexpected topic arrrives vor 5 Jahren

README.md

node-red-contrib-boolean-logic-ultimate

NPM version NPM downloads per month NPM downloads total MIT License JavaScript Style Guide

DESCRIPTION

The node performs Boolean logic on the incoming payloads.
The node performs 3 checks (AND,OR,XOR) on the incoming boolean payloads and outputs the result at the same time, as follow:

  • Output “AND”: true or false
  • Output “OR”: true or false
  • Output “XOR”: true or false

The node can have a persistent input: the input values are retained after a node-red reboot. That means, that if you reboot your node-red, you don’t need to wait all inputs to arrive and initialize the node, before the node can output a payload.

CHANGELOG

CONFIGURATION

The node expects a fixed number of topics (configured in the settings) on which it will operate. It will only output a value when it has seen the expected number of topics. If it ever sees more than the configured number of topics it will log a message then reset its state and start over.
Changing the topic is usually only needed when chaining multiple boolean nodes after each other becuse the topics will then all be the same when delivered to the nodes further down the chain.

Filter output result

  1. Output both 'true' and 'false' results: Standard behaviour, the node will output true and false whenever it receives an input and calculate the boolean logics as output.
  2. Output only 'true' results: whenever the node receives an input, it outputs a payload true only if the result of the logic is true. False results are filtered out.

Remember latest input values after reboot
If checked, the input values are retained after a node-red reboot. That means, that if you reboot your node-red, you don't need to wait all inputs to arrive and initialize the node, before the node can output a payload.
Every time you modify the node's config, the retained values are cleared.

All incoming msg.payloads are converted into a boolean value according to the following rules (this applies to all boolean logic nodes):
  1. Boolean values are taken as-is.
  2. For numbers, 0 evaluates to false, all other numbers evaluates to true.
  3. Strings are converted to numbers if they match the format of a decimal value, then the same rule as for numbers are applied. If it does not match, it evaluates to false. Also, the string "true" evaluates to true.

The XOR operation operates in a one, and only one mode, i.e. (A ^ B) ^ C ... ^ n