smart-nodes 0.4.21 → 0.4.23

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/compare/compare.html +2 -2
  3. package/counter/counter.html +2 -2
  4. package/delay/delay.html +2 -2
  5. package/examples/forwarder.json +125 -17
  6. package/examples/forwarder.png +0 -0
  7. package/examples/hysteresis.json +175 -36
  8. package/examples/hysteresis.png +0 -0
  9. package/forwarder/forwarder.html +2 -2
  10. package/forwarder/forwarder.js +6 -0
  11. package/forwarder/locales/de-DE/forwarder.html +4 -0
  12. package/forwarder/locales/en-US/forwarder.html +4 -0
  13. package/hysteresis/hysteresis.html +62 -5
  14. package/hysteresis/hysteresis.js +43 -10
  15. package/hysteresis/locales/de-DE/hysteresis.html +8 -0
  16. package/hysteresis/locales/de-DE/hysteresis.json +5 -1
  17. package/hysteresis/locales/en-US/hysteresis.html +8 -0
  18. package/hysteresis/locales/en-US/hysteresis.json +5 -1
  19. package/light/light.html +18 -0
  20. package/light/light.js +96 -22
  21. package/light/locales/de-DE/light.html +6 -6
  22. package/light/locales/de-DE/light.json +3 -0
  23. package/light/locales/en-US/light.html +6 -6
  24. package/light/locales/en-US/light.json +3 -0
  25. package/logic/logic.html +2 -2
  26. package/mixing-valve/locales/de-DE/mixing-valve.html +5 -1
  27. package/mixing-valve/locales/en-US/mixing-valve.html +5 -2
  28. package/mixing-valve/mixing-valve.js +6 -0
  29. package/package.json +1 -1
  30. package/scheduler/locales/de-DE/scheduler.html +4 -0
  31. package/scheduler/locales/en-US/scheduler.html +4 -0
  32. package/scheduler/scheduler.html +2 -2
  33. package/scheduler/scheduler.js +6 -0
  34. package/smart_helper.js +2 -2
  35. package/statistic/statistic.html +2 -2
package/CHANGELOG.md CHANGED
@@ -165,3 +165,19 @@
165
165
  ## Version 0.4.20:
166
166
 
167
167
  - Small bugfix.
168
+
169
+ ## Version 0.4.21:
170
+
171
+ - Fixed up_down direction in central node..
172
+
173
+ ## Version 0.4.22:
174
+
175
+ - Added set_state_inverted topic to forwarder node.
176
+
177
+ ## Version 0.4.23:
178
+
179
+ - Added set_state_inverted topic to mixing-valve node.
180
+ - Added set_state_inverted topic to scheduler node.
181
+ - Changed default of save_state and resend_on_start to false for all nodes.
182
+ - Hysteresis node can now be defined by min/max values.
183
+ - Added support for percentage output for the light node.
@@ -16,8 +16,8 @@
16
16
  out_true_type: { value: 'json' },
17
17
  send_only_change: { value: true },
18
18
  outputs: { value: 1 },
19
- save_state: { value: true },
20
- resend_on_start: { value: true }
19
+ save_state: { value: false },
20
+ resend_on_start: { value: false }
21
21
  },
22
22
  inputs: 1,
23
23
  outputs: 1,
@@ -11,8 +11,8 @@
11
11
  max: { value: 10 },
12
12
  out_message: { value: '{"topic": ""}' },
13
13
  out_message_type: { value: 'json' },
14
- save_state: { value: true },
15
- resend_on_start: { value: true }
14
+ save_state: { value: false },
15
+ resend_on_start: { value: false }
16
16
  },
17
17
  inputs: 1,
18
18
  outputs: 1,
package/delay/delay.html CHANGED
@@ -10,8 +10,8 @@
10
10
  off_delay: { value: 10 },
11
11
  off_delay_unit: { value: "s" },
12
12
  delay_only_on_change: { value: true },
13
- save_state: { value: true },
14
- resend_on_start: { value: true }
13
+ save_state: { value: false },
14
+ resend_on_start: { value: false }
15
15
  },
16
16
  inputs: 1,
17
17
  outputs: 1,
