3.1.3 • Published 12 months ago

@mschaeffler/node-red-logic v3.1.3

Weekly downloads
-
License
LGPL-2.1
Repository
github
Last release
12 months ago

@mschaeffler/node-red-logic

Nodes to perform boolean and arithmetic operations on input signals.

image of nodes

If the msg property invalid is present in the message, all nodes ignore the message.

Install

$ npm install @mschaeffler/node-red-logic

Boolean Nodes

image of example flow

to bool

Converts payload to a bool value:

typevalueis converted to
boolfalsefalse
truetrue
number0false
1true
stringfalsefalse
0false
offfalse
truetrue
1true
ontrue

Input

The message property to be used as payload can be defined with the Property property.

msg.typedescription
payloadinput value.

Output

msg.typedescription
payloadbooleanbool value of payload.

Parameters

configtypedescription
Propertystringdefines the message property to be used as payload.
Statusbooleanshows the actual value as a node status.

or

Combines two or more boolean vales with the or operator.

The input values are converted as described in the to bool node.

Input

The different inputs are differentiated by topics.

The message property to be used as payload can be defined with the Property property.

msg.typedescription
topicstringname of the input channel.
payloadbooleaninput value for topic.

Output

msg.typedescription
payloadbooleanresult of or of all input topics.
countnumbernumber of data elements.

Parameters

configtypedescription
Topicstringdefines the topic for the output message.
Propertystringdefines the message property to be used as payload.
min. Datanumbermin. amount of topics to generate an output.

and

Combines two or more boolean vales with the and operator.

The input values are converted as described in the to bool node.

Input

The different inputs are differentiated by topics.

The message property to be used as payload can be defined with the Property property.

msg.typedescription
topicstringname of the input channel.
payloadbooleaninput value for topic.

Output

msg.typedescription
payloadbooleanresult of and of all input topics.
countnumbernumber of data elements.

Parameters

configtypedescription
Topicstringdefines the topic for the output message.
Propertystringdefines the message property to be used as payload.
min. Datanumbermin. amount of topics to generate an output.

Integer Nodes

image of example flow

counter

A node that just count the messages.

Output

msg.typedescription
countnumbernumber of messages.

to number

Converts payload to a number.

Input

The message property to be used as payload can be defined with the Property property.

msg.typedescription
payloadinput value.

Output

msg.typedescription
payloadnumbernumber value of payload.

Parameters

configtypedescription
Propertystringdefines the message property to be used as payload.
Statusbooleanshows the actual value as a node status.

reduce

Combines two or more streams of data (topics) into one single value.

Each stream can be debounced by arithmatic mean.

Input

The different inputs are differentiated by topics.

The message property to be used as payload can be defined with the Property property.

msg.typedescription
topicstringname of the input channel.
payloadnumberinput value for topic.

Output

msg.typedescription
payloadnumberresult of combining of all input topics.
countnumbernumber of data elements.

Parameters

configtypedescription
Topicstringdefines the topic for the output message.
Propertystringdefines the message property to be used as payload.
min. Meannumbermin. amount of values for the arithmatic mean of one topic.
max. Meannumbermax. amount of values for the arithmatic mean of one topic.
min. Datanumbermin. amount of topics to generate an output.
Algorithmstringalgorithm to combine the values.

Algorithms

algorithmdescription
addads up the topic channels
meanaverages the topic channels
prodmultiplies the topic channels
mingets the minimal value of the topic channels
maxgets the maximal value of the topic channels

statistics

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.

Input

The different inputs are differentiated by topics.

The message property to be used as payload can be defined with the Property property.

msg.typedescription
topicstringname of the input channel.
payloadnumberinput value for topic.

Output

msg.typedescription
payloadsame as in input message.
stats.countnumbernumber of data elements.
stats.min numbernumberminimal value.
stats.max numbernumbermaximal value.
stats.average numbernumberaverage value.
stats.deviation numbernumberstandard deviation.
stats.variation numbernumbercoefficient of variation.

Parameters

configtypedescription
Propertystringdefines the message property to be used as payload.
delta timenumbertime frame to collect the data for the analysis.
min. Datanumbermin. amount of data points to generate an output.

Edge Nodes

image of example flow

fallingEdge

Message is only forwarded, if the payload falls below a threshold value.

Each topic is treated seperatly.

Input

The message property to be used as payload can be defined with the Property property.

msg.typedescription
topicstringname of the input channel.
payloadnumberinput value for topic.

Output

Trigger message, in case a falling edge is detected.

Parameters

configtypedescription
Propertystringdefines the message property to be used as payload.
Thresholdnumberthreshold value for the edge detection.
Statusbooleanshows the actual value as a node status.

raisingEdge

Message is only forwarded, if the payload raises above a threshold value.

Each topic is treated seperatly.

Input

The message property to be used as payload can be defined with the Property property.

msg.typedescription
topicstringname of the input channel.
payloadnumberinput value for topic.

Output

Trigger message, in case a raising edge is detected.

Parameters

configtypedescription
Propertystringdefines the message property to be used as payload.
Thresholdnumberthreshold value for the edge detection.
Statusbooleanshows the actual value as a node status.

hysteresis

Message is only forwarded, if the payload raises above an upper limit or falls below a lower limit.

Each topic is treated seperatly.

Input

The message property to be used as payload can be defined with the Property property.

msg.typedescription
topicstringname of the input channel.
payloadnumberinput value for topic.

Output

Trigger message, in case an edge is detected.

Parameters

configtypedescription
Propertystringdefines the message property to be used as payload.
up Thresholdnumberthreshold value for the raising edge detection.
d(ow)n Thresholdnumberthreshold value for the falling edge detection.
1st messagestringinitial behaviour (None, Rising, Falling, Any).
Statusbooleanshows the actual value as a node status.

Example Flows

boolean nodes

integer nodes

edge nodes

Author

Mathias Schäffler

Contributors

for falling edge, raising edge and hysteresis:

License

LGPL-2.1

3.0.4

1 year ago

3.1.3

12 months ago

3.1.2

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.4.0

1 year ago

2.3.2

1 year ago

2.3.3

1 year ago

2.3.1

1 year ago

2.3.0

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

2.1.0

1 year ago

2.0.0

1 year ago

1.5.0

1 year ago

1.4.7

1 year ago

1.4.6

1 year ago

1.4.5

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.2.0

1 year ago

1.2.1

1 year ago

1.0.2

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.3

2 years ago

0.9.0

2 years ago

0.8.0

2 years ago

0.7.2

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.2

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.1

3 years ago

0.3.0

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago