smart-nodes 0.3.36 → 0.4.0
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 +62 -0
- package/README.md +35 -17
- package/central/central.html +27 -24
- package/central/central.js +84 -26
- package/central/locales/de-DE/central.html +10 -0
- package/central/locales/de-DE/central.json +14 -0
- package/central/locales/en-US/central.html +10 -0
- package/central/locales/en-US/central.json +14 -0
- package/compare/compare.html +64 -87
- package/compare/compare.js +69 -29
- package/compare/locales/de-DE/compare.html +36 -0
- package/compare/locales/de-DE/compare.json +35 -0
- package/compare/locales/en-US/compare.html +36 -0
- package/compare/locales/en-US/compare.json +35 -0
- package/counter/counter.html +70 -72
- package/counter/counter.js +43 -20
- package/counter/locales/de-DE/counter.html +48 -0
- package/counter/locales/de-DE/counter.json +21 -0
- package/counter/locales/en-US/counter.html +48 -0
- package/counter/locales/en-US/counter.json +21 -0
- package/delay/delay.html +30 -102
- package/delay/delay.js +63 -20
- package/delay/locales/de-DE/delay.html +71 -0
- package/delay/locales/de-DE/delay.json +19 -0
- package/delay/locales/en-US/delay.html +76 -0
- package/delay/locales/en-US/delay.json +19 -0
- package/forwarder/forwarder.html +11 -42
- package/forwarder/forwarder.js +59 -18
- package/forwarder/locales/de-DE/forwarder.html +32 -0
- package/forwarder/locales/de-DE/forwarder.json +15 -0
- package/forwarder/locales/en-US/forwarder.html +32 -0
- package/forwarder/locales/en-US/forwarder.json +15 -0
- package/heating-curve/heating-curve.html +10 -51
- package/heating-curve/heating-curve.js +38 -13
- package/heating-curve/locales/de-DE/heating-curve.html +38 -0
- package/heating-curve/locales/de-DE/heating-curve.json +12 -0
- package/heating-curve/locales/en-US/heating-curve.html +38 -0
- package/heating-curve/locales/en-US/heating-curve.json +12 -0
- package/hysteresis/hysteresis.html +49 -69
- package/hysteresis/hysteresis.js +94 -68
- package/hysteresis/locales/de-DE/hysteresis.html +36 -0
- package/hysteresis/locales/de-DE/hysteresis.json +27 -0
- package/hysteresis/locales/en-US/hysteresis.html +36 -0
- package/hysteresis/locales/en-US/hysteresis.json +27 -0
- package/light/light.html +250 -0
- package/{light-control/light-control.js → light/light.js} +151 -32
- package/light/locales/de-DE/light.html +149 -0
- package/light/locales/de-DE/light.json +24 -0
- package/light/locales/en-US/light.html +148 -0
- package/light/locales/en-US/light.json +24 -0
- package/logic/locales/de-DE/logic.html +12 -0
- package/logic/locales/de-DE/logic.json +26 -0
- package/logic/locales/en-US/logic.html +12 -0
- package/logic/locales/en-US/logic.json +26 -0
- package/logic/logic.html +48 -64
- package/logic/logic.js +63 -29
- package/long-press/locales/de-DE/long-press.html +5 -0
- package/long-press/locales/de-DE/long-press.json +13 -0
- package/long-press/locales/en-US/long-press.html +5 -0
- package/long-press/locales/en-US/long-press.json +13 -0
- package/{long-press-control/long-press-control.html → long-press/long-press.html} +10 -14
- package/long-press/long-press.js +163 -0
- package/mixing-valve/locales/de-DE/mixing-valve.html +65 -0
- package/mixing-valve/locales/de-DE/mixing-valve.json +19 -0
- package/mixing-valve/locales/en-US/mixing-valve.html +66 -0
- package/mixing-valve/locales/en-US/mixing-valve.json +19 -0
- package/mixing-valve/mixing-valve.html +27 -93
- package/mixing-valve/mixing-valve.js +87 -61
- package/multi-press/locales/de-DE/multi-press.html +5 -0
- package/multi-press/locales/de-DE/multi-press.json +12 -0
- package/multi-press/locales/en-US/multi-press.html +5 -0
- package/multi-press/locales/en-US/multi-press.json +12 -0
- package/{multi-press-control/multi-press-control.html → multi-press/multi-press.html} +9 -13
- package/{multi-press-control/multi-press-control.js → multi-press/multi-press.js} +53 -5
- package/package.json +7 -7
- package/persistence.js +1 -0
- package/scene/locales/de-DE/scene.html +105 -0
- package/scene/locales/de-DE/scene.json +21 -0
- package/scene/locales/en-US/scene.html +107 -0
- package/scene/locales/en-US/scene.json +20 -0
- package/{scene-control/scene-control.html → scene/scene.html} +30 -132
- package/{scene-control/scene-control.js → scene/scene.js} +76 -26
- package/scheduler/locales/de-DE/scheduler.html +30 -0
- package/scheduler/locales/de-DE/scheduler.json +21 -0
- package/scheduler/locales/en-US/scheduler.html +30 -0
- package/scheduler/locales/en-US/scheduler.json +21 -0
- package/scheduler/scheduler.html +34 -64
- package/scheduler/scheduler.js +85 -53
- package/shutter/locales/de-DE/shutter.html +127 -0
- package/shutter/locales/de-DE/shutter.json +11 -0
- package/shutter/locales/en-US/shutter.html +133 -0
- package/shutter/locales/en-US/shutter.json +11 -0
- package/{shutter-control/shutter-control.html → shutter/shutter.html} +7 -133
- package/{shutter-control/shutter-control.js → shutter/shutter.js} +116 -56
- package/shutter-complex/locales/de-DE/shutter-complex.html +120 -0
- package/shutter-complex/locales/de-DE/shutter-complex.json +20 -0
- package/shutter-complex/locales/en-US/shutter-complex.html +120 -0
- package/shutter-complex/locales/en-US/shutter-complex.json +20 -0
- package/{shutter-complex-control/shutter-complex-control.html → shutter-complex/shutter-complex.html} +36 -140
- package/shutter-complex/shutter-complex.js +578 -0
- package/smart_helper.js +52 -9
- package/statistic/locales/de-DE/statistic.html +10 -0
- package/statistic/locales/de-DE/statistic.json +29 -0
- package/statistic/locales/en-US/statistic.html +10 -0
- package/statistic/locales/en-US/statistic.json +29 -0
- package/statistic/statistic.html +38 -43
- package/statistic/statistic.js +57 -28
- package/text-exec/locales/de-DE/text-exec.html +18 -0
- package/text-exec/locales/de-DE/text-exec.json +7 -0
- package/text-exec/locales/en-US/text-exec.html +18 -0
- package/text-exec/locales/en-US/text-exec.json +7 -0
- package/text-exec/text-exec.html +9 -25
- package/text-exec/text-exec.js +43 -2
- package/light-control/light-control.html +0 -363
- package/long-press-control/long-press-control.js +0 -76
- package/shutter-complex-control/shutter-complex-control.js +0 -442
|
@@ -7,32 +7,69 @@ module.exports = function (RED)
|
|
|
7
7
|
const node = this;
|
|
8
8
|
RED.nodes.createNode(node, config);
|
|
9
9
|
|
|
10
|
+
// ###################
|
|
11
|
+
// # Class constants #
|
|
12
|
+
// ###################
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
// #######################
|
|
16
|
+
// # Global help objects #
|
|
17
|
+
// #######################
|
|
10
18
|
const smart_context = require("../persistence.js")(RED);
|
|
11
19
|
const helper = require("../smart_helper.js");
|
|
12
20
|
|
|
13
|
-
|
|
21
|
+
|
|
22
|
+
// ############################
|
|
23
|
+
// # Used from text-exec node #
|
|
24
|
+
// ############################
|
|
14
25
|
if (typeof config.exec_text_names == "string")
|
|
15
26
|
node.exec_text_names = config.exec_text_names.split(",").map(n => n.trim().toLowerCase());
|
|
16
27
|
else
|
|
17
28
|
node.exec_text_names = [];
|
|
18
29
|
|
|
19
|
-
|
|
20
|
-
|
|
30
|
+
|
|
31
|
+
// #####################
|
|
32
|
+
// # persistent values #
|
|
33
|
+
// #####################
|
|
34
|
+
var node_settings = helper.cloneObject({
|
|
21
35
|
last_value: false,
|
|
36
|
+
last_value_before_alarm: false,
|
|
37
|
+
last_value_sended: false,
|
|
38
|
+
alarm_active: false,
|
|
22
39
|
}, smart_context.get(node.id));
|
|
23
40
|
|
|
24
|
-
|
|
41
|
+
|
|
42
|
+
// ##################
|
|
43
|
+
// # Dynamic config #
|
|
44
|
+
// ##################
|
|
25
45
|
let max_time_on = helper.getTimeInMs(config.max_time_on, config.max_time_on_unit);
|
|
26
46
|
let alarm_action = config.alarm_action || "NOTHING";
|
|
47
|
+
let alarm_off_action = config.alarm_off_action || "NOTHING";
|
|
48
|
+
|
|
49
|
+
// ##################
|
|
50
|
+
// # Runtime values #
|
|
51
|
+
// ##################
|
|
27
52
|
|
|
28
|
-
//
|
|
29
|
-
|
|
53
|
+
// Here the setTimeout return value is stored to turn off the light.
|
|
54
|
+
// That means if it is null, the light will not be turned off automatically.
|
|
55
|
+
let timeout = null;
|
|
56
|
+
|
|
57
|
+
// If isPermanent is true, then a default on time value is ignored
|
|
58
|
+
// Also if the motion sensor turns off, no timeout is started.
|
|
30
59
|
let isPermanent = false;
|
|
60
|
+
|
|
61
|
+
// If this is on, a motion sensor has detected a move, so the on time value is ignored.
|
|
62
|
+
// The timeout starts only if the motion sensor goes off.
|
|
31
63
|
let isMotion = false;
|
|
64
|
+
|
|
65
|
+
// Here the date is stored, when the light should go off.
|
|
66
|
+
// This is used to calculate the node status.
|
|
32
67
|
let timeout_end_date = null;
|
|
33
|
-
let alarm_active = false;
|
|
34
68
|
|
|
35
|
-
|
|
69
|
+
|
|
70
|
+
// #########################
|
|
71
|
+
// # Central node handling #
|
|
72
|
+
// #########################
|
|
36
73
|
var event = "node:" + node.id;
|
|
37
74
|
var handler = function (msg)
|
|
38
75
|
{
|
|
@@ -41,6 +78,9 @@ module.exports = function (RED)
|
|
|
41
78
|
RED.events.on(event, handler);
|
|
42
79
|
|
|
43
80
|
|
|
81
|
+
// ###############
|
|
82
|
+
// # Node events #
|
|
83
|
+
// ###############
|
|
44
84
|
node.on("input", function (msg)
|
|
45
85
|
{
|
|
46
86
|
handleTopic(msg);
|
|
@@ -55,17 +95,26 @@ module.exports = function (RED)
|
|
|
55
95
|
RED.events.off(event, handler);
|
|
56
96
|
});
|
|
57
97
|
|
|
98
|
+
|
|
99
|
+
// #####################
|
|
100
|
+
// # Private functions #
|
|
101
|
+
// #####################
|
|
102
|
+
|
|
103
|
+
// This is the main function which handles all topics that was received.
|
|
58
104
|
let handleTopic = msg =>
|
|
59
105
|
{
|
|
60
106
|
let doRestartTimer = true;
|
|
107
|
+
let real_topic = helper.getTopicName(msg.topic);
|
|
61
108
|
|
|
62
|
-
switch (
|
|
109
|
+
switch (real_topic)
|
|
63
110
|
{
|
|
64
111
|
case "status":
|
|
65
112
|
// Make sure it is bool
|
|
66
113
|
msg.payload = !!msg.payload;
|
|
67
114
|
|
|
68
|
-
|
|
115
|
+
// Output is already in the state of the status value and the timeout is running.
|
|
116
|
+
// No need to restart the timeout.
|
|
117
|
+
if (node_settings.last_value == msg.payload && timeout != null)
|
|
69
118
|
doRestartTimer = false;
|
|
70
119
|
|
|
71
120
|
node_settings.last_value = msg.payload;
|
|
@@ -77,6 +126,7 @@ module.exports = function (RED)
|
|
|
77
126
|
return;
|
|
78
127
|
|
|
79
128
|
node_settings.last_value = false;
|
|
129
|
+
node_settings.last_value_sended = node_settings.last_value;
|
|
80
130
|
break;
|
|
81
131
|
|
|
82
132
|
case "on":
|
|
@@ -85,19 +135,24 @@ module.exports = function (RED)
|
|
|
85
135
|
return;
|
|
86
136
|
|
|
87
137
|
node_settings.last_value = true;
|
|
138
|
+
node_settings.last_value_sended = node_settings.last_value;
|
|
88
139
|
break;
|
|
89
140
|
|
|
90
141
|
case "set":
|
|
91
142
|
// Make sure it is bool
|
|
92
143
|
msg.payload = !!msg.payload;
|
|
144
|
+
|
|
93
145
|
node_settings.last_value = msg.payload;
|
|
146
|
+
node_settings.last_value_sended = node_settings.last_value;
|
|
94
147
|
break;
|
|
95
148
|
|
|
96
149
|
case "set_permanent":
|
|
97
150
|
// Make sure it is bool
|
|
98
151
|
msg.payload = !!msg.payload;
|
|
99
|
-
node_settings.last_value = msg.payload;
|
|
100
152
|
isPermanent = msg.payload;
|
|
153
|
+
|
|
154
|
+
node_settings.last_value = msg.payload;
|
|
155
|
+
node_settings.last_value_sended = node_settings.last_value;
|
|
101
156
|
break;
|
|
102
157
|
|
|
103
158
|
case "motion":
|
|
@@ -119,21 +174,67 @@ module.exports = function (RED)
|
|
|
119
174
|
{
|
|
120
175
|
node_settings.last_value = true;
|
|
121
176
|
}
|
|
177
|
+
node_settings.last_value_sended = node_settings.last_value;
|
|
178
|
+
break;
|
|
179
|
+
|
|
180
|
+
case "toggle":
|
|
181
|
+
// If button is released, don't handle this message
|
|
182
|
+
if (msg.payload === false)
|
|
183
|
+
return;
|
|
184
|
+
|
|
185
|
+
node_settings.last_value_sended = !node_settings.last_value;
|
|
186
|
+
|
|
187
|
+
if (!node_settings.alarm_active)
|
|
188
|
+
node_settings.last_value = !node_settings.last_value;
|
|
122
189
|
break;
|
|
123
190
|
|
|
124
191
|
case "alarm":
|
|
125
192
|
// Make sure it is bool
|
|
126
193
|
msg.payload = !!msg.payload;
|
|
127
|
-
|
|
194
|
+
|
|
195
|
+
// No alarm change, do nothing
|
|
196
|
+
if (node_settings.alarm_active == msg.payload)
|
|
197
|
+
return;
|
|
198
|
+
|
|
199
|
+
node_settings.alarm_active = msg.payload;
|
|
200
|
+
if (node_settings.alarm_active)
|
|
201
|
+
{
|
|
202
|
+
// Alarm turned on
|
|
203
|
+
node_settings.last_value_before_alarm = node_settings.last_value;
|
|
204
|
+
}
|
|
205
|
+
else
|
|
206
|
+
{
|
|
207
|
+
// Alarm turned off
|
|
208
|
+
switch (alarm_off_action)
|
|
209
|
+
{
|
|
210
|
+
case "NOTHING":
|
|
211
|
+
break;
|
|
212
|
+
|
|
213
|
+
case "ON":
|
|
214
|
+
node_settings.last_value = true;
|
|
215
|
+
break;
|
|
216
|
+
|
|
217
|
+
case "OFF":
|
|
218
|
+
node_settings.last_value = false;
|
|
219
|
+
break;
|
|
220
|
+
|
|
221
|
+
case "LAST":
|
|
222
|
+
node_settings.last_value = node_settings.last_value_before_alarm;
|
|
223
|
+
break;
|
|
224
|
+
|
|
225
|
+
case "LAST_SENDED":
|
|
226
|
+
node_settings.last_value = node_settings.last_value_sended;
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
128
231
|
break;
|
|
129
232
|
|
|
130
|
-
case "toggle":
|
|
131
233
|
default:
|
|
132
|
-
|
|
133
|
-
if (msg.payload === false)
|
|
134
|
-
return;
|
|
234
|
+
node_settings.last_value_sended = !node_settings.last_value;
|
|
135
235
|
|
|
136
|
-
|
|
236
|
+
if (!node_settings.alarm_active)
|
|
237
|
+
node_settings.last_value = !node_settings.last_value;
|
|
137
238
|
break;
|
|
138
239
|
}
|
|
139
240
|
|
|
@@ -141,7 +242,7 @@ module.exports = function (RED)
|
|
|
141
242
|
stopAutoOff();
|
|
142
243
|
|
|
143
244
|
// Check alarm values
|
|
144
|
-
if (alarm_active)
|
|
245
|
+
if (node_settings.alarm_active)
|
|
145
246
|
{
|
|
146
247
|
isPermanent = false;
|
|
147
248
|
|
|
@@ -151,14 +252,17 @@ module.exports = function (RED)
|
|
|
151
252
|
node_settings.last_value = true;
|
|
152
253
|
break;
|
|
153
254
|
|
|
154
|
-
default:
|
|
155
255
|
case "OFF":
|
|
156
256
|
node_settings.last_value = false;
|
|
157
257
|
break;
|
|
258
|
+
|
|
259
|
+
case "NOTHING":
|
|
260
|
+
default:
|
|
261
|
+
break;
|
|
158
262
|
}
|
|
159
263
|
}
|
|
160
264
|
|
|
161
|
-
if (alarm_active || helper.getTopicName(msg.topic) != "status")
|
|
265
|
+
if (node_settings.alarm_active || helper.getTopicName(msg.topic) != "status")
|
|
162
266
|
node.send({ payload: node_settings.last_value });
|
|
163
267
|
|
|
164
268
|
// Output is on, now
|
|
@@ -168,17 +272,22 @@ module.exports = function (RED)
|
|
|
168
272
|
notifyCentral(node_settings.last_value);
|
|
169
273
|
}
|
|
170
274
|
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* This function sets a timeout to turn off the light after the defined time is over.
|
|
278
|
+
* @param {*} origTimeMs The on time
|
|
279
|
+
*/
|
|
171
280
|
let startAutoOffIfNeeded = origTimeMs =>
|
|
172
281
|
{
|
|
173
282
|
// No timer when alarm is active
|
|
174
|
-
if (alarm_active)
|
|
283
|
+
if (node_settings.alarm_active)
|
|
175
284
|
return;
|
|
176
285
|
|
|
177
286
|
let timeMs = parseInt(origTimeMs);
|
|
178
287
|
|
|
179
288
|
if (isNaN(timeMs))
|
|
180
289
|
{
|
|
181
|
-
|
|
290
|
+
console.warn("Invalid time_on value send: " + origTimeMs);
|
|
182
291
|
timeMs = max_time_on;
|
|
183
292
|
}
|
|
184
293
|
|
|
@@ -193,9 +302,9 @@ module.exports = function (RED)
|
|
|
193
302
|
if (timeMs <= 0 || isPermanent || isMotion || !node_settings.last_value)
|
|
194
303
|
return;
|
|
195
304
|
|
|
196
|
-
|
|
305
|
+
timeout = setTimeout(() =>
|
|
197
306
|
{
|
|
198
|
-
|
|
307
|
+
timeout = null;
|
|
199
308
|
node_settings.last_value = false;
|
|
200
309
|
node.send({ payload: false });
|
|
201
310
|
notifyCentral(false);
|
|
@@ -205,26 +314,32 @@ module.exports = function (RED)
|
|
|
205
314
|
}, timeMs);
|
|
206
315
|
};
|
|
207
316
|
|
|
317
|
+
/**
|
|
318
|
+
* Stops the current running timeout
|
|
319
|
+
*/
|
|
208
320
|
let stopAutoOff = () =>
|
|
209
321
|
{
|
|
210
|
-
if (
|
|
322
|
+
if (timeout != null)
|
|
211
323
|
{
|
|
212
|
-
clearTimeout(
|
|
213
|
-
|
|
324
|
+
clearTimeout(timeout);
|
|
325
|
+
timeout = null;
|
|
214
326
|
}
|
|
215
327
|
};
|
|
216
328
|
|
|
329
|
+
/**
|
|
330
|
+
* Set the current node status
|
|
331
|
+
*/
|
|
217
332
|
let setStatus = () =>
|
|
218
333
|
{
|
|
219
|
-
if (alarm_active)
|
|
334
|
+
if (node_settings.alarm_active)
|
|
220
335
|
{
|
|
221
336
|
node.status({ fill: "red", shape: "dot", text: helper.getCurrentTimeForStatus() + ": ALARM is active" });
|
|
222
337
|
}
|
|
223
338
|
else if (node_settings.last_value)
|
|
224
339
|
{
|
|
225
|
-
if (isPermanent || isMotion ||
|
|
340
|
+
if (isPermanent || isMotion || timeout == null)
|
|
226
341
|
node.status({ fill: "green", shape: "dot", text: helper.getCurrentTimeForStatus() + ": On" });
|
|
227
|
-
else if (
|
|
342
|
+
else if (timeout)
|
|
228
343
|
node.status({ fill: "yellow", shape: "ring", text: helper.getCurrentTimeForStatus() + ": Wait " + helper.formatDateToStatus(timeout_end_date, "until") + " for auto off" });
|
|
229
344
|
}
|
|
230
345
|
else
|
|
@@ -233,6 +348,10 @@ module.exports = function (RED)
|
|
|
233
348
|
}
|
|
234
349
|
}
|
|
235
350
|
|
|
351
|
+
/**
|
|
352
|
+
* Notify all connected central nodes
|
|
353
|
+
* @param {boolean} state The state if the light is on
|
|
354
|
+
*/
|
|
236
355
|
let notifyCentral = state =>
|
|
237
356
|
{
|
|
238
357
|
if (!config.links)
|
|
@@ -240,8 +359,8 @@ module.exports = function (RED)
|
|
|
240
359
|
|
|
241
360
|
config.links.forEach(link =>
|
|
242
361
|
{
|
|
243
|
-
|
|
244
|
-
|
|
362
|
+
helper.log(node.id + " -> " + link);
|
|
363
|
+
helper.log({ source: node.id, state: state });
|
|
245
364
|
RED.events.emit("node:" + link, { source: node.id, state: state });
|
|
246
365
|
});
|
|
247
366
|
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
<script type="text/html" data-help-name="smart_light-control">
|
|
2
|
+
<p>
|
|
3
|
+
Diese Node steuert einen Ausgang. Dies kann ein Licht, eine Steckdose oder ähnliches sein.
|
|
4
|
+
Als Ausgang wird immer <code>msg.payload = true</code> oder <code>msg.payload = false</code> gesendet um den Ausgang ein-, bzw. auszuschalten.
|
|
5
|
+
</p>
|
|
6
|
+
<p>
|
|
7
|
+
<b>Hinweis:</b> Smart Nodes verwenden Topics im Format <code>name#nummer</code>, damit können verschiedene Smart Nodes mit dem gleichen Topic angesteuert werden.<br/>
|
|
8
|
+
Diese Node verwendet nur den Teil <code>name</code>. <code>#</code> und <code>nummer</code> sind dabei optional.
|
|
9
|
+
</p>
|
|
10
|
+
<p>
|
|
11
|
+
Folgende topics werden akzeptiert:
|
|
12
|
+
<table>
|
|
13
|
+
<thead>
|
|
14
|
+
<tr>
|
|
15
|
+
<th>Topic</th>
|
|
16
|
+
<th>Beschreibung</th>
|
|
17
|
+
<th>msg.payload == false wird ignoriert</th>
|
|
18
|
+
</tr>
|
|
19
|
+
</thead>
|
|
20
|
+
<tbody>
|
|
21
|
+
<tr>
|
|
22
|
+
<td><code>status</code></td>
|
|
23
|
+
<td>
|
|
24
|
+
Gibt über <code>msg.payload = true</code> oder <code>msg.payload = false</code> den aktuellen Status des Ausgangs an.<br/>
|
|
25
|
+
Bei einem Wechsel von ausgeschaltet nach eingeschaltet wird die Zeitmessung für die hinterlegte, bzw. mitgesendete Zeit gestartet, sofern vorhanden.
|
|
26
|
+
</td>
|
|
27
|
+
<td>Nein</td>
|
|
28
|
+
</tr>
|
|
29
|
+
<tr>
|
|
30
|
+
<td><code>on</code></td>
|
|
31
|
+
<td>Schaltet den Ausgang ein und startet die Zeitmessung für die hinterlegte, bzw. mitgesendete Zeit gestartet, sofern vorhanden.</td>
|
|
32
|
+
<td>Ja</td>
|
|
33
|
+
</tr>
|
|
34
|
+
<tr>
|
|
35
|
+
<td><code>off</code></td>
|
|
36
|
+
<td>Schaltet den Ausgang aus.</td>
|
|
37
|
+
<td>Ja</td>
|
|
38
|
+
</tr>
|
|
39
|
+
<tr>
|
|
40
|
+
<td><code>set</code></td>
|
|
41
|
+
<td>
|
|
42
|
+
Schaltet den Ausgang bei <code>msg.payload = true</code> ein und bei <code>msg.payload = false</code> aus.<br/>
|
|
43
|
+
Bei einem Wechsel von ausgeschaltet nach eingeschaltet wird die Zeitmessung für die hinterlegte, bzw. mitgesendete Zeit gestartet, sofern vorhanden.
|
|
44
|
+
</td>
|
|
45
|
+
<td>Nein</td>
|
|
46
|
+
</tr>
|
|
47
|
+
<tr>
|
|
48
|
+
<td><code>set_permanent</code></td>
|
|
49
|
+
<td>
|
|
50
|
+
Schaltet den Ausgang bei <code>msg.payload = true</code> dauerhaft ein und bei <code>msg.payload = false</code> aus.<br/>
|
|
51
|
+
Es wird dabei keine Zeitmessung gestartet.
|
|
52
|
+
</td>
|
|
53
|
+
<td>Nein</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr>
|
|
56
|
+
<td><code>motion</code></td>
|
|
57
|
+
<td>
|
|
58
|
+
Schaltet den Ausgang bei <code>msg.payload = true</code> ein ohne eine Zeitmessung.<br/>
|
|
59
|
+
Bei <code>msg.payload = false</code> wird die Zeitmessung für die hinterlegte, bzw. mitgesendete Zeit gestartet, sofern vorhanden.<br/>
|
|
60
|
+
Ist keine Zeit angegeben oder hinterlegt, schaltet sich der Ausgang sofort aus.
|
|
61
|
+
</td>
|
|
62
|
+
<td>Nein</td>
|
|
63
|
+
</tr>
|
|
64
|
+
<tr>
|
|
65
|
+
<td><code>alarm</code></td>
|
|
66
|
+
<td>
|
|
67
|
+
Setzt den aktuellen Alarmzustand auf den Wert von <code>msg.payload</code> und löst die entsprechende Aktion aus.<br/>
|
|
68
|
+
|
|
69
|
+
<table>
|
|
70
|
+
<thead>
|
|
71
|
+
<tr>
|
|
72
|
+
<th>Einstellung</th>
|
|
73
|
+
<th>Beschreibung</th>
|
|
74
|
+
</tr>
|
|
75
|
+
</thead>
|
|
76
|
+
<tbody>
|
|
77
|
+
<tr>
|
|
78
|
+
<td>Keine Aktion</td>
|
|
79
|
+
<td>Es passiert nichts</td>
|
|
80
|
+
</tr>
|
|
81
|
+
<tr>
|
|
82
|
+
<td>Einschalten</td>
|
|
83
|
+
<td>Der Ausgang wird eingeschalten.</td>
|
|
84
|
+
</tr>
|
|
85
|
+
<tr>
|
|
86
|
+
<td>Ausschalten</td>
|
|
87
|
+
<td>Der Ausgang wird ausgeschalten.</td>
|
|
88
|
+
</tr>
|
|
89
|
+
<tr>
|
|
90
|
+
<td>Letzen Zustand</td>
|
|
91
|
+
<td>Der Zustand bevor der Alarm gesetzt wurde wird wiederhergestellt.</td>
|
|
92
|
+
</tr>
|
|
93
|
+
<tr>
|
|
94
|
+
<td>Zuletzt gesendeten Zustand</td>
|
|
95
|
+
<td>Der Zustand der zuletzt empfangen wurde, auch während der Alarm aktiv war, wird wiederhergestellt.</td>
|
|
96
|
+
</tr>
|
|
97
|
+
</tbody>
|
|
98
|
+
</table>
|
|
99
|
+
</td>
|
|
100
|
+
<td>Nein</td>
|
|
101
|
+
</tr>
|
|
102
|
+
<tr>
|
|
103
|
+
<td><code>toggle</code> (default)</td>
|
|
104
|
+
<td>
|
|
105
|
+
Schaltet den Ausgang abwechselnd ein und aus.<br/>
|
|
106
|
+
Bei einem Wechsel von ausgeschaltet nach eingeschaltet wird die Zeitmessung für die hinterlegte, bzw. mitgesendete Zeit gestartet, sofern vorhanden.
|
|
107
|
+
</td>
|
|
108
|
+
<td>Ja</td>
|
|
109
|
+
</tr>
|
|
110
|
+
</tbody>
|
|
111
|
+
</table>
|
|
112
|
+
</p>
|
|
113
|
+
<p>
|
|
114
|
+
Diese Node hat eine einstellbare Maximallaufzeit, bevor der Ausgang automatisch wieder ausgeschalten wird.
|
|
115
|
+
Diese Zeitmessung wird wie in der Tabelle oben verwendet.
|
|
116
|
+
Die eingestellte Zeit kann gezielt überschrieben werden.
|
|
117
|
+
Beispiel: <code>msg = { "topic": "on", "time_on": 5000 }</code> oder <code>msg = { "topic": "on", "time_on": "5s" }</code><br/>
|
|
118
|
+
Diese Nachricht schaltet das Licht für 5000 Millisekunden / 5 Sekunden an und anschließend wieder aus.
|
|
119
|
+
Die nächste Nachricht ohne <code>time_on</code> Angabe verwendet wieder die voreingestellte Zeit.
|
|
120
|
+
Ist die Zeit auf 0 eingestellt, wird das Licht <b>nicht</b> automatisch ausgeschalten.<br/>
|
|
121
|
+
Als Einheit für die Zeit können folgende Werte verwendet werden:
|
|
122
|
+
<table>
|
|
123
|
+
<thead>
|
|
124
|
+
<tr>
|
|
125
|
+
<th>Einheit</th>
|
|
126
|
+
<th>Beschreibung</th>
|
|
127
|
+
</tr>
|
|
128
|
+
</thead>
|
|
129
|
+
<tbody>
|
|
130
|
+
<tr>
|
|
131
|
+
<td><code>ms</code> (default)</td>
|
|
132
|
+
<td>Millisekunden</td>
|
|
133
|
+
</tr>
|
|
134
|
+
<tr>
|
|
135
|
+
<td><code>s</code> oder <code>sec</code></td>
|
|
136
|
+
<td>Sekunden</td>
|
|
137
|
+
</tr>
|
|
138
|
+
<tr>
|
|
139
|
+
<td><code>m</code> oder <code>min</code></td>
|
|
140
|
+
<td>Mintun.</td>
|
|
141
|
+
</tr>
|
|
142
|
+
<tr>
|
|
143
|
+
<td><code>h</code></td>
|
|
144
|
+
<td>Stunden</td>
|
|
145
|
+
</tr>
|
|
146
|
+
</tbody>
|
|
147
|
+
</table>
|
|
148
|
+
</p>
|
|
149
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"light": {
|
|
3
|
+
"ui": {
|
|
4
|
+
"name": "Name",
|
|
5
|
+
"text": "Text",
|
|
6
|
+
"controlled_by_words": "Diese Node kann über die eingegebenen Wörter gesteuert werden. Mehrere Wörter werden durch ein Komma getrennt.",
|
|
7
|
+
"time_on": "Zeit Ein",
|
|
8
|
+
"alarm_on": "Alarm Ein",
|
|
9
|
+
"alarm_off": "Alarm Aus",
|
|
10
|
+
"controlled_by_central": "Dieser Baustein wird von folgenden Zentralbausteinen gesteuert:",
|
|
11
|
+
|
|
12
|
+
"milliseconds": "Millisekunden",
|
|
13
|
+
"seconds": "Sekunden",
|
|
14
|
+
"minutes": "Minuten",
|
|
15
|
+
"hours": "Stunden",
|
|
16
|
+
|
|
17
|
+
"no_action": "Keine Aktion",
|
|
18
|
+
"turn_on": "Einschalten",
|
|
19
|
+
"turn_off": "Ausschalten",
|
|
20
|
+
"last_state": "Letzen Zustand",
|
|
21
|
+
"last_sended_state": "Zuletzt gesendeten Zustand"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<script type="text/html" data-help-name="smart_light-control">
|
|
2
|
+
<p>
|
|
3
|
+
This node controls an output. This can be a light, a socket or something similar.
|
|
4
|
+
The output is always <code>msg.payload = true</code> or <code>msg.payload = false</code> to switch the output on or off.
|
|
5
|
+
</p>
|
|
6
|
+
<p>
|
|
7
|
+
<b>Note:</b> Smart nodes use topics in the format <code>name#number</code>, so different smart nodes can be controlled with the same topic.<br />
|
|
8
|
+
This node only uses the <code>name</code> part. <code>#</code> and <code>number</code> are optional.
|
|
9
|
+
</p>
|
|
10
|
+
<p>
|
|
11
|
+
The following topics are accepted:
|
|
12
|
+
<table>
|
|
13
|
+
<thead>
|
|
14
|
+
<tr>
|
|
15
|
+
<th>Topic</th>
|
|
16
|
+
<th>Description</th>
|
|
17
|
+
<th>msg.payload == false is ignored</th>
|
|
18
|
+
</tr>
|
|
19
|
+
</thead>
|
|
20
|
+
<tbody>
|
|
21
|
+
<tr>
|
|
22
|
+
<td><code>status</code></td>
|
|
23
|
+
<td>
|
|
24
|
+
Specifies the current status of the output via <code>msg.payload = true</code> or <code>msg.payload = false</code>.<br />
|
|
25
|
+
When changing from switched off to switched on, the time measurement is started for the stored or time, if available. </td>
|
|
26
|
+
<td>No</td>
|
|
27
|
+
</tr>
|
|
28
|
+
<tr>
|
|
29
|
+
<td><code>on</code></td>
|
|
30
|
+
<td>Switches the output on and starts the time measurement for the stored or sent time, if available.</td>
|
|
31
|
+
<td>Yes</td>
|
|
32
|
+
</tr>
|
|
33
|
+
<tr>
|
|
34
|
+
<td><code>off</code></td>
|
|
35
|
+
<td>Switches the output off.</td>
|
|
36
|
+
<td>Yes</td>
|
|
37
|
+
</tr>
|
|
38
|
+
<tr>
|
|
39
|
+
<td><code>set</code></td>
|
|
40
|
+
<td>
|
|
41
|
+
Switches the output on when <code>msg.payload = true</code> and off when <code>msg.payload = false</code>.<br />
|
|
42
|
+
When changing from switched off to switched on, the time measurement is started for the stored or sent time, if available.
|
|
43
|
+
</td>
|
|
44
|
+
<td>No</td>
|
|
45
|
+
</tr>
|
|
46
|
+
<tr>
|
|
47
|
+
<td><code>set_permanent</code></td>
|
|
48
|
+
<td>
|
|
49
|
+
Switches the output on permanently when <code>msg.payload = true</code> and off when <code>msg.payload = false</code>.<br />
|
|
50
|
+
No time measurement is started.
|
|
51
|
+
</td>
|
|
52
|
+
<td>No</td>
|
|
53
|
+
</tr>
|
|
54
|
+
<tr>
|
|
55
|
+
<td><code>motion</code></td>
|
|
56
|
+
<td>
|
|
57
|
+
Switches the output on when <code>msg.payload = true</code> without a time measurement.<br />
|
|
58
|
+
When <code>msg.payload = false</code> the time measurement is started for the stored or sent time, if available.<br />
|
|
59
|
+
If no time is specified or stored, the output switches off immediately.
|
|
60
|
+
</td>
|
|
61
|
+
<td>No</td>
|
|
62
|
+
</tr>
|
|
63
|
+
<tr>
|
|
64
|
+
<td><code>alarm</code></td>
|
|
65
|
+
<td>
|
|
66
|
+
Sets the current alarm state to the value of <code>msg.payload</code> and triggers the corresponding action.<br />
|
|
67
|
+
|
|
68
|
+
<table>
|
|
69
|
+
<thead>
|
|
70
|
+
<tr>
|
|
71
|
+
<th>Setting</th>
|
|
72
|
+
<th>Description</th>
|
|
73
|
+
</tr>
|
|
74
|
+
</thead>
|
|
75
|
+
<tbody>
|
|
76
|
+
<tr>
|
|
77
|
+
<td>No action</td>
|
|
78
|
+
<td>Nothing happens</td>
|
|
79
|
+
</tr>
|
|
80
|
+
<tr>
|
|
81
|
+
<td>Switch on</td>
|
|
82
|
+
<td>The output is switched on.</td>
|
|
83
|
+
</tr>
|
|
84
|
+
<tr>
|
|
85
|
+
<td>Switch off</td>
|
|
86
|
+
<td>The output is switched off.</td>
|
|
87
|
+
</tr>
|
|
88
|
+
<tr>
|
|
89
|
+
<td>Last state</td>
|
|
90
|
+
<td>The state before the alarm was set is restored.</td>
|
|
91
|
+
</tr>
|
|
92
|
+
<tr>
|
|
93
|
+
<td>Last sent state</td>
|
|
94
|
+
<td>The state that was last received, even while the alarm was active, is restored.</td>
|
|
95
|
+
</tr>
|
|
96
|
+
</tbody>
|
|
97
|
+
</table>
|
|
98
|
+
</td>
|
|
99
|
+
<td>No</td>
|
|
100
|
+
</tr>
|
|
101
|
+
<tr>
|
|
102
|
+
<td><code>toggle</code> (default)</td>
|
|
103
|
+
<td>
|
|
104
|
+
Switches the output on and off alternately.<br />
|
|
105
|
+
When switching from off to on, the time measurement is started for the stored or sent time, if available.
|
|
106
|
+
</td>
|
|
107
|
+
<td>Yes</td>
|
|
108
|
+
</tr>
|
|
109
|
+
</tbody>
|
|
110
|
+
</table>
|
|
111
|
+
</p>
|
|
112
|
+
<p>
|
|
113
|
+
This node has an adjustable maximum runtime before the output is automatically switched off again.
|
|
114
|
+
This time measurement is used as in the table above.
|
|
115
|
+
The set time can be overwritten specifically.
|
|
116
|
+
Example: <code>msg = { "topic": "on", "time_on": 5000 }</code> or <code>msg = { "topic": "on", "time_on": "5s" }</code><br />
|
|
117
|
+
This message switches the light on for 5000 milliseconds / 5 seconds and then off again.
|
|
118
|
+
The next message without <code>time_on</code> specification uses the preset time again.
|
|
119
|
+
If the time is set to 0, the light will <b>not</b> be switched off automatically.<br />
|
|
120
|
+
The following values can be used as the unit for the time:
|
|
121
|
+
<table>
|
|
122
|
+
<thead>
|
|
123
|
+
<tr>
|
|
124
|
+
<th>Unit</th>
|
|
125
|
+
<th>Description</th>
|
|
126
|
+
</tr>
|
|
127
|
+
</thead>
|
|
128
|
+
<tbody>
|
|
129
|
+
<tr>
|
|
130
|
+
<td><code>ms</code> (default)</td>
|
|
131
|
+
<td>Milliseconds</td>
|
|
132
|
+
</tr>
|
|
133
|
+
<tr>
|
|
134
|
+
<td><code>s</code> or <code>sec</code></td>
|
|
135
|
+
<td>Seconds</td>
|
|
136
|
+
</tr>
|
|
137
|
+
<tr>
|
|
138
|
+
<td><code>m</code> or <code>min</code></td>
|
|
139
|
+
<td>Mintun.</td>
|
|
140
|
+
</tr>
|
|
141
|
+
<tr>
|
|
142
|
+
<td><code>h</code></td>
|
|
143
|
+
<td>Hours</td>
|
|
144
|
+
</tr>
|
|
145
|
+
</tbody>
|
|
146
|
+
</table>
|
|
147
|
+
</p>
|
|
148
|
+
</script>
|