@@ -1,12 +1,4 @@
1
1
  [
2
- {
3
- "id": "3f7674b42690cbf6",
4
- "type": "tab",
5
- "label": "Forwarder",
6
- "disabled": false,
7
- "info": "",
8
- "env": []
9
- },
10
2
  {
11
3
  "id": "b66a09e81ad59e7f",
12
4
  "type": "inject",
@@ -24,7 +16,7 @@
24
16
  "onceDelay": 0.1,
25
17
  "topic": "enable",
26
18
  "x": 130,
27
- "y": 60,
19
+ "y": 140,
28
20
  "wires": [
29
21
  [
30
22
  "96f4341ffed2d829"
@@ -44,8 +36,8 @@
44
36
  "targetType": "full",
45
37
  "statusVal": "",
46
38
  "statusType": "auto",
47
- "x": 540,
48
- "y": 180,
39
+ "x": 620,
40
+ "y": 260,
49
41
  "wires": []
50
42
  },
51
43
  {
@@ -58,9 +50,9 @@
58
50
  "always_forward_false": false,
59
51
  "forward_last_on_enable": true,
60
52
  "save_state": true,
61
- "resend_on_start": true,
62
- "x": 330,
63
- "y": 180,
53
+ "resend_on_start": false,
54
+ "x": 410,
55
+ "y": 260,
64
56
  "wires": [
65
57
  [
66
58
  "7626979605acc1fd"
@@ -84,7 +76,7 @@
84
76
  "onceDelay": 0.1,
85
77
  "topic": "disable",
86
78
  "x": 130,
87
- "y": 100,
79
+ "y": 180,
88
80
  "wires": [
89
81
  [
90
82
  "96f4341ffed2d829"
@@ -113,7 +105,7 @@
113
105
  "payload": "42",
114
106
  "payloadType": "num",
115
107
  "x": 110,
116
- "y": 160,
108
+ "y": 240,
117
109
  "wires": [
118
110
  [
119
111
  "96f4341ffed2d829"
@@ -142,7 +134,123 @@
142
134
  "payload": "777",
143
135
  "payloadType": "num",
144
136
  "x": 110,
145
- "y": 200,
137
+ "y": 280,
138
+ "wires": [
139
+ [
140
+ "96f4341ffed2d829"
141
+ ]
142
+ ]
143
+ },
144
+ {
145
+ "id": "b6106e854b700e19",
146
+ "type": "inject",
147
+ "z": "3f7674b42690cbf6",
148
+ "name": "",
149
+ "props": [
150
+ {
151
+ "p": "topic",
152
+ "vt": "str"
153
+ },
154
+ {
155
+ "p": "payload"
156
+ }
157
+ ],
158
+ "repeat": "",
159
+ "crontab": "",
160
+ "once": false,
161
+ "onceDelay": 0.1,
162
+ "topic": "set_state",
163
+ "payload": "true",
164
+ "payloadType": "bool",
165
+ "x": 110,
166
+ "y": 40,
167
+ "wires": [
168
+ [
169
+ "96f4341ffed2d829"
170
+ ]
171
+ ]
172
+ },
173
+ {
174
+ "id": "9792032e7b2b7cfd",
175
+ "type": "inject",
176
+ "z": "3f7674b42690cbf6",
177
+ "name": "",
178
+ "props": [
179
+ {
180
+ "p": "topic",
181
+ "vt": "str"
182
+ },
183
+ {
184
+ "p": "payload"
185
+ }
186
+ ],
187
+ "repeat": "",
188
+ "crontab": "",
189
+ "once": false,
190
+ "onceDelay": 0.1,
191
+ "topic": "set_state",
192
+ "payload": "false",
193
+ "payloadType": "bool",
194
+ "x": 110,
195
+ "y": 80,
196
+ "wires": [
197
+ [
198
+ "96f4341ffed2d829"
199
+ ]
200
+ ]
201
+ },
202
+ {
203
+ "id": "10cea120d568feb8",
204
+ "type": "inject",
205
+ "z": "3f7674b42690cbf6",
206
+ "name": "",
207
+ "props": [
208
+ {
209
+ "p": "topic",
210
+ "vt": "str"
211
+ },
212
+ {
213
+ "p": "payload"
214
+ }
215
+ ],
216
+ "repeat": "",
217
+ "crontab": "",
218
+ "once": false,
219
+ "onceDelay": 0.1,
220
+ "topic": "set_state_inverted",
221
+ "payload": "true",
222
+ "payloadType": "bool",
223
+ "x": 140,
224
+ "y": 340,
225
+ "wires": [
226
+ [
227
+ "96f4341ffed2d829"
228
+ ]
229
+ ]
230
+ },
231
+ {
232
+ "id": "2454de5232c3e1f1",
233
+ "type": "inject",
234
+ "z": "3f7674b42690cbf6",
235
+ "name": "",
236
+ "props": [
237
+ {
238
+ "p": "topic",
239
+ "vt": "str"
240
+ },
241
+ {
242
+ "p": "payload"
243
+ }
244
+ ],
245
+ "repeat": "",
246
+ "crontab": "",
247
+ "once": false,
248
+ "onceDelay": 0.1,
249
+ "topic": "set_state_inverted",
250
+ "payload": "false",
251
+ "payloadType": "bool",
252
+ "x": 140,
253
+ "y": 380,
146
254
  "wires": [
147
255
  [
148
256
  "96f4341ffed2d829"
Binary file
@@ -1,12 +1,4 @@
1
1
  [
2
- {
3
- "id": "c51a4aa01bcf08f4",
4
- "type": "tab",
5
- "label": "Hysteresis",
6
- "disabled": false,
7
- "info": "",
8
- "env": []
9
- },
10
2
  {
11
3
  "id": "f2004bf115b58fd3",
12
4
  "type": "inject",
@@ -25,7 +17,7 @@
25
17
  "payload": "26",
26
18
  "payloadType": "num",
27
19
  "x": 150,
28
- "y": 460,
20
+ "y": 600,
29
21
  "wires": [
30
22
  [
31
23
  "592bd85753e315c1"
@@ -50,7 +42,7 @@
50
42
  "payload": "25",
51
43
  "payloadType": "num",
52
44
  "x": 150,
53
- "y": 420,
45
+ "y": 560,
54
46
  "wires": [
55
47
  [
56
48
  "592bd85753e315c1"
@@ -62,7 +54,7 @@
62
54
  "type": "debug",
63
55
  "z": "c51a4aa01bcf08f4",
64
56
  "name": "debug 35",
65
- "active": true,
57
+ "active": false,
66
58
  "tosidebar": true,
67
59
  "console": false,
68
60
  "tostatus": false,
@@ -70,8 +62,8 @@
70
62
  "targetType": "full",
71
63
  "statusVal": "",
72
64
  "statusType": "auto",
73
- "x": 640,
74
- "y": 260,
65
+ "x": 720,
66
+ "y": 220,
75
67
  "wires": []
76
68
  },
77
69
  {
@@ -79,16 +71,21 @@
79
71
  "type": "smart_hysteresis",
80
72
  "z": "c51a4aa01bcf08f4",
81
73
  "name": "",
82
- "setpoint": 20,
83
- "hysteresis": 5,
84
- "out_higher": "",
85
- "out_higher_type": "null",
74
+ "mode": "MIN_MAX",
75
+ "setpoint": 300,
76
+ "hysteresis": 60,
77
+ "min": "240",
78
+ "max": "360",
79
+ "out_higher": "{\"topic\": \"higher\"}",
80
+ "out_higher_type": "json",
86
81
  "out_lower": "{\"topic\": \"lower\"}",
87
82
  "out_lower_type": "json",
83
+ "send_only_change": "true",
84
+ "outputs": 2,
88
85
  "save_state": false,
89
86
  "resend_on_start": true,
90
87
  "x": 430,
91
- "y": 280,
88
+ "y": 240,
92
89
  "wires": [
93
90
  [
94
91
  "ab4e87fa22585fd8"
@@ -120,7 +117,7 @@
120
117
  "payload": "20",
121
118
  "payloadType": "num",
122
119
  "x": 140,
123
- "y": 100,
120
+ "y": 60,
124
121
  "wires": [
125
122
  [
126
123
  "592bd85753e315c1"
@@ -146,10 +143,10 @@
146
143
  "once": false,
147
144
  "onceDelay": 0.1,
148
145
  "topic": "hysteresis",
149
- "payload": "5",
146
+ "payload": "7",
150
147
  "payloadType": "num",
151
148
  "x": 130,
152
- "y": 180,
149
+ "y": 140,
153
150
  "wires": [
154
151
  [
155
152
  "592bd85753e315c1"
@@ -175,10 +172,10 @@
175
172
  "once": false,
176
173
  "onceDelay": 0.1,
177
174
  "topic": "setpoint",
178
- "payload": "30",
175
+ "payload": "55",
179
176
  "payloadType": "num",
180
177
  "x": 140,
181
- "y": 140,
178
+ "y": 100,
182
179
  "wires": [
183
180
  [
184
181
  "592bd85753e315c1"
@@ -207,7 +204,7 @@
207
204
  "payload": "10",
208
205
  "payloadType": "num",
209
206
  "x": 130,
210
- "y": 220,
207
+ "y": 180,
211
208
  "wires": [
212
209
  [
213
210
  "592bd85753e315c1"
@@ -232,7 +229,7 @@
232
229
  "payload": "14",
233
230
  "payloadType": "num",
234
231
  "x": 150,
235
- "y": 340,
232
+ "y": 480,
236
233
  "wires": [
237
234
  [
238
235
  "592bd85753e315c1"
@@ -257,7 +254,7 @@
257
254
  "payload": "15",
258
255
  "payloadType": "num",
259
256
  "x": 150,
260
- "y": 380,
257
+ "y": 520,
261
258
  "wires": [
262
259
  [
263
260
  "592bd85753e315c1"
@@ -282,7 +279,7 @@
282
279
  "payload": "1",
283
280
  "payloadType": "num",
284
281
  "x": 150,
285
- "y": 300,
282
+ "y": 440,
286
283
  "wires": [
287
284
  [
288
285
  "592bd85753e315c1"
@@ -304,10 +301,10 @@
304
301
  "once": false,
305
302
  "onceDelay": 0.1,
306
303
  "topic": "",
307
- "payload": "100",
304
+ "payload": "50.1",
308
305
  "payloadType": "num",
309
306
  "x": 150,
310
- "y": 500,
307
+ "y": 640,
311
308
  "wires": [
312
309
  [
313
310
  "592bd85753e315c1"
@@ -319,7 +316,7 @@
319
316
  "type": "debug",
320
317
  "z": "c51a4aa01bcf08f4",
321
318
  "name": "debug 36",
322
- "active": true,
319
+ "active": false,
323
320
  "tosidebar": true,
324
321
  "console": false,
325
322
  "tostatus": false,
@@ -327,16 +324,69 @@
327
324
  "targetType": "full",
328
325
  "statusVal": "",
329
326
  "statusType": "auto",
330
- "x": 640,
331
- "y": 300,
327
+ "x": 720,
328
+ "y": 260,
332
329
  "wires": []
333
330
  },
334
331
  {
335
- "id": "d27ad526b17c5f01",
332
+ "id": "b6fe9109e6e7059b",
336
333
  "type": "inject",
337
334
  "z": "c51a4aa01bcf08f4",
338
335
  "name": "",
339
336
  "props": [
337
+ {
338
+ "p": "payload"
339
+ }
340
+ ],
341
+ "repeat": "",
342
+ "crontab": "",
343
+ "once": false,
344
+ "onceDelay": 0.1,
345
+ "topic": "",
346
+ "payload": "0",
347
+ "payloadType": "num",
348
+ "x": 150,
349
+ "y": 400,
350
+ "wires": [
351
+ [
352
+ "592bd85753e315c1"
353
+ ]
354
+ ]
355
+ },
356
+ {
357
+ "id": "ecbcf6dab035b978",
358
+ "type": "inject",
359
+ "z": "c51a4aa01bcf08f4",
360
+ "name": "",
361
+ "props": [
362
+ {
363
+ "p": "payload"
364
+ }
365
+ ],
366
+ "repeat": "",
367
+ "crontab": "",
368
+ "once": false,
369
+ "onceDelay": 0.1,
370
+ "topic": "",
371
+ "payload": "100",
372
+ "payloadType": "num",
373
+ "x": 150,
374
+ "y": 680,
375
+ "wires": [
376
+ [
377
+ "592bd85753e315c1"
378
+ ]
379
+ ]
380
+ },
381
+ {
382
+ "id": "3f56fce9fe3c2a1d",
383
+ "type": "inject",
384
+ "z": "c51a4aa01bcf08f4",
385
+ "name": "",
386
+ "props": [
387
+ {
388
+ "p": "payload"
389
+ },
340
390
  {
341
391
  "p": "topic",
342
392
  "vt": "str"
@@ -346,9 +396,98 @@
346
396
  "crontab": "",
347
397
  "once": false,
348
398
  "onceDelay": 0.1,
349
- "topic": "resend",
350
- "x": 150,
351
- "y": 60,
399
+ "topic": "min",
400
+ "payload": "20",
401
+ "payloadType": "num",
402
+ "x": 130,
403
+ "y": 220,
404
+ "wires": [
405
+ [
406
+ "592bd85753e315c1"
407
+ ]
408
+ ]
409
+ },
410
+ {
411
+ "id": "b0bf2bbaa516b06e",
412
+ "type": "inject",
413
+ "z": "c51a4aa01bcf08f4",
414
+ "name": "",
415
+ "props": [
416
+ {
417
+ "p": "payload"
418
+ },
419
+ {
420
+ "p": "topic",
421
+ "vt": "str"
422
+ }
423
+ ],
424
+ "repeat": "",
425
+ "crontab": "",
426
+ "once": false,
427
+ "onceDelay": 0.1,
428
+ "topic": "max",
429
+ "payload": "7",
430
+ "payloadType": "num",
431
+ "x": 130,
432
+ "y": 300,
433
+ "wires": [
434
+ [
435
+ "592bd85753e315c1"
436
+ ]
437
+ ]
438
+ },
439
+ {
440
+ "id": "4c019b7fc67e9571",
441
+ "type": "inject",
442
+ "z": "c51a4aa01bcf08f4",
443
+ "name": "",
444
+ "props": [
445
+ {
446
+ "p": "payload"
447
+ },
448
+ {
449
+ "p": "topic",
450
+ "vt": "str"
451
+ }
452
+ ],
453
+ "repeat": "",
454
+ "crontab": "",
455
+ "once": false,
456
+ "onceDelay": 0.1,
457
+ "topic": "min",
458
+ "payload": "55",
459
+ "payloadType": "num",
460
+ "x": 130,
461
+ "y": 260,
462
+ "wires": [
463
+ [
464
+ "592bd85753e315c1"
465
+ ]
466
+ ]
467
+ },
468
+ {
469
+ "id": "2756d50e7e98f2bb",
470
+ "type": "inject",
471
+ "z": "c51a4aa01bcf08f4",
472
+ "name": "",
473
+ "props": [
474
+ {
475
+ "p": "payload"
476
+ },
477
+ {
478
+ "p": "topic",
479
+ "vt": "str"
480
+ }
481
+ ],
482
+ "repeat": "",
483
+ "crontab": "",
484
+ "once": false,
485
+ "onceDelay": 0.1,
486
+ "topic": "max",
487
+ "payload": "10",
488
+ "payloadType": "num",
489
+ "x": 130,
490
+ "y": 340,
352
491
  "wires": [
353
492
  [
354
493
  "592bd85753e315c1"
Binary file
@@ -9,8 +9,8 @@
9
9
  always_forward_true: { value: false },
10
10
  always_forward_false: { value: false },
11
11
  forward_last_on_enable: { value: false },
12
- save_state: { value: true },
13
- resend_on_start: { value: true }
12
+ save_state: { value: false },
13
+ resend_on_start: { value: false }
14
14
  },
15
15
  inputs: 1,
16
16
  outputs: 1,
@@ -81,6 +81,12 @@ module.exports = function (RED)
81
81
  {
82
82
  let real_topic = helper.getTopicName(msg.topic);
83
83
 
84
+ if (real_topic == "set_state_inverted")
85
+ {
86
+ real_topic = "set_state";
87
+ msg.payload = !msg.payload;
88
+ }
89
+
84
90
  let new_state = null;
85
91
  if (real_topic == "enable" || (real_topic == "set_state" && msg.payload))
86
92
  new_state = true;
@@ -26,6 +26,10 @@
26
26
  <td><code>set_state</code></td>
27
27
  <td>Aktiviert das Weiterleiten, wenn <code>msg.payload = true</code> oder deaktiviert das Weiterleiten, wenn <code>msg.payload = false</code>.</td>
28
28
  </tr>
29
+ <tr>
30
+ <td><code>set_state_inverted</code></td>
31
+ <td>Aktiviert das Weiterleiten, wenn <code>msg.payload = false</code> oder deaktiviert das Weiterleiten, wenn <code>msg.payload = true</code>.</td>
32
+ </tr>
29
33
  </tbody>
30
34
  </table>
31
35
  </p>
@@ -26,6 +26,10 @@
26
26
  <td><code>set_state</code></td>
27
27
  <td>Enables forwarding if <code>msg.payload = true</code> or disables forwarding if <code>msg.payload = false</code>.</td>
28
28
  </tr>
29
+ <tr>
30
+ <td><code>set_state_inverted</code></td>
31
+ <td>Enables forwarding if <code>msg.payload = false</code> or disables forwarding if <code>msg.payload = true</code>.</td>
32
+ </tr>
29
33
  </tbody>
30
34
  </table>
31
35
  </p>