smart-nodes 0.4.31 → 0.4.33
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/CHANGELOG.md +9 -1
- package/examples/{mode-selector.json → mode-selector-1.json} +40 -16
- package/examples/mode-selector-1.png +0 -0
- package/examples/mode-selector-2.json +453 -0
- package/examples/mode-selector-2.png +0 -0
- package/mode-selector/locales/de-DE/mode-selector.html +16 -1
- package/mode-selector/locales/en-US/mode-selector.html +37 -22
- package/mode-selector/mode-selector.js +84 -24
- package/package.json +1 -1
- package/examples/mode-selector.png +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -217,5 +217,13 @@
|
|
|
217
217
|
|
|
218
218
|
## Version 0.4.31:
|
|
219
219
|
|
|
220
|
-
- Added
|
|
220
|
+
- Added toggle_mode to mode-selector node to toggle mode if sended mode already set.
|
|
221
221
|
- Added option to mode-selector to update only changed outputs.
|
|
222
|
+
|
|
223
|
+
## Version 0.4.32:
|
|
224
|
+
|
|
225
|
+
- Added special set_mode topic to mode-selector node to improve work with KNX Ultimate module.
|
|
226
|
+
|
|
227
|
+
## Version 0.4.33:
|
|
228
|
+
|
|
229
|
+
- Fixed set_mode topic from mode-selector if payload is false.
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"onceDelay": 0.1,
|
|
50
50
|
"topic": "refresh",
|
|
51
51
|
"x": 110,
|
|
52
|
-
"y":
|
|
52
|
+
"y": 100,
|
|
53
53
|
"wires": [
|
|
54
54
|
[
|
|
55
55
|
"b33aca888f9ec037"
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"payload": "OFF",
|
|
79
79
|
"payloadType": "str",
|
|
80
80
|
"x": 140,
|
|
81
|
-
"y":
|
|
81
|
+
"y": 160,
|
|
82
82
|
"wires": [
|
|
83
83
|
[
|
|
84
84
|
"b33aca888f9ec037"
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"payload": "COOL",
|
|
137
137
|
"payloadType": "str",
|
|
138
138
|
"x": 140,
|
|
139
|
-
"y":
|
|
139
|
+
"y": 240,
|
|
140
140
|
"wires": [
|
|
141
141
|
[
|
|
142
142
|
"b33aca888f9ec037"
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
"payload": "INVALID",
|
|
217
217
|
"payloadType": "str",
|
|
218
218
|
"x": 150,
|
|
219
|
-
"y":
|
|
219
|
+
"y": 280,
|
|
220
220
|
"wires": [
|
|
221
221
|
[
|
|
222
222
|
"b33aca888f9ec037"
|
|
@@ -241,11 +241,11 @@
|
|
|
241
241
|
"crontab": "",
|
|
242
242
|
"once": false,
|
|
243
243
|
"onceDelay": 0.1,
|
|
244
|
-
"topic": "
|
|
244
|
+
"topic": "toggle_mode",
|
|
245
245
|
"payload": "OFF",
|
|
246
246
|
"payloadType": "str",
|
|
247
|
-
"x":
|
|
248
|
-
"y":
|
|
247
|
+
"x": 150,
|
|
248
|
+
"y": 340,
|
|
249
249
|
"wires": [
|
|
250
250
|
[
|
|
251
251
|
"b33aca888f9ec037"
|
|
@@ -270,11 +270,11 @@
|
|
|
270
270
|
"crontab": "",
|
|
271
271
|
"once": false,
|
|
272
272
|
"onceDelay": 0.1,
|
|
273
|
-
"topic": "
|
|
273
|
+
"topic": "toggle_mode",
|
|
274
274
|
"payload": "HEAT",
|
|
275
275
|
"payloadType": "str",
|
|
276
|
-
"x":
|
|
277
|
-
"y":
|
|
276
|
+
"x": 150,
|
|
277
|
+
"y": 380,
|
|
278
278
|
"wires": [
|
|
279
279
|
[
|
|
280
280
|
"b33aca888f9ec037"
|
|
@@ -299,11 +299,11 @@
|
|
|
299
299
|
"crontab": "",
|
|
300
300
|
"once": false,
|
|
301
301
|
"onceDelay": 0.1,
|
|
302
|
-
"topic": "
|
|
302
|
+
"topic": "toggle_mode",
|
|
303
303
|
"payload": "COOL",
|
|
304
304
|
"payloadType": "str",
|
|
305
|
-
"x":
|
|
306
|
-
"y":
|
|
305
|
+
"x": 150,
|
|
306
|
+
"y": 420,
|
|
307
307
|
"wires": [
|
|
308
308
|
[
|
|
309
309
|
"b33aca888f9ec037"
|
|
@@ -328,11 +328,35 @@
|
|
|
328
328
|
"crontab": "",
|
|
329
329
|
"once": false,
|
|
330
330
|
"onceDelay": 0.1,
|
|
331
|
-
"topic": "
|
|
331
|
+
"topic": "toggle_mode",
|
|
332
332
|
"payload": "INVALID",
|
|
333
333
|
"payloadType": "str",
|
|
334
|
-
"x":
|
|
335
|
-
"y":
|
|
334
|
+
"x": 160,
|
|
335
|
+
"y": 460,
|
|
336
|
+
"wires": [
|
|
337
|
+
[
|
|
338
|
+
"b33aca888f9ec037"
|
|
339
|
+
]
|
|
340
|
+
]
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"id": "49ee2a5c66fec344",
|
|
344
|
+
"type": "inject",
|
|
345
|
+
"z": "e5afc2ee2cd84f5f",
|
|
346
|
+
"name": "",
|
|
347
|
+
"props": [
|
|
348
|
+
{
|
|
349
|
+
"p": "topic",
|
|
350
|
+
"vt": "str"
|
|
351
|
+
}
|
|
352
|
+
],
|
|
353
|
+
"repeat": "",
|
|
354
|
+
"crontab": "",
|
|
355
|
+
"once": false,
|
|
356
|
+
"onceDelay": 0.1,
|
|
357
|
+
"topic": "debug",
|
|
358
|
+
"x": 110,
|
|
359
|
+
"y": 60,
|
|
336
360
|
"wires": [
|
|
337
361
|
[
|
|
338
362
|
"b33aca888f9ec037"
|
|
Binary file
|
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "10bed778aa45fba9",
|
|
4
|
+
"type": "smart_mode-selector",
|
|
5
|
+
"z": "e5afc2ee2cd84f5f",
|
|
6
|
+
"name": "",
|
|
7
|
+
"outputs": 3,
|
|
8
|
+
"mode_items": [
|
|
9
|
+
{
|
|
10
|
+
"name": "OFF"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "COOL"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "HEAT"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"update_only_changed_outputs": true,
|
|
20
|
+
"resend_on_start": true,
|
|
21
|
+
"x": 540,
|
|
22
|
+
"y": 940,
|
|
23
|
+
"wires": [
|
|
24
|
+
[
|
|
25
|
+
"0450987de6744134"
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
"426fbfe213956970"
|
|
29
|
+
],
|
|
30
|
+
[
|
|
31
|
+
"3364e6bd6f626459"
|
|
32
|
+
]
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "fa522fed02c6311e",
|
|
37
|
+
"type": "inject",
|
|
38
|
+
"z": "e5afc2ee2cd84f5f",
|
|
39
|
+
"name": "",
|
|
40
|
+
"props": [
|
|
41
|
+
{
|
|
42
|
+
"p": "topic",
|
|
43
|
+
"vt": "str"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"repeat": "",
|
|
47
|
+
"crontab": "",
|
|
48
|
+
"once": false,
|
|
49
|
+
"onceDelay": 0.1,
|
|
50
|
+
"topic": "refresh",
|
|
51
|
+
"x": 110,
|
|
52
|
+
"y": 700,
|
|
53
|
+
"wires": [
|
|
54
|
+
[
|
|
55
|
+
"10bed778aa45fba9"
|
|
56
|
+
]
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "5f811e8ebb093720",
|
|
61
|
+
"type": "inject",
|
|
62
|
+
"z": "e5afc2ee2cd84f5f",
|
|
63
|
+
"name": "",
|
|
64
|
+
"props": [
|
|
65
|
+
{
|
|
66
|
+
"p": "topic",
|
|
67
|
+
"vt": "str"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"p": "payload"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"repeat": "",
|
|
74
|
+
"crontab": "",
|
|
75
|
+
"once": false,
|
|
76
|
+
"onceDelay": 0.1,
|
|
77
|
+
"topic": "set_mode",
|
|
78
|
+
"payload": "OFF",
|
|
79
|
+
"payloadType": "str",
|
|
80
|
+
"x": 140,
|
|
81
|
+
"y": 760,
|
|
82
|
+
"wires": [
|
|
83
|
+
[
|
|
84
|
+
"10bed778aa45fba9"
|
|
85
|
+
]
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "cfa645fdb7f63bb7",
|
|
90
|
+
"type": "inject",
|
|
91
|
+
"z": "e5afc2ee2cd84f5f",
|
|
92
|
+
"name": "",
|
|
93
|
+
"props": [
|
|
94
|
+
{
|
|
95
|
+
"p": "topic",
|
|
96
|
+
"vt": "str"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"p": "payload"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"repeat": "",
|
|
103
|
+
"crontab": "",
|
|
104
|
+
"once": false,
|
|
105
|
+
"onceDelay": 0.1,
|
|
106
|
+
"topic": "set_mode#HEAT",
|
|
107
|
+
"payload": "true",
|
|
108
|
+
"payloadType": "bool",
|
|
109
|
+
"x": 160,
|
|
110
|
+
"y": 800,
|
|
111
|
+
"wires": [
|
|
112
|
+
[
|
|
113
|
+
"10bed778aa45fba9"
|
|
114
|
+
]
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"id": "8793fbedb7323608",
|
|
119
|
+
"type": "inject",
|
|
120
|
+
"z": "e5afc2ee2cd84f5f",
|
|
121
|
+
"name": "",
|
|
122
|
+
"props": [
|
|
123
|
+
{
|
|
124
|
+
"p": "topic",
|
|
125
|
+
"vt": "str"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"p": "payload"
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"repeat": "",
|
|
132
|
+
"crontab": "",
|
|
133
|
+
"once": false,
|
|
134
|
+
"onceDelay": 0.1,
|
|
135
|
+
"topic": "set_mode#COOL",
|
|
136
|
+
"payload": "true",
|
|
137
|
+
"payloadType": "bool",
|
|
138
|
+
"x": 160,
|
|
139
|
+
"y": 880,
|
|
140
|
+
"wires": [
|
|
141
|
+
[
|
|
142
|
+
"10bed778aa45fba9"
|
|
143
|
+
]
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "0450987de6744134",
|
|
148
|
+
"type": "debug",
|
|
149
|
+
"z": "e5afc2ee2cd84f5f",
|
|
150
|
+
"name": "debug 54",
|
|
151
|
+
"active": true,
|
|
152
|
+
"tosidebar": true,
|
|
153
|
+
"console": false,
|
|
154
|
+
"tostatus": false,
|
|
155
|
+
"complete": "true",
|
|
156
|
+
"targetType": "full",
|
|
157
|
+
"statusVal": "",
|
|
158
|
+
"statusType": "auto",
|
|
159
|
+
"x": 840,
|
|
160
|
+
"y": 900,
|
|
161
|
+
"wires": []
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "426fbfe213956970",
|
|
165
|
+
"type": "debug",
|
|
166
|
+
"z": "e5afc2ee2cd84f5f",
|
|
167
|
+
"name": "debug 55",
|
|
168
|
+
"active": true,
|
|
169
|
+
"tosidebar": true,
|
|
170
|
+
"console": false,
|
|
171
|
+
"tostatus": false,
|
|
172
|
+
"complete": "true",
|
|
173
|
+
"targetType": "full",
|
|
174
|
+
"statusVal": "",
|
|
175
|
+
"statusType": "auto",
|
|
176
|
+
"x": 840,
|
|
177
|
+
"y": 940,
|
|
178
|
+
"wires": []
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"id": "3364e6bd6f626459",
|
|
182
|
+
"type": "debug",
|
|
183
|
+
"z": "e5afc2ee2cd84f5f",
|
|
184
|
+
"name": "debug 56",
|
|
185
|
+
"active": true,
|
|
186
|
+
"tosidebar": true,
|
|
187
|
+
"console": false,
|
|
188
|
+
"tostatus": false,
|
|
189
|
+
"complete": "true",
|
|
190
|
+
"targetType": "full",
|
|
191
|
+
"statusVal": "",
|
|
192
|
+
"statusType": "auto",
|
|
193
|
+
"x": 840,
|
|
194
|
+
"y": 980,
|
|
195
|
+
"wires": []
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"id": "a17f879cc0ab0bdd",
|
|
199
|
+
"type": "inject",
|
|
200
|
+
"z": "e5afc2ee2cd84f5f",
|
|
201
|
+
"name": "",
|
|
202
|
+
"props": [
|
|
203
|
+
{
|
|
204
|
+
"p": "topic",
|
|
205
|
+
"vt": "str"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"p": "payload"
|
|
209
|
+
}
|
|
210
|
+
],
|
|
211
|
+
"repeat": "",
|
|
212
|
+
"crontab": "",
|
|
213
|
+
"once": false,
|
|
214
|
+
"onceDelay": 0.1,
|
|
215
|
+
"topic": "set_mode#INVALID",
|
|
216
|
+
"payload": "true",
|
|
217
|
+
"payloadType": "bool",
|
|
218
|
+
"x": 170,
|
|
219
|
+
"y": 960,
|
|
220
|
+
"wires": [
|
|
221
|
+
[
|
|
222
|
+
"10bed778aa45fba9"
|
|
223
|
+
]
|
|
224
|
+
]
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"id": "7a690df24ee6d987",
|
|
228
|
+
"type": "inject",
|
|
229
|
+
"z": "e5afc2ee2cd84f5f",
|
|
230
|
+
"name": "",
|
|
231
|
+
"props": [
|
|
232
|
+
{
|
|
233
|
+
"p": "topic",
|
|
234
|
+
"vt": "str"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"p": "payload"
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
"repeat": "",
|
|
241
|
+
"crontab": "",
|
|
242
|
+
"once": false,
|
|
243
|
+
"onceDelay": 0.1,
|
|
244
|
+
"topic": "toggle_mode",
|
|
245
|
+
"payload": "OFF",
|
|
246
|
+
"payloadType": "str",
|
|
247
|
+
"x": 150,
|
|
248
|
+
"y": 1060,
|
|
249
|
+
"wires": [
|
|
250
|
+
[
|
|
251
|
+
"10bed778aa45fba9"
|
|
252
|
+
]
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"id": "d7131ebc318d8b95",
|
|
257
|
+
"type": "inject",
|
|
258
|
+
"z": "e5afc2ee2cd84f5f",
|
|
259
|
+
"name": "",
|
|
260
|
+
"props": [
|
|
261
|
+
{
|
|
262
|
+
"p": "topic",
|
|
263
|
+
"vt": "str"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"p": "payload"
|
|
267
|
+
}
|
|
268
|
+
],
|
|
269
|
+
"repeat": "",
|
|
270
|
+
"crontab": "",
|
|
271
|
+
"once": false,
|
|
272
|
+
"onceDelay": 0.1,
|
|
273
|
+
"topic": "toggle_mode",
|
|
274
|
+
"payload": "HEAT",
|
|
275
|
+
"payloadType": "str",
|
|
276
|
+
"x": 150,
|
|
277
|
+
"y": 1100,
|
|
278
|
+
"wires": [
|
|
279
|
+
[
|
|
280
|
+
"10bed778aa45fba9"
|
|
281
|
+
]
|
|
282
|
+
]
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"id": "8bfa35408f20dc1a",
|
|
286
|
+
"type": "inject",
|
|
287
|
+
"z": "e5afc2ee2cd84f5f",
|
|
288
|
+
"name": "",
|
|
289
|
+
"props": [
|
|
290
|
+
{
|
|
291
|
+
"p": "topic",
|
|
292
|
+
"vt": "str"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"p": "payload"
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
"repeat": "",
|
|
299
|
+
"crontab": "",
|
|
300
|
+
"once": false,
|
|
301
|
+
"onceDelay": 0.1,
|
|
302
|
+
"topic": "toggle_mode",
|
|
303
|
+
"payload": "COOL",
|
|
304
|
+
"payloadType": "str",
|
|
305
|
+
"x": 150,
|
|
306
|
+
"y": 1140,
|
|
307
|
+
"wires": [
|
|
308
|
+
[
|
|
309
|
+
"10bed778aa45fba9"
|
|
310
|
+
]
|
|
311
|
+
]
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"id": "7b966913932ab629",
|
|
315
|
+
"type": "inject",
|
|
316
|
+
"z": "e5afc2ee2cd84f5f",
|
|
317
|
+
"name": "",
|
|
318
|
+
"props": [
|
|
319
|
+
{
|
|
320
|
+
"p": "topic",
|
|
321
|
+
"vt": "str"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"p": "payload"
|
|
325
|
+
}
|
|
326
|
+
],
|
|
327
|
+
"repeat": "",
|
|
328
|
+
"crontab": "",
|
|
329
|
+
"once": false,
|
|
330
|
+
"onceDelay": 0.1,
|
|
331
|
+
"topic": "toggle_mode",
|
|
332
|
+
"payload": "INVALID",
|
|
333
|
+
"payloadType": "str",
|
|
334
|
+
"x": 160,
|
|
335
|
+
"y": 1180,
|
|
336
|
+
"wires": [
|
|
337
|
+
[
|
|
338
|
+
"10bed778aa45fba9"
|
|
339
|
+
]
|
|
340
|
+
]
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"id": "cd15893ad83850f2",
|
|
344
|
+
"type": "inject",
|
|
345
|
+
"z": "e5afc2ee2cd84f5f",
|
|
346
|
+
"name": "",
|
|
347
|
+
"props": [
|
|
348
|
+
{
|
|
349
|
+
"p": "topic",
|
|
350
|
+
"vt": "str"
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"p": "payload"
|
|
354
|
+
}
|
|
355
|
+
],
|
|
356
|
+
"repeat": "",
|
|
357
|
+
"crontab": "",
|
|
358
|
+
"once": false,
|
|
359
|
+
"onceDelay": 0.1,
|
|
360
|
+
"topic": "set_mode#HEAT",
|
|
361
|
+
"payload": "false",
|
|
362
|
+
"payloadType": "bool",
|
|
363
|
+
"x": 160,
|
|
364
|
+
"y": 840,
|
|
365
|
+
"wires": [
|
|
366
|
+
[
|
|
367
|
+
"10bed778aa45fba9"
|
|
368
|
+
]
|
|
369
|
+
]
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"id": "59a0cec371499c34",
|
|
373
|
+
"type": "inject",
|
|
374
|
+
"z": "e5afc2ee2cd84f5f",
|
|
375
|
+
"name": "",
|
|
376
|
+
"props": [
|
|
377
|
+
{
|
|
378
|
+
"p": "topic",
|
|
379
|
+
"vt": "str"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"p": "payload"
|
|
383
|
+
}
|
|
384
|
+
],
|
|
385
|
+
"repeat": "",
|
|
386
|
+
"crontab": "",
|
|
387
|
+
"once": false,
|
|
388
|
+
"onceDelay": 0.1,
|
|
389
|
+
"topic": "set_mode#COOL",
|
|
390
|
+
"payload": "false",
|
|
391
|
+
"payloadType": "bool",
|
|
392
|
+
"x": 160,
|
|
393
|
+
"y": 920,
|
|
394
|
+
"wires": [
|
|
395
|
+
[
|
|
396
|
+
"10bed778aa45fba9"
|
|
397
|
+
]
|
|
398
|
+
]
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"id": "11c9512a37b9cb89",
|
|
402
|
+
"type": "inject",
|
|
403
|
+
"z": "e5afc2ee2cd84f5f",
|
|
404
|
+
"name": "",
|
|
405
|
+
"props": [
|
|
406
|
+
{
|
|
407
|
+
"p": "topic",
|
|
408
|
+
"vt": "str"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"p": "payload"
|
|
412
|
+
}
|
|
413
|
+
],
|
|
414
|
+
"repeat": "",
|
|
415
|
+
"crontab": "",
|
|
416
|
+
"once": false,
|
|
417
|
+
"onceDelay": 0.1,
|
|
418
|
+
"topic": "set_mode#INVALID",
|
|
419
|
+
"payload": "false",
|
|
420
|
+
"payloadType": "bool",
|
|
421
|
+
"x": 170,
|
|
422
|
+
"y": 1000,
|
|
423
|
+
"wires": [
|
|
424
|
+
[
|
|
425
|
+
"10bed778aa45fba9"
|
|
426
|
+
]
|
|
427
|
+
]
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"id": "7456fd4d2939f625",
|
|
431
|
+
"type": "inject",
|
|
432
|
+
"z": "e5afc2ee2cd84f5f",
|
|
433
|
+
"name": "",
|
|
434
|
+
"props": [
|
|
435
|
+
{
|
|
436
|
+
"p": "topic",
|
|
437
|
+
"vt": "str"
|
|
438
|
+
}
|
|
439
|
+
],
|
|
440
|
+
"repeat": "",
|
|
441
|
+
"crontab": "",
|
|
442
|
+
"once": false,
|
|
443
|
+
"onceDelay": 0.1,
|
|
444
|
+
"topic": "debug",
|
|
445
|
+
"x": 110,
|
|
446
|
+
"y": 660,
|
|
447
|
+
"wires": [
|
|
448
|
+
[
|
|
449
|
+
"10bed778aa45fba9"
|
|
450
|
+
]
|
|
451
|
+
]
|
|
452
|
+
}
|
|
453
|
+
]
|
|
Binary file
|
|
@@ -20,7 +20,22 @@
|
|
|
20
20
|
</tr>
|
|
21
21
|
<tr>
|
|
22
22
|
<td><code>set_mode</code></td>
|
|
23
|
-
<td>Aktiviert den in <code>msg.payload</code> angegebenen Modus, sofern dieser konfiguriert wurde.</td>
|
|
23
|
+
<td>Aktiviert den in <code>msg.payload</code> angegebenen Modus, sofern dieser auch konfiguriert wurde.</td>
|
|
24
|
+
</tr>
|
|
25
|
+
<tr>
|
|
26
|
+
<td><code>set_mode#MODE_NAME</code></td>
|
|
27
|
+
<td>
|
|
28
|
+
Wenn <code>msg.payload = true</code>, dann wird der Modus <code>MODE_NAME</code> aktiviert, sofern dieser auch konfiguriert wurde.<br/>
|
|
29
|
+
Wenn <code>msg.payload = false</code>, dann wird default Modus, der erste in der Liste, aktiviert.<br/>
|
|
30
|
+
Dieser Topic eignet sich besonders in Kombination mit den KNX-Ultimate Bausteinen.
|
|
31
|
+
</td>
|
|
32
|
+
</tr>
|
|
33
|
+
<tr>
|
|
34
|
+
<td><code>toggle_mode</code></td>
|
|
35
|
+
<td>
|
|
36
|
+
Aktiviert den in <code>msg.payload</code> angegebenen Modus, sofern dieser auch konfiguriert wurde.<br/>
|
|
37
|
+
Sollte dieser bereits der aktive Modus sein, wird der default Modus, der erste in der Liste, aktiviert.
|
|
38
|
+
</td>
|
|
24
39
|
</tr>
|
|
25
40
|
<tr>
|
|
26
41
|
<td><code>refresh</code></td>
|
|
@@ -6,27 +6,42 @@
|
|
|
6
6
|
</p>
|
|
7
7
|
<p>
|
|
8
8
|
The following topics are accepted:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
9
|
+
<table>
|
|
10
|
+
<thead>
|
|
11
|
+
<tr>
|
|
12
|
+
<th>Topic</th>
|
|
13
|
+
<th>Description</th>
|
|
14
|
+
</tr>
|
|
15
|
+
</thead>
|
|
16
|
+
<tbody>
|
|
17
|
+
<tr>
|
|
18
|
+
<td><code>debug</code></td>
|
|
19
|
+
<td>Displays current node settings in the debug window.</td>
|
|
20
|
+
</tr>
|
|
21
|
+
<tr>
|
|
22
|
+
<td><code>set_mode</code></td>
|
|
23
|
+
<td>Activates the mode specified in <code>msg.payload</code>, if configured.</td>
|
|
24
|
+
</tr>
|
|
25
|
+
<tr>
|
|
26
|
+
<td><code>set_mode#MODE_NAME</code></td>
|
|
27
|
+
<td>
|
|
28
|
+
If <code>msg.payload = true</code>, then the <code>MODE_NAME</code> mode is activated, if configured.<br />
|
|
29
|
+
If <code>msg.payload = false</code>, then the default mode, the first in the list, is activated.<br />
|
|
30
|
+
This topic is particularly suitable in combination with the KNX Ultimate module.
|
|
31
|
+
</td>
|
|
32
|
+
</tr>
|
|
33
|
+
<tr>
|
|
34
|
+
<td><code>toggle_mode</code></td>
|
|
35
|
+
<td>
|
|
36
|
+
Activates the mode specified in <code>msg.payload</code>, if configured.<br />
|
|
37
|
+
If this is already the active mode, then the default mode, the first in the list, is activated.
|
|
38
|
+
</td>
|
|
39
|
+
</tr>
|
|
40
|
+
<tr>
|
|
41
|
+
<td><code>refresh</code></td>
|
|
42
|
+
<td>Outputs the last set mode.</td>
|
|
43
|
+
</tr>
|
|
44
|
+
</tbody>
|
|
45
|
+
</table>
|
|
31
46
|
</p>
|
|
32
47
|
</script>
|
|
@@ -65,57 +65,117 @@ module.exports = function (RED)
|
|
|
65
65
|
// This is the main function which handles all topics that was received.
|
|
66
66
|
let handleTopic = msg =>
|
|
67
67
|
{
|
|
68
|
-
let real_topic =
|
|
68
|
+
let [real_topic, new_mode] = msg.topic.split("#");
|
|
69
69
|
|
|
70
70
|
switch (real_topic)
|
|
71
71
|
{
|
|
72
72
|
case "debug":
|
|
73
73
|
helper.nodeDebug(node, {
|
|
74
|
-
node_settings
|
|
74
|
+
node_settings,
|
|
75
|
+
mode_items,
|
|
76
|
+
previous_mode,
|
|
77
|
+
update_only_changed_outputs
|
|
75
78
|
});
|
|
76
79
|
break;
|
|
77
80
|
|
|
78
81
|
case "set_mode":
|
|
79
82
|
{
|
|
80
|
-
|
|
81
|
-
if (selectedIndex === -1)
|
|
83
|
+
if (typeof msg.payload === "boolean")
|
|
82
84
|
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
// Syntax: set_mode#MODE_NAME and payload is boolean
|
|
86
|
+
// If payload is true, set to MODE_NAME
|
|
87
|
+
// if payload is false, set to default mode
|
|
88
|
+
let mode_from_topic = new_mode;
|
|
89
|
+
if (msg.payload === false)
|
|
90
|
+
new_mode = mode_items[0];
|
|
91
|
+
|
|
92
|
+
let selectedIndex = mode_items.indexOf(new_mode);
|
|
93
|
+
if (selectedIndex === -1)
|
|
94
|
+
{
|
|
95
|
+
node.warn("set_mode: invalid mode: '" + new_mode + "' not defined");
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// No change, don't send anything
|
|
100
|
+
if (node_settings.last_mode == new_mode)
|
|
101
|
+
break;
|
|
102
|
+
|
|
103
|
+
node_settings.last_mode = new_mode;
|
|
104
|
+
|
|
105
|
+
// if the given mode_from_topic was the previous mode and is turned off, now
|
|
106
|
+
if (msg.payload === false)
|
|
107
|
+
{
|
|
108
|
+
// a mode was turned off that wasn't active before, do nothing
|
|
109
|
+
if (previous_mode != mode_from_topic)
|
|
110
|
+
break;
|
|
111
|
+
|
|
112
|
+
// don't send turn off again
|
|
113
|
+
previous_mode = null;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// if the given mode_from_topic is the new mode and is turned on, now
|
|
117
|
+
if (msg.payload === true)
|
|
118
|
+
{
|
|
119
|
+
// don't send turn on again
|
|
120
|
+
node_settings.last_mode = null;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
sendCurrentMode();
|
|
124
|
+
|
|
125
|
+
node_settings.last_mode = new_mode;
|
|
126
|
+
previous_mode = new_mode;
|
|
127
|
+
smart_context.set(node.id, node_settings);
|
|
85
128
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
129
|
+
else if (typeof msg.payload === "string")
|
|
130
|
+
{
|
|
131
|
+
if (new_mode != null)
|
|
132
|
+
{
|
|
133
|
+
node.warn("set_mode: when using mode in topic, payload has to be boolean");
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
let selectedIndex = mode_items.indexOf(msg.payload);
|
|
138
|
+
if (selectedIndex === -1)
|
|
139
|
+
{
|
|
140
|
+
node.warn("set_mode: invalid mode: '" + msg.payload + "' not defined");
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// No change, don't send anything
|
|
145
|
+
if (node_settings.last_mode == msg.payload)
|
|
146
|
+
break;
|
|
147
|
+
|
|
148
|
+
node_settings.last_mode = msg.payload;
|
|
149
|
+
smart_context.set(node.id, node_settings);
|
|
150
|
+
sendCurrentMode();
|
|
151
|
+
}
|
|
152
|
+
else
|
|
153
|
+
{
|
|
154
|
+
node.warn("set_mode: invalid payload, has to be string or boolean");
|
|
89
155
|
break;
|
|
90
|
-
|
|
91
|
-
node_settings.last_mode = msg.payload;
|
|
92
|
-
smart_context.set(node.id, node_settings);
|
|
93
|
-
sendCurrentMode();
|
|
156
|
+
}
|
|
94
157
|
}
|
|
95
158
|
break;
|
|
96
159
|
|
|
97
|
-
|
|
98
|
-
case "set_mode_with_default":
|
|
160
|
+
case "toggle_mode":
|
|
99
161
|
{
|
|
100
|
-
let
|
|
162
|
+
let new_mode = msg.payload;
|
|
163
|
+
let selectedIndex = mode_items.indexOf(new_mode);
|
|
101
164
|
if (selectedIndex === -1)
|
|
102
165
|
{
|
|
103
|
-
node.warn("set_mode: invalid payload, mode '" +
|
|
166
|
+
node.warn("set_mode: invalid payload, mode '" + new_mode + "' not found");
|
|
104
167
|
break;
|
|
105
168
|
}
|
|
106
169
|
|
|
107
170
|
// No change, go to default mode
|
|
108
|
-
if (node_settings.last_mode ==
|
|
109
|
-
|
|
110
|
-
selectedIndex = 0;
|
|
111
|
-
msg.payload = mode_items[0];
|
|
112
|
-
}
|
|
171
|
+
if (node_settings.last_mode == new_mode)
|
|
172
|
+
new_mode = mode_items[0];
|
|
113
173
|
|
|
114
174
|
// No change, don't send anything
|
|
115
|
-
if (node_settings.last_mode ==
|
|
175
|
+
if (node_settings.last_mode == new_mode)
|
|
116
176
|
break;
|
|
117
177
|
|
|
118
|
-
node_settings.last_mode =
|
|
178
|
+
node_settings.last_mode = new_mode;
|
|
119
179
|
smart_context.set(node.id, node_settings);
|
|
120
180
|
sendCurrentMode();
|
|
121
181
|
}
|
package/package.json
CHANGED
|
Binary file
|