Nodes to perform boolean and arithmetic operations on input signals.
If the msg property invalid
is present in the message, all nodes ignore the message.
$ npm install @mschaeffler/node-red-logic
Converts payload to a bool value:
type | value | is converted to |
---|---|---|
bool | false | false |
true | true | |
number | 0 | false |
1 | true | |
string | false | false |
0 | false | |
off | false | |
true | true | |
1 | true | |
on | true |
The message property to be used as payload can be defined with the Property
property.
msg. | type | description |
---|---|---|
payload | input value. |
msg. | type | description |
---|---|---|
payload | boolean | bool value of payload. |
config | type | description |
---|---|---|
Property | string | defines the message property to be used as payload. |
Status | boolean | shows the actual value as a node status. |
Combines two or more boolean vales with the or
operator.
The input values are converted as described in the to bool
node.
The different inputs are differentiated by topics.
The message property to be used as payload can be defined with the Property
property.
msg. | type | description |
---|---|---|
topic | string | name of the input channel. |
payload | boolean | input value for topic . |
msg. | type | description |
---|---|---|
payload | boolean | result of or of all input topics. |
count | number | number of data elements. |
config | type | description |
---|---|---|
Topic | string | defines the topic for the output message. |
Property | string | defines the message property to be used as payload. |
min. Data | number | min. amount of topics to generate an output. |
Combines two or more boolean vales with the and
operator.
The input values are converted as described in the to bool
node.
The different inputs are differentiated by topics.
The message property to be used as payload can be defined with the Property
property.
msg. | type | description |
---|---|---|
topic | string | name of the input channel. |
payload | boolean | input value for topic . |
msg. | type | description |
---|---|---|
payload | boolean | result of and of all input topics. |
count | number | number of data elements. |
config | type | description |
---|---|---|
Topic | string | defines the topic for the output message. |
Property | string | defines the message property to be used as payload. |
min. Data | number | min. amount of topics to generate an output. |
A node that just count the messages.
msg. | type | description |
---|---|---|
count | number | number of messages. |
Converts payload to a number.
The message property to be used as payload can be defined with the Property
property.
msg. | type | description |
---|---|---|
payload | input value. |
msg. | type | description |
---|---|---|
payload | number | number value of payload. |
config | type | description |
---|---|---|
Property | string | defines the message property to be used as payload. |
Status | boolean | shows the actual value as a node status. |
Combines two or more streams of data (topics) into one single value.
Each stream can be debounced by arithmatic mean.
The different inputs are differentiated by topics.
The message property to be used as payload can be defined with the Property
property.
msg. | type | description |
---|---|---|
topic | string | name of the input channel. |
payload | number | input value for topic . |
msg. | type | description |
---|---|---|
payload | number | result of combining of all input topics. |
count | number | number of data elements. |
config | type | description |
---|---|---|
Topic | string | defines the topic for the output message. |
Property | string | defines the message property to be used as payload. |
min. Mean | number | min. amount of values for the arithmatic mean of one topic. |
max. Mean | number | max. amount of values for the arithmatic mean of one topic. |
min. Data | number | min. amount of topics to generate an output. |
Algorithm | string | algorithm to combine the values. |
algorithm | description |
---|---|
add | ads up the topic channels |
mean | averages the topic channels |
prod | multiplies the topic channels |
min | gets the minimal value of the topic channels |
max | gets the maximal value of the topic channels |
Calculate statistical values of one or more data streams.
Each stream can be debounced by arithmatic mean.
If the msg property invalid
is present in the message, all nodes ignore the message.
The different inputs are differentiated by topics.
The message property to be used as payload can be defined with the Property
property.
msg. | type | description |
---|---|---|
topic | string | name of the input channel. |
payload | number | input value for topic . |
msg. | type | description |
---|---|---|
payload | same as in input message. | |
stats.count | number | number of data elements. |
stats.min number | number | minimal value. |
stats.max number | number | maximal value. |
stats.average number | number | average value. |
stats.deviation number | number | standard deviation. |
stats.variation number | number | coefficient of variation. |
config | type | description |
---|---|---|
Property | string | defines the message property to be used as payload. |
delta time | number | time frame to collect the data for the analysis. |
min. Data | number | min. amount of data points to generate an output. |
Message is only forwarded, if the payload falls below a threshold value.
Each topic
is treated seperatly.
The message property to be used as payload can be defined with the Property
property.
msg. | type | description |
---|---|---|
topic | string | name of the input channel. |
payload | number | input value for topic . |
Trigger message, in case a falling edge is detected.
config | type | description |
---|---|---|
Property | string | defines the message property to be used as payload. |
Threshold | number | threshold value for the edge detection. |
Status | boolean | shows the actual value as a node status. |
Message is only forwarded, if the payload raises above a threshold value.
Each topic
is treated seperatly.
The message property to be used as payload can be defined with the Property
property.
msg. | type | description |
---|---|---|
topic | string | name of the input channel. |
payload | number | input value for topic . |
Trigger message, in case a raising edge is detected.
config | type | description |
---|---|---|
Property | string | defines the message property to be used as payload. |
Threshold | number | threshold value for the edge detection. |
Status | boolean | shows the actual value as a node status. |
Message is only forwarded, if the payload raises above an upper limit or falls below a lower limit.
Each topic
is treated seperatly.
The message property to be used as payload can be defined with the Property
property.
msg. | type | description |
---|---|---|
topic | string | name of the input channel. |
payload | number | input value for topic . |
Trigger message, in case an edge is detected.
config | type | description |
---|---|---|
Property | string | defines the message property to be used as payload. |
up Threshold | number | threshold value for the raising edge detection. |
d(ow)n Threshold | number | threshold value for the falling edge detection. |
1st message | string | initial behaviour (None, Rising, Falling, Any). |
Status | boolean | shows the actual value as a node status. |
for falling edge
, raising edge
and hysteresis
:
LGPL-2.1