node-red-contrib-knx-ultimate 2.3.4 → 2.4.1
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/.github/ISSUE_TEMPLATE/bug_report.md +7 -7
- package/CHANGELOG.md +29 -0
- package/KNXEngine/CHANGELOG.md +5 -1
- package/KNXEngine/package.json +1 -1
- package/KNXEngine/src/dptlib/dpt275.js +60 -0
- package/KNXEngine/src/dptlib/index.js +79 -65
- package/nodes/commonFunctions.js +419 -0
- package/nodes/hue-config.html +56 -40
- package/nodes/hue-config.js +0 -108
- package/nodes/knxUltimate-config.html +1 -1
- package/nodes/knxUltimate-config.js +13 -232
- package/nodes/knxUltimate.html +2 -2
- package/nodes/knxUltimateHueBattery.html +2 -2
- package/nodes/knxUltimateHueButton.html +4 -4
- package/nodes/knxUltimateHueLight.html +989 -947
- package/nodes/knxUltimateHueLight.js +50 -26
- package/nodes/knxUltimateHueLightSensor.html +2 -2
- package/nodes/knxUltimateHueMotion.html +2 -2
- package/nodes/knxUltimateHueScene.html +4 -4
- package/nodes/knxUltimateHueTapDial.html +2 -2
- package/nodes/knxUltimateHueTemperatureSensor.html +2 -2
- package/nodes/knxUltimateLoadControl.html +1 -1
- package/nodes/knxUltimateSceneController.html +6 -6
- package/nodes/knxUltimateSceneController.js +1 -9
- package/package.json +2 -2
- package/nodes/utils/commonFunctions.js +0 -21
|
@@ -13,6 +13,22 @@ module.exports = function (RED) {
|
|
|
13
13
|
const node = this;
|
|
14
14
|
node.server = RED.nodes.getNode(config.server);
|
|
15
15
|
node.serverHue = RED.nodes.getNode(config.serverHue);
|
|
16
|
+
|
|
17
|
+
// Convert for backward compatibility
|
|
18
|
+
if (config.nameLightKelvinDIM === undefined) {
|
|
19
|
+
config.nameLightKelvinDIM = config.nameLightHSV;
|
|
20
|
+
config.GALightKelvinDIM = config.GALightHSV;
|
|
21
|
+
config.dptLightKelvinDIM = config.dptLightHSV;
|
|
22
|
+
|
|
23
|
+
config.nameLightKelvinPercentage = config.nameLightHSVPercentage;
|
|
24
|
+
config.GALightKelvinPercentage = config.GALightHSVPercentage;
|
|
25
|
+
config.dptLightKelvinPercentage = config.dptLightHSVPercentage;
|
|
26
|
+
|
|
27
|
+
config.nameLightKelvinPercentageState = config.nameLightHSVState;
|
|
28
|
+
config.GALightKelvinPercentageState = config.GALightHSVState;
|
|
29
|
+
config.dptLightKelvinPercentageState = config.dptLightHSVState;
|
|
30
|
+
}
|
|
31
|
+
|
|
16
32
|
node.topic = node.name;
|
|
17
33
|
node.name = config.name === undefined ? "Hue" : config.name;
|
|
18
34
|
node.outputtopic = node.name;
|
|
@@ -209,6 +225,10 @@ module.exports = function (RED) {
|
|
|
209
225
|
}
|
|
210
226
|
}
|
|
211
227
|
} else {
|
|
228
|
+
// Stop color cycle
|
|
229
|
+
if (node.timerColorCycle !== undefined) clearInterval(node.timerColorCycle);
|
|
230
|
+
// Stop Blinking
|
|
231
|
+
if (node.timerBlink !== undefined) clearInterval(node.timerBlink);
|
|
212
232
|
state = { on: { on: false } };
|
|
213
233
|
}
|
|
214
234
|
|
|
@@ -234,11 +254,9 @@ module.exports = function (RED) {
|
|
|
234
254
|
let kelvinValue = 0;
|
|
235
255
|
msg.payload = dptlib.fromBuffer(msg.knx.rawValue, dptlib.resolve(config.dptLightKelvin));
|
|
236
256
|
if (config.dptLightKelvin === "7.600") {
|
|
237
|
-
if (msg.payload >
|
|
238
|
-
if (msg.payload <
|
|
239
|
-
|
|
240
|
-
// knxMsgPayload.payload = hueColorConverter.ColorConverter.scale(kelvinValue, [2000, 6535], [0, 65535]);
|
|
241
|
-
kelvinValue = hueColorConverter.ColorConverter.scale(msg.payload, [0, 65535], [2000, 6535]);
|
|
257
|
+
if (msg.payload > 6535) msg.payload = 6535;
|
|
258
|
+
if (msg.payload < 2000) msg.payload = 2000;
|
|
259
|
+
kelvinValue = msg.payload;//hueColorConverter.ColorConverter.scale(msg.payload, [0, 65535], [2000, 6535]);
|
|
242
260
|
retMirek = hueColorConverter.ColorConverter.kelvinToMirek(kelvinValue);
|
|
243
261
|
} else if (config.dptLightKelvin === "9.002") {
|
|
244
262
|
// Relative temperature in Kelvin. Use HUE scale.
|
|
@@ -283,22 +301,22 @@ module.exports = function (RED) {
|
|
|
283
301
|
});
|
|
284
302
|
|
|
285
303
|
break;
|
|
286
|
-
case config.
|
|
287
|
-
if (config.
|
|
304
|
+
case config.GALightKelvinDIM:
|
|
305
|
+
if (config.dptLightKelvinDIM === "3.007") {
|
|
288
306
|
// MDT smartbutton will dim the color temperature
|
|
289
307
|
// { decr_incr: 1, data: 1 } : Start increasing until { decr_incr: 0, data: 0 } is received.
|
|
290
308
|
// { decr_incr: 0, data: 1 } : Start decreasing until { decr_incr: 0, data: 0 } is received.
|
|
291
|
-
msg.payload = dptlib.fromBuffer(msg.knx.rawValue, dptlib.resolve(config.
|
|
309
|
+
msg.payload = dptlib.fromBuffer(msg.knx.rawValue, dptlib.resolve(config.dptLightKelvinDIM));
|
|
292
310
|
node.hueDimmingTunableWhite(msg.payload.decr_incr, msg.payload.data, 5000);
|
|
293
311
|
node.setNodeStatusHue({
|
|
294
312
|
fill: "green", shape: "dot", text: "KNX->HUE", payload: JSON.stringify(msg.payload),
|
|
295
313
|
});
|
|
296
314
|
}
|
|
297
315
|
break;
|
|
298
|
-
case config.
|
|
299
|
-
if (config.
|
|
316
|
+
case config.GALightKelvinPercentage:
|
|
317
|
+
if (config.dptLightKelvinPercentage === "5.001") {
|
|
300
318
|
// 0-100% tunable white
|
|
301
|
-
msg.payload = 100 - dptlib.fromBuffer(msg.knx.rawValue, dptlib.resolve(config.
|
|
319
|
+
msg.payload = 100 - dptlib.fromBuffer(msg.knx.rawValue, dptlib.resolve(config.dptLightKelvinPercentage));
|
|
302
320
|
// msg.payload = msg.payload <= 0 ? 1 : msg.payload
|
|
303
321
|
const retMirek = hueColorConverter.ColorConverter.scale(msg.payload, [0, 100], [153, 500]);
|
|
304
322
|
msg.payload = retMirek;
|
|
@@ -373,7 +391,7 @@ module.exports = function (RED) {
|
|
|
373
391
|
? { on: { on: true }, dimming: { brightness: 100 }, dynamics: { duration: 0 } }
|
|
374
392
|
: { on: { on: false }, dimming: { brightness: 0 }, dynamics: { duration: 0 } };
|
|
375
393
|
node.serverHue.hueManager.writeHueQueueAdd(node.hueDevice, state, node.isGrouped_light === false ? "setLight" : "setGroupedLight");
|
|
376
|
-
},
|
|
394
|
+
}, 1500);
|
|
377
395
|
} else {
|
|
378
396
|
if (node.timerBlink !== undefined) clearInterval(node.timerBlink);
|
|
379
397
|
node.serverHue.hueManager.writeHueQueueAdd(
|
|
@@ -456,9 +474,9 @@ module.exports = function (RED) {
|
|
|
456
474
|
ret = node.currentHUEDevice.color.xy;
|
|
457
475
|
if (ret !== undefined) node.updateKNXLightColorState(node.currentHUEDevice.color, "response");
|
|
458
476
|
break;
|
|
459
|
-
case config.
|
|
477
|
+
case config.GALightKelvinPercentageState:
|
|
460
478
|
ret = node.currentHUEDevice.color_temperature.mirek;
|
|
461
|
-
if (ret !== undefined) node.
|
|
479
|
+
if (ret !== undefined) node.updateKNXLightKelvinPercentageState(ret, "response");
|
|
462
480
|
break;
|
|
463
481
|
case config.GALightBrightnessState:
|
|
464
482
|
ret = node.currentHUEDevice.dimming.brightness;
|
|
@@ -498,8 +516,14 @@ module.exports = function (RED) {
|
|
|
498
516
|
return;
|
|
499
517
|
}
|
|
500
518
|
|
|
519
|
+
// If i'm dimming up while the light is off, start the dim with the initial brightness set to zero
|
|
520
|
+
if (_KNXbrightness_Direction > 0 && _KNXaction === 1 && node.currentHUEDevice.on !== undefined && node.currentHUEDevice.on.on === false) {
|
|
521
|
+
node.brightnessStep = null;
|
|
522
|
+
node.currentHUEDevice.dimming.brightness = 0;
|
|
523
|
+
}
|
|
524
|
+
|
|
501
525
|
// Set the actual brightness to start with
|
|
502
|
-
if (node.brightnessStep === null || node.brightnessStep === undefined) node.brightnessStep = node.currentHUEDevice.dimming.brightness
|
|
526
|
+
if (node.brightnessStep === null || node.brightnessStep === undefined) node.brightnessStep = node.currentHUEDevice.dimming.brightness !== undefined ? node.currentHUEDevice.dimming.brightness : 50;
|
|
503
527
|
node.brightnessStep = Math.ceil(Number(node.brightnessStep));
|
|
504
528
|
|
|
505
529
|
// We have also minDimLevelLight and maxDimLevelLight to take care of.
|
|
@@ -524,7 +548,7 @@ module.exports = function (RED) {
|
|
|
524
548
|
node.updateKNXBrightnessState(node.brightnessStep); // Unnecessary, but necessary to set the KNX Status in real time.
|
|
525
549
|
node.brightnessStep += numStep;
|
|
526
550
|
if (node.brightnessStep > maxDimLevelLight) node.brightnessStep = maxDimLevelLight;
|
|
527
|
-
hueTelegram = { dimming: { brightness: node.brightnessStep }, dynamics: { duration: _dimSpeedInMillisecs +
|
|
551
|
+
hueTelegram = { dimming: { brightness: node.brightnessStep }, dynamics: { duration: _dimSpeedInMillisecs + 300 } }; // + 100 is to avoid ladder effect
|
|
528
552
|
// Switch on the light if off
|
|
529
553
|
if (node.currentHUEDevice.on !== undefined && node.currentHUEDevice.on.on === false) {
|
|
530
554
|
hueTelegram.on = { on: true };
|
|
@@ -541,7 +565,7 @@ module.exports = function (RED) {
|
|
|
541
565
|
node.updateKNXBrightnessState(node.brightnessStep); // Unnecessary, but necessary to set the KNX Status in real time.
|
|
542
566
|
node.brightnessStep -= numStep;
|
|
543
567
|
if (node.brightnessStep < minDimLevelLight) node.brightnessStep = minDimLevelLight;
|
|
544
|
-
hueTelegram = { dimming: { brightness: node.brightnessStep }, dynamics: { duration: _dimSpeedInMillisecs +
|
|
568
|
+
hueTelegram = { dimming: { brightness: node.brightnessStep }, dynamics: { duration: _dimSpeedInMillisecs + 300 } };// + 100 is to avoid ladder effect
|
|
545
569
|
// Switch off the light if on
|
|
546
570
|
if (node.currentHUEDevice.on !== undefined && node.currentHUEDevice.on.on === true && node.brightnessStep === 0) {
|
|
547
571
|
hueTelegram.on = { on: false };
|
|
@@ -591,7 +615,7 @@ module.exports = function (RED) {
|
|
|
591
615
|
// DIM UP
|
|
592
616
|
if (node.timerStepDimTunableWhite !== undefined) clearInterval(node.timerStepDimTunableWhite);
|
|
593
617
|
node.timerStepDimTunableWhite = setInterval(() => {
|
|
594
|
-
node.
|
|
618
|
+
node.updateKNXLightKelvinPercentageState(node.brightnessStepTunableWhite); // Unnecessary, but necessary to set the KNX Status in real time.
|
|
595
619
|
node.brightnessStepTunableWhite += numStepTunableWhite; // *2 to speed up the things
|
|
596
620
|
if (node.brightnessStepTunableWhite > maxDimLevelLightTunableWhite) node.brightnessStepTunableWhite = maxDimLevelLightTunableWhite;
|
|
597
621
|
const hueTelegram = { color_temperature: { mirek: node.brightnessStepTunableWhite }, dynamics: { duration: _dimSpeedInMillisecsTunableWhite } };
|
|
@@ -608,7 +632,7 @@ module.exports = function (RED) {
|
|
|
608
632
|
// DIM DOWN
|
|
609
633
|
if (node.timerStepDimTunableWhite !== undefined) clearInterval(node.timerStepDimTunableWhite);
|
|
610
634
|
node.timerStepDimTunableWhite = setInterval(() => {
|
|
611
|
-
node.
|
|
635
|
+
node.updateKNXLightKelvinPercentageState(node.brightnessStepTunableWhite); // Unnecessary, but necessary to set the KNX Status in real time.
|
|
612
636
|
node.brightnessStepTunableWhite -= numStepTunableWhite; // *2 to speed up the things
|
|
613
637
|
if (node.brightnessStepTunableWhite < minDimLevelLightTunableWhite) node.brightnessStepTunableWhite = minDimLevelLightTunableWhite;
|
|
614
638
|
const hueTelegram = { color_temperature: { mirek: node.brightnessStepTunableWhite }, dynamics: { duration: _dimSpeedInMillisecsTunableWhite } };
|
|
@@ -705,7 +729,7 @@ module.exports = function (RED) {
|
|
|
705
729
|
}
|
|
706
730
|
}
|
|
707
731
|
if (deviceByRef.color_temperature !== undefined && deviceByRef.color_temperature.mirek !== undefined) {
|
|
708
|
-
node.
|
|
732
|
+
node.updateKNXLightKelvinPercentageState(deviceByRef.color_temperature.mirek);
|
|
709
733
|
node.updateKNXLightKelvinState(deviceByRef.color_temperature.mirek);
|
|
710
734
|
node.currentHUEDevice.color_temperature.mirek = deviceByRef.color_temperature.mirek;
|
|
711
735
|
}
|
|
@@ -781,12 +805,12 @@ module.exports = function (RED) {
|
|
|
781
805
|
}
|
|
782
806
|
};
|
|
783
807
|
|
|
784
|
-
node.
|
|
785
|
-
if (config.
|
|
808
|
+
node.updateKNXLightKelvinPercentageState = function updateKNXLightKelvinPercentageState(_value, _outputtype = "write") {
|
|
809
|
+
if (config.GALightKelvinPercentageState !== undefined && config.GALightKelvinPercentageState !== "") {
|
|
786
810
|
const knxMsgPayload = {};
|
|
787
|
-
knxMsgPayload.topic = config.
|
|
788
|
-
knxMsgPayload.dpt = config.
|
|
789
|
-
if (config.
|
|
811
|
+
knxMsgPayload.topic = config.GALightKelvinPercentageState;
|
|
812
|
+
knxMsgPayload.dpt = config.dptLightKelvinPercentageState;
|
|
813
|
+
if (config.dptLightKelvinPercentageState === "5.001") {
|
|
790
814
|
const retPercent = hueColorConverter.ColorConverter.scale(_value, [153, 500], [0, 100]);
|
|
791
815
|
knxMsgPayload.payload = 100 - retPercent;
|
|
792
816
|
}
|
|
@@ -805,7 +829,7 @@ module.exports = function (RED) {
|
|
|
805
829
|
node.setNodeStatusHue({
|
|
806
830
|
fill: "blue",
|
|
807
831
|
shape: "ring",
|
|
808
|
-
text: "HUE->KNX
|
|
832
|
+
text: "HUE->KNX Tunable White",
|
|
809
833
|
payload: knxMsgPayload.payload,
|
|
810
834
|
});
|
|
811
835
|
}
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
|
|
70
70
|
// DPT
|
|
71
71
|
// ########################
|
|
72
|
-
$.getJSON('knxUltimateDpts', (data) => {
|
|
72
|
+
$.getJSON('knxUltimateDpts?serverId=' + $("#node-input-server").val(), (data) => {
|
|
73
73
|
data.forEach(dpt => {
|
|
74
74
|
if (dpt.value.startsWith("9.004")) {
|
|
75
75
|
$("#node-input-dptlightsensor").append($("<option></option>")
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
$("#node-input-name").autocomplete({
|
|
121
121
|
minLength: 1,
|
|
122
122
|
source: function (request, response) {
|
|
123
|
-
$.getJSON("KNXUltimateGetResourcesHUE?rtype=light_level&
|
|
123
|
+
$.getJSON("KNXUltimateGetResourcesHUE?rtype=light_level&serverId=" + oNodeServerHue.id, (data) => {
|
|
124
124
|
response($.map(data.devices, function (value, key) {
|
|
125
125
|
//alert(JSON.stringify(value) + " "+ key)
|
|
126
126
|
var sSearch = (value.name);
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
|
|
69
69
|
// DPT
|
|
70
70
|
// ########################
|
|
71
|
-
$.getJSON('knxUltimateDpts', (data) => {
|
|
71
|
+
$.getJSON('knxUltimateDpts?serverId=' + $("#node-input-server").val(), (data) => {
|
|
72
72
|
data.forEach(dpt => {
|
|
73
73
|
if (dpt.value.startsWith("1.")) {
|
|
74
74
|
$("#node-input-dptmotion").append($("<option></option>")
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
$("#node-input-name").autocomplete({
|
|
120
120
|
minLength: 1,
|
|
121
121
|
source: function (request, response) {
|
|
122
|
-
$.getJSON("KNXUltimateGetResourcesHUE?rtype=motion&
|
|
122
|
+
$.getJSON("KNXUltimateGetResourcesHUE?rtype=motion&serverId=" + oNodeServerHue.id, (data) => {
|
|
123
123
|
response($.map(data.devices, function (value, key) {
|
|
124
124
|
//alert(JSON.stringify(value) + " "+ key)
|
|
125
125
|
var sSearch = (value.name);
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
|
|
97
97
|
// DPT
|
|
98
98
|
// ########################
|
|
99
|
-
$.getJSON('knxUltimateDpts', (data) => {
|
|
99
|
+
$.getJSON('knxUltimateDpts?serverId=' + $("#node-input-server").val(), (data) => {
|
|
100
100
|
data.forEach(dpt => {
|
|
101
101
|
if (dpt.value.startsWith("1.") || dpt.value.startsWith("18.")) {
|
|
102
102
|
$("#node-input-dptscene").append($("<option></option>")
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
$("#node-input-name").autocomplete({
|
|
245
245
|
minLength: 1,
|
|
246
246
|
source: function (request, response) {
|
|
247
|
-
$.getJSON("KNXUltimateGetResourcesHUE?rtype=scene&
|
|
247
|
+
$.getJSON("KNXUltimateGetResourcesHUE?rtype=scene&serverId=" + oNodeServerHue.id, (data) => {
|
|
248
248
|
response($.map(data.devices, function (value, key) {
|
|
249
249
|
//alert(JSON.stringify(value) + " "+ key)
|
|
250
250
|
var sSearch = (value.name);
|
|
@@ -340,7 +340,7 @@
|
|
|
340
340
|
rowRuleHUESceneName.autocomplete({
|
|
341
341
|
minLength: 1,
|
|
342
342
|
source: function (request, response) {
|
|
343
|
-
$.getJSON("KNXUltimateGetResourcesHUE?rtype=scene&
|
|
343
|
+
$.getJSON("KNXUltimateGetResourcesHUE?rtype=scene&serverId=" + oNodeServerHue.id, (data) => {
|
|
344
344
|
response($.map(data.devices, function (value, key) {
|
|
345
345
|
//alert(JSON.stringify(value) + " "+ key)
|
|
346
346
|
var sSearch = (value.name);
|
|
@@ -508,7 +508,7 @@
|
|
|
508
508
|
<select id="node-input-valscene" style="width:180px;margin-left: 5px; text-align: left;"></select>
|
|
509
509
|
</div>
|
|
510
510
|
<div class="form-row">
|
|
511
|
-
<label for="node-input-namesceneStatus" style="width:100px;"><i class="fa fa-
|
|
511
|
+
<label for="node-input-namesceneStatus" style="width:100px;"><i class="fa fa-question-circle"></i> Status</label>
|
|
512
512
|
|
|
513
513
|
<label for="node-input-GAsceneStatus" style="width:20px;">GA</label>
|
|
514
514
|
<input type="text" id="node-input-GAsceneStatus" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
|
|
70
70
|
// DPT repeat
|
|
71
71
|
// ########################
|
|
72
|
-
$.getJSON('knxUltimateDpts', (data) => {
|
|
72
|
+
$.getJSON('knxUltimateDpts?serverId=' + $("#node-input-server").val(), (data) => {
|
|
73
73
|
data.forEach(dpt => {
|
|
74
74
|
if (dpt.value.startsWith("3.007") || dpt.value.startsWith("5.001") || dpt.value.startsWith("232.600")) {
|
|
75
75
|
$("#node-input-dptrepeat").append($("<option></option>")
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
$("#node-input-name").autocomplete({
|
|
122
122
|
minLength: 1,
|
|
123
123
|
source: function (request, response) {
|
|
124
|
-
$.getJSON("KNXUltimateGetResourcesHUE?rtype=relative_rotary&
|
|
124
|
+
$.getJSON("KNXUltimateGetResourcesHUE?rtype=relative_rotary&serverId=" + oNodeServerHue.id, (data) => {
|
|
125
125
|
response($.map(data.devices, function (value, key) {
|
|
126
126
|
//alert(JSON.stringify(value) + " "+ key)
|
|
127
127
|
var sSearch = (value.name);
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
|
|
70
70
|
// DPT
|
|
71
71
|
// ########################
|
|
72
|
-
$.getJSON('knxUltimateDpts', (data) => {
|
|
72
|
+
$.getJSON('knxUltimateDpts?serverId=' + $("#node-input-server").val(), (data) => {
|
|
73
73
|
data.forEach(dpt => {
|
|
74
74
|
if (dpt.value.startsWith("9.001")) {
|
|
75
75
|
$("#node-input-dpttemperaturesensor").append($("<option></option>")
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
$("#node-input-name").autocomplete({
|
|
121
121
|
minLength: 1,
|
|
122
122
|
source: function (request, response) {
|
|
123
|
-
$.getJSON("KNXUltimateGetResourcesHUE?rtype=temperature&
|
|
123
|
+
$.getJSON("KNXUltimateGetResourcesHUE?rtype=temperature&serverId=" + oNodeServerHue.id, (data) => {
|
|
124
124
|
response($.map(data.devices, function (value, key) {
|
|
125
125
|
//alert(JSON.stringify(value) + " "+ key)
|
|
126
126
|
var sSearch = (value.name);
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
return i == aSearchWords.length;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
$.getJSON("knxUltimateDpts", (data) => {
|
|
93
|
+
$.getJSON("knxUltimateDpts?serverId=" + $("#node-input-server").val(), (data) => {
|
|
94
94
|
data.forEach(dpt => {
|
|
95
95
|
$("#node-input-dpt").append($("<option></option>").attr("value", dpt.value).text(dpt.text));
|
|
96
96
|
for (let index = 1; index < 6; index++) {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
|
|
64
64
|
// DPT of Scene Recall
|
|
65
65
|
// ########################
|
|
66
|
-
$.getJSON('knxUltimateDpts', (data) => {
|
|
66
|
+
$.getJSON('knxUltimateDpts?serverId=' + $("#node-input-server").val(), (data) => {
|
|
67
67
|
data.forEach(dpt => {
|
|
68
68
|
$("#node-input-dpt").append($("<option></option>")
|
|
69
69
|
.attr("value", dpt.value)
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
|
|
186
186
|
// DPT of Scene Save
|
|
187
187
|
// ########################
|
|
188
|
-
$.getJSON('knxUltimateDpts', (data) => {
|
|
188
|
+
$.getJSON('knxUltimateDpts?serverId=' + $("#node-input-server").val(), (data) => {
|
|
189
189
|
data.forEach(dpt => {
|
|
190
190
|
$("#node-input-dptSave").append($("<option></option>")
|
|
191
191
|
.attr("value", dpt.value)
|
|
@@ -297,7 +297,7 @@
|
|
|
297
297
|
opt.r = {};
|
|
298
298
|
// Delete saved scene
|
|
299
299
|
// ##########################################################
|
|
300
|
-
$.getJSON("knxultimatescenecontrollerdelete?FileName=" + node.id, new Date().getTime(), (data) => { });
|
|
300
|
+
$.getJSON("knxultimatescenecontrollerdelete?FileName=" + node.id + "&serverId=" + $("node-input-server").val(), new Date().getTime(), (data) => { });
|
|
301
301
|
// ##########################################################
|
|
302
302
|
}
|
|
303
303
|
var rule = opt.r;
|
|
@@ -324,7 +324,7 @@
|
|
|
324
324
|
resizeRule(container);
|
|
325
325
|
});
|
|
326
326
|
|
|
327
|
-
$.getJSON('knxUltimateDpts', (data) => {
|
|
327
|
+
$.getJSON('knxUltimateDpts?serverId=' + $("#node-input-server").val(), (data) => {
|
|
328
328
|
data.forEach(dpt => {
|
|
329
329
|
oDPTField.append($("<option></option>")
|
|
330
330
|
.attr("value", dpt.value)
|
|
@@ -381,8 +381,8 @@
|
|
|
381
381
|
removable: true
|
|
382
382
|
});
|
|
383
383
|
|
|
384
|
-
|
|
385
|
-
|
|
384
|
+
// Put some spaces after the container
|
|
385
|
+
$('<br/><br/><br/>').insertAfter($("#node-input-rule-container"));
|
|
386
386
|
|
|
387
387
|
// 10/03/2020 For each rule, create a row
|
|
388
388
|
for (var i = 0; i < this.rules.length; i++) {
|
|
@@ -31,15 +31,7 @@ module.exports = function (RED) {
|
|
|
31
31
|
node.icountMessageInWindow = 0
|
|
32
32
|
node.disabled = false // 21/09/2020 you can now disable the scene controller
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
RED.httpAdmin.get('/knxultimatescenecontrollerdelete', RED.auth.needsPermission('knxUltimateSceneController.read'), function (req, res) {
|
|
36
|
-
// Delete the file
|
|
37
|
-
try {
|
|
38
|
-
const newPath = node.userDir + '/scenecontroller/SceneController_' + req.query.FileName
|
|
39
|
-
fs.unlinkSync(newPath)
|
|
40
|
-
} catch (error) { if (node.sysLogger !== undefined && node.sysLogger !== null) node.sysLogger.warn('e ' + error) }
|
|
41
|
-
res.json({ status: 220 })
|
|
42
|
-
})
|
|
34
|
+
|
|
43
35
|
|
|
44
36
|
// 03/09/2021
|
|
45
37
|
async function delay(ms) {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"engines": {
|
|
4
4
|
"node": ">=16.0.0"
|
|
5
5
|
},
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.4.1",
|
|
7
7
|
"description": "Control your KNX intallation via Node-Red! A bunch of KNX nodes, with integrated Philips HUE control and ETS group address importer. Easy to use and highly configurable.",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"binary-parser": "2.2.1",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"node-red": {
|
|
24
24
|
"version": ">=2.0.0",
|
|
25
25
|
"nodes": {
|
|
26
|
-
"commonFunctions": "/nodes/
|
|
26
|
+
"commonFunctions": "/nodes/commonFunctions.js",
|
|
27
27
|
"knxUltimate": "/nodes/knxUltimate.js",
|
|
28
28
|
"knxUltimateSceneController": "/nodes/knxUltimateSceneController.js",
|
|
29
29
|
"knxUltimateWatchDog": "/nodes/knxUltimateWatchDog.js",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Utility function
|
|
2
|
-
// until node-red 3.1.0, there is a bug creating a plugin, so for backward compatibility, i must use a JS as a node.
|
|
3
|
-
const yaml = require('js-yaml');
|
|
4
|
-
module.exports = function (RED) {
|
|
5
|
-
|
|
6
|
-
//RED.log.error("###############################################################")
|
|
7
|
-
RED.httpAdmin.post("/banana", RED.auth.needsPermission("write"), (req, res) => {
|
|
8
|
-
var node = RED.nodes.getNode(req.params.id);
|
|
9
|
-
if (node != null) {
|
|
10
|
-
try {
|
|
11
|
-
if (req.body) {
|
|
12
|
-
console.log(body);
|
|
13
|
-
}
|
|
14
|
-
} catch (err) { }
|
|
15
|
-
}
|
|
16
|
-
res.json(req.body)
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|