@mschaeffler/node-red-logic 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -0
- package/counter.js +1 -0
- package/examples/statistics.json +64 -0
- package/examples/statistics.png +0 -0
- package/logic_and.js +1 -0
- package/logic_bool.js +1 -0
- package/logic_or.js +1 -0
- package/math_falling.js +1 -0
- package/math_hysteresis.js +1 -0
- package/math_number.js +1 -0
- package/math_raising.js +1 -0
- package/math_reduce.js +1 -0
- package/math_statistics.html +1 -1
- package/math_statistics.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -202,6 +202,45 @@ The message property to be used as payload can be defined with the `Property` pr
|
|
|
202
202
|
|min |gets the minimal value of the `topic` channels|
|
|
203
203
|
|max |gets the maximal value of the `topic` channels|
|
|
204
204
|
|
|
205
|
+
### statistics
|
|
206
|
+
|
|
207
|
+
Calculate statistical values of one or more data streams.
|
|
208
|
+
|
|
209
|
+
Each stream can be debounced by arithmatic mean.
|
|
210
|
+
|
|
211
|
+
If the msg property `invalid` is present in the message, all nodes ignore the message.
|
|
212
|
+
|
|
213
|
+
#### Input
|
|
214
|
+
|
|
215
|
+
The different inputs are differentiated by topics.
|
|
216
|
+
|
|
217
|
+
The message property to be used as payload can be defined with the `Property` property.
|
|
218
|
+
|
|
219
|
+
|msg. | type | description |
|
|
220
|
+
|:-------|:-------|:----------------------------------|
|
|
221
|
+
|topic | string | name of the input channel. |
|
|
222
|
+
|payload | number | input value for `topic`. |
|
|
223
|
+
|
|
224
|
+
#### Output
|
|
225
|
+
|
|
226
|
+
|msg. | type | description |
|
|
227
|
+
|:-------|:-------|:----------------------------------|
|
|
228
|
+
|payload | | same as in input message.|
|
|
229
|
+
|stats.count | number | number of data elements.|
|
|
230
|
+
|stats.min number | number | minimal value.|
|
|
231
|
+
|stats.max number | number | maximal value.|
|
|
232
|
+
|stats.average number | number | average value.|
|
|
233
|
+
|stats.deviation number | number | standard deviation.|
|
|
234
|
+
|stats.variation number | number | coefficient of variation.|
|
|
235
|
+
|
|
236
|
+
#### Parameters
|
|
237
|
+
|
|
238
|
+
|config| type | description |
|
|
239
|
+
|:-----|:-------|:----------------------------------|
|
|
240
|
+
|Property| string | defines the message property to be used as payload.|
|
|
241
|
+
|delta time|number|time frame to collect the data for the analysis.|
|
|
242
|
+
|min. Data|number|min. amount of data points to generate an output.|
|
|
243
|
+
|
|
205
244
|
## Edge Nodes
|
|
206
245
|
|
|
207
246
|

|
package/counter.js
CHANGED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "8b8b9dd67621a97e",
|
|
4
|
+
"type": "statistics",
|
|
5
|
+
"z": "3c59326457645408",
|
|
6
|
+
"name": "",
|
|
7
|
+
"property": "payload",
|
|
8
|
+
"deltaTime": "10",
|
|
9
|
+
"minData": "2",
|
|
10
|
+
"x": 360,
|
|
11
|
+
"y": 2100,
|
|
12
|
+
"wires": [
|
|
13
|
+
[
|
|
14
|
+
"1a6086132fd93e1a"
|
|
15
|
+
]
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "1a6086132fd93e1a",
|
|
20
|
+
"type": "debug",
|
|
21
|
+
"z": "3c59326457645408",
|
|
22
|
+
"name": "debug 15",
|
|
23
|
+
"active": true,
|
|
24
|
+
"tosidebar": true,
|
|
25
|
+
"console": false,
|
|
26
|
+
"tostatus": false,
|
|
27
|
+
"complete": "true",
|
|
28
|
+
"targetType": "full",
|
|
29
|
+
"statusVal": "",
|
|
30
|
+
"statusType": "auto",
|
|
31
|
+
"x": 540,
|
|
32
|
+
"y": 2100,
|
|
33
|
+
"wires": []
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "40735ba7d52d0d38",
|
|
37
|
+
"type": "inject",
|
|
38
|
+
"z": "3c59326457645408",
|
|
39
|
+
"name": "",
|
|
40
|
+
"props": [
|
|
41
|
+
{
|
|
42
|
+
"p": "payload"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"p": "topic",
|
|
46
|
+
"vt": "str"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"repeat": "1",
|
|
50
|
+
"crontab": "",
|
|
51
|
+
"once": true,
|
|
52
|
+
"onceDelay": 0.1,
|
|
53
|
+
"topic": "random",
|
|
54
|
+
"payload": "$random()*100",
|
|
55
|
+
"payloadType": "jsonata",
|
|
56
|
+
"x": 190,
|
|
57
|
+
"y": 2100,
|
|
58
|
+
"wires": [
|
|
59
|
+
[
|
|
60
|
+
"8b8b9dd67621a97e"
|
|
61
|
+
]
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
]
|
|
Binary file
|
package/logic_and.js
CHANGED
package/logic_bool.js
CHANGED
package/logic_or.js
CHANGED
package/math_falling.js
CHANGED
package/math_hysteresis.js
CHANGED
package/math_number.js
CHANGED
package/math_raising.js
CHANGED
package/math_reduce.js
CHANGED
package/math_statistics.html
CHANGED
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
|
|
76
76
|
<dl class="message-properties">
|
|
77
77
|
<dt>payload <span class="property-type">number</span></dt>
|
|
78
|
-
<dd>
|
|
78
|
+
<dd> same as in input message.</dd>
|
|
79
79
|
<dt>stats.count <span class="property-type">number</span></dt>
|
|
80
80
|
<dd> number of data elements.</dd>
|
|
81
81
|
<dt>stats.min <span class="property-type">number</span></dt>
|
package/math_statistics.js
CHANGED
package/package.json
CHANGED