node-red-contrib-knx-ultimate 2.2.19 → 2.2.21

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.
@@ -1,5 +1,6 @@
1
- <script src="resources/node-red-contrib-knx-ultimate/11f26b4500.js"></script>
2
- <script src="resources/node-red-contrib-knx-ultimate/iro@5"></script>
1
+ <!-- <script type="application/javascript;charset=utf-8" src="https://kit.fontawesome.com/11f26b4500.js" crossorigin="anonymous"></script>
2
+ <script type="application/javascript;charset=utf-8" src="https://cdn.jsdelivr.net/npm/@jaames/iro@5"></script> -->
3
+ <script type="text/javascript" src="resources/node-red-contrib-knx-ultimate/11f26b4500.js"></script>
3
4
 
4
5
  <script type="text/javascript">
5
6
 
@@ -60,11 +61,6 @@
60
61
  GALightColorCycle: { value: "" },
61
62
  dptLightColorCycle: { value: "" },
62
63
 
63
- enableDayNightLighting: { value: "no" },
64
- colorAtSwitchOnDayTime: { value: '{"red":255, "green":255, "blue":255}' },
65
- colorAtSwitchOnNightTime: { value: '{"red":23, "green":4, "blue":0}' },
66
- invertDayNight: { value: false },
67
-
68
64
  nameDaylightSensor: { value: "" },
69
65
  GADaylightSensor: { value: "" },
70
66
  dptDaylightSensor: { value: "" },
@@ -78,6 +74,13 @@
78
74
  dptLightKelvinState: { value: "" },
79
75
 
80
76
  specifySwitchOnBrightness: { value: "yes" },
77
+ colorAtSwitchOnDayTime: { value: '{"red":255, "green":255, "blue":255}' },
78
+
79
+ enableDayNightLighting: { value: "no" },
80
+ colorAtSwitchOnNightTime: { value: '{"red":23, "green":4, "blue":0}' },
81
+
82
+ invertDayNight: { value: false },
83
+
81
84
  updateKNXBrightnessStatusOnHUEOnOff: { value: "no" },
82
85
  dimSpeed: { value: 5000, required: false },
83
86
  minDimLevelLight: { value: 10, required: false },
@@ -102,170 +105,6 @@
102
105
  var oNodeServer = RED.nodes.node($("#node-input-server").val()); // Store the config-node
103
106
  var oNodeServerHue = RED.nodes.node($("#node-input-serverHue").val()); // Store the config-node
104
107
 
105
- // Create the TAB in Node-Red
106
- // ####################################
107
- const content = `<html>
108
-
109
- <head>
110
- <div class="red-ui-sidebar-header">Color Selector</div>
111
- </head>
112
- <div style='position:relative;height:100%;margin:10px'>
113
- <p>Choose the desired color/temperature, then click <b>Apply</b></p>
114
- <div>
115
- <h3>Color RGB</h3>
116
- <div id="colorPicker"></div>
117
- </div>
118
- </br>
119
- <div>
120
- <input style="width:100%" type="text" id="resultRGB">
121
- <input type="hidden" id="tabNRColor_destinationTextbox">
122
- </div>
123
- </br>
124
- <div>
125
- <h3>Temperature Kelvin</h3>
126
- <div id="kelvinPicker"></div>
127
- </div>
128
- </br>
129
- <div>
130
- <input style="width:100%" type="text" id="resultKelvin">
131
- <input type="hidden" id="tabNRColor_destinationTextbox">
132
- </div>
133
- <div id="tabNRColor_divApplyCancel" hidden>
134
- <button id="tabNRColor_colorSelectorTABApplyTextButton" type="button" class="red-ui-button">Apply</button>
135
- <button id="tabNRColor_colorSelectorTABCancelTextButton" type="button" class="red-ui-button">Cancel</button>
136
- </div>
137
-
138
- </div>
139
- </html>
140
- `;
141
-
142
- // COLOR BAR HANDLING ###########################
143
- RED.sidebar.addTab({
144
- id: "tabNRColor",
145
- label: "Color Picker",
146
- name: "Color Picker",
147
- iconClass: "fa fa-pencil",
148
- content: content,
149
- enableOnEdit: true,
150
- });
151
-
152
- // Temperature
153
- this.kelvinPicker = new iro.ColorPicker("#kelvinPicker", {
154
- width: 250,
155
- color: "rgb(255, 0, 0)",
156
- borderWidth: 1,
157
- borderColor: "#fff",
158
- layoutDirection: "vertical",
159
- layout: [
160
- {
161
- component: iro.ui.Slider,
162
- options: {
163
- sliderType: "kelvin",
164
- sliderSize: 20,
165
- },
166
- },
167
- ],
168
- });
169
- // color:change callbacks receive the current color
170
- this.kelvinPicker.on("color:change", function (color) {
171
- const resultRGBForNode = '{"red": ' + color.rgb.r + ', "green": ' + color.rgb.g + ', "blue": ' + color.rgb.b + "}";
172
- $("#resultRGB").val(resultRGBForNode);
173
- $("#resultKelvin").val(Math.round(color.kelvin, 0));
174
- });
175
-
176
- $("#resultKelvin").on("keyup", function () {
177
- setIroColorKelvin();
178
- });
179
- function setIroColorKelvin() {
180
- try {
181
- const color = JSON.parse($("#resultKelvin").val());
182
- this.kelvinPicker.color.setChannel("kelvin", color);
183
- } catch (error) { }
184
- }
185
-
186
- // Color
187
- this.colorPicker = new iro.ColorPicker("#colorPicker", {
188
- width: 250,
189
- color: "rgb(255, 0, 0)",
190
- borderWidth: 1,
191
- borderColor: "#fff",
192
- layout: [
193
- {
194
- component: iro.ui.Box,
195
- },
196
- {
197
- component: iro.ui.Slider,
198
- options: {
199
- id: "hue-slider",
200
- sliderType: "hue",
201
- },
202
- },
203
- ],
204
- });
205
- // color:change callbacks receive the current color
206
- this.colorPicker.on("color:change", function (color) {
207
- // Transform to compatible value for the node { "red": 255, "green": 255, "blue": 255 }
208
- const resultRGBForNode = '{"red": ' + color.rgb.r + ', "green": ' + color.rgb.g + ', "blue": ' + color.rgb.b + "}";
209
- $("#resultRGB").val(resultRGBForNode);
210
- });
211
-
212
- $("#resultRGB").on("keyup", function () {
213
- setIroColor();
214
- });
215
- function setIroColor() {
216
- try {
217
- const color = JSON.parse($("#resultRGB").val());
218
- this.colorPicker.color.setChannel("rgb", "r", color.red);
219
- this.colorPicker.color.setChannel("rgb", "g", color.green);
220
- this.colorPicker.color.setChannel("rgb", "b", color.blue);
221
- } catch (error) { }
222
- }
223
- // Copy to clipboard button
224
- $("#tabNRColor_colorSelectorTABApplyTextButton").on("click", function () {
225
- // const aa = $("#resultRGB").val()
226
- // navigator.clipboard.writeText(aa)
227
- const destTextBox = "#" + $("#tabNRColor_destinationTextbox").val();
228
- const resultRGB = $("#resultRGB").val();
229
- const resultKelvin = node.kelvinPicker.colors[0].kelvin;
230
- if (destTextBox === "#node-input-colorAtSwitchOnNightTime" || destTextBox === "#node-input-colorAtSwitchOnDayTime") {
231
- $(destTextBox).val(resultRGB);
232
- } else {
233
- $(destTextBox).val(resultKelvin);
234
- }
235
- // Flash the destination control
236
- $(destTextBox).css("background-color", "lightgreen");
237
- $("#tabNRColor_divApplyCancel").hide();
238
- RED.sidebar.show("help");
239
- setTimeout(() => {
240
- $(destTextBox).css("background-color", "");
241
- }, 500);
242
- });
243
- $("#tabNRColor_colorSelectorTABCancelTextButton").on("click", function () {
244
- $("#tabNRColor_destinationTextbox").val("");
245
- RED.sidebar.show("help");
246
- $("#tabNRColor_divApplyCancel").hide();
247
- });
248
- $("#node-input-colorAtSwitchOnDayTime").on("focus", function () {
249
- RED.sidebar.show("tabNRColor"); // Node-Red custom color TAB
250
- $("#tabNRColor_destinationTextbox").val("node-input-colorAtSwitchOnDayTime");
251
- $("#tabNRColor_divApplyCancel").show();
252
- const color = $("#node-input-colorAtSwitchOnDayTime").val();
253
- $("#resultRGB").val(color);
254
- setIroColor();
255
- });
256
- // $("#node-input-colorAtSwitchOnDayTime").on("blur", function () {
257
- // RED.sidebar.show("help");
258
- // });
259
- $("#node-input-colorAtSwitchOnNightTime").on("focus", function () {
260
- RED.sidebar.show("tabNRColor"); // Node-Red custom color TAB
261
- $("#tabNRColor_destinationTextbox").val("node-input-colorAtSwitchOnNightTime");
262
- $("#tabNRColor_divApplyCancel").show();
263
- const color = $("#node-input-colorAtSwitchOnNightTime").val();
264
- $("#resultRGB").val(color);
265
- setIroColor();
266
- });
267
- // ####################################
268
-
269
108
  $("#tabs").tabs(); // Tabs gestione KNX
270
109
 
271
110
  // 19/02/2020 Used to get the server sooner als deploy.
@@ -298,7 +137,14 @@
298
137
  $.getJSON("knxUltimateDpts", (data) => {
299
138
  data.forEach((dpt) => {
300
139
  if (dpt.value.startsWith(_dpt)) {
301
- $(_destinationWidget).append($("<option></option>").attr("value", dpt.value).text(dpt.text));
140
+ // Adjustment for HUE Temperature
141
+ if (dpt.value.startsWith("7.600")) {
142
+ $(_destinationWidget).append($("<option></option>").attr("value", dpt.value).text(dpt.text + " - KNX Kelvin range (0K-65535K)"));
143
+ } else if (dpt.value.startsWith("9.002")) {
144
+ $(_destinationWidget).append($("<option></option>").attr("value", dpt.value).text(dpt.text + " - HUE Kelvin range (Default 2000K-6535K"));
145
+ } else {
146
+ $(_destinationWidget).append($("<option></option>").attr("value", dpt.value).text(dpt.text));
147
+ }
302
148
  }
303
149
  });
304
150
  // Eval
@@ -390,44 +236,73 @@
390
236
  getDPT("7.600", "#node-input-dptLightKelvinState");
391
237
  getGroupAddress("#node-input-GALightKelvinState", "#node-input-nameLightKelvinState", "#node-input-dptLightKelvinState", " 7.600");
392
238
 
239
+ getDPT("9.002", "#node-input-dptLightKelvin");
240
+ getGroupAddress("#node-input-GALightKelvin", "#node-input-nameLightKelvin", "#node-input-dptLightKelvin", " 9.002");
393
241
 
394
- // Show/Hide and enable/disable day/night Lighting behaviour
395
- if (this.enableDayNightLighting === "yes") {
396
- $("#divEnableDayNightLighting").show();
397
- $("#divCCSBoxayNightLighting").css({ border: "1px solid dimgrey", "border-radius": "12px", padding: "5px" }); // Add little box to better understand the property page
398
- } else {
399
- $("#divEnableDayNightLighting").hide();
400
- $("#divCCSBoxayNightLighting").css({ border: "", "border-radius": "", padding: "" });
401
- }
242
+ getDPT("9.002", "#node-input-dptLightKelvinState");
243
+ getGroupAddress("#node-input-GALightKelvinState", "#node-input-nameLightKelvinState", "#node-input-dptLightKelvinState", " 9.002");
402
244
 
403
- $("#node-input-enableDayNightLighting").on("change", function () {
404
- if ($("#node-input-enableDayNightLighting").val() === "yes") {
405
- $("#divEnableDayNightLighting").show();
406
- $("#divCCSBoxayNightLighting").css({ border: "1px solid dimgrey", "border-radius": "12px", padding: "5px" }); // Add little box to better understand the property page
407
- } else {
408
- $("#divEnableDayNightLighting").hide();
409
- $("#divCCSBoxayNightLighting").css({ border: "", "border-radius": "", padding: "" });
410
- }
411
- });
412
245
 
413
246
  // Show/Hide the div of the color at swich on
414
247
  if (this.specifySwitchOnBrightness === "yes") {
415
248
  $("#divColorsAtSwitchOn").show();
249
+ $("#divTemperatureAtSwitchOn").hide();
250
+ } else if (this.specifySwitchOnBrightness === "temperature") {
251
+ $("#divColorsAtSwitchOn").hide();
252
+ $("#divTemperatureAtSwitchOn").show();
416
253
  } else {
417
254
  $("#divColorsAtSwitchOn").hide();
418
- $("#node-input-colorAtSwitchOnDayTime").val("");
255
+ $("#divTemperatureAtSwitchOn").hide();
419
256
  }
420
257
 
421
258
  $("#node-input-specifySwitchOnBrightness").on("change", function () {
422
259
  if ($("#node-input-specifySwitchOnBrightness").val() === "yes") {
423
260
  $("#divColorsAtSwitchOn").show();
424
- if ($("#node-input-colorAtSwitchOnDayTime").val() === "") $("#node-input-colorAtSwitchOnDayTime").val('{ "red": 255, "green": 255, "blue": 255 }');
261
+ $("#divTemperatureAtSwitchOn").hide();
262
+ } else if ($("#node-input-specifySwitchOnBrightness").val() === "temperature") {
263
+ $("#divColorsAtSwitchOn").hide();
264
+ $("#divTemperatureAtSwitchOn").show();
425
265
  } else {
426
266
  $("#divColorsAtSwitchOn").hide();
427
- $("#node-input-colorAtSwitchOnDayTime").val("");
267
+ $("#divTemperatureAtSwitchOn").hide();
428
268
  }
429
269
  });
430
270
 
271
+ // Show/Hide and enable/disable day/night Lighting behaviour
272
+ if (this.enableDayNightLighting === "yes") {
273
+ $("#divEnableDayNightLighting").show();
274
+ $("#divCCSBoxAtNightLighting").css({ border: "1px solid dimgrey", "border-radius": "12px", padding: "5px" }); // Add little box to better understand the property page
275
+ $("#divColorsAtSwitchOnNightTime").show();
276
+ $("#divTemperatureAtSwitchOnNightTime").hide();
277
+ } else if (this.enableDayNightLighting === "temperature") {
278
+ $("#divEnableDayNightLighting").show();
279
+ $("#divCCSBoxAtNightLighting").css({ border: "1px solid dimgrey", "border-radius": "12px", padding: "5px" }); // Add little box to better understand the property page
280
+ $("#divColorsAtSwitchOnNightTime").hide();
281
+ $("#divTemperatureAtSwitchOnNightTime").show();
282
+ } else {
283
+ $("#divEnableDayNightLighting").hide();
284
+ $("#divCCSBoxAtNightLighting").css({ border: "", "border-radius": "", padding: "" });
285
+ }
286
+
287
+ $("#node-input-enableDayNightLighting").on("change", function () {
288
+ if ($("#node-input-enableDayNightLighting").val() === "yes") {
289
+ $("#divEnableDayNightLighting").show();
290
+ $("#divCCSBoxAtNightLighting").css({ border: "1px solid dimgrey", "border-radius": "12px", padding: "5px" }); // Add little box to better understand the property page
291
+ $("#divColorsAtSwitchOnNightTime").show();
292
+ $("#divTemperatureAtSwitchOnNightTime").hide();
293
+ } else if ($("#node-input-enableDayNightLighting").val() === "temperature") {
294
+ $("#divEnableDayNightLighting").show();
295
+ $("#divCCSBoxAtNightLighting").css({ border: "1px solid dimgrey", "border-radius": "12px", padding: "5px" }); // Add little box to better understand the property page
296
+ $("#divColorsAtSwitchOnNightTime").hide();
297
+ $("#divTemperatureAtSwitchOnNightTime").show();
298
+ } else {
299
+ $("#divEnableDayNightLighting").hide();
300
+ $("#divCCSBoxAtNightLighting").css({ border: "", "border-radius": "", padding: "" });
301
+ }
302
+ });
303
+
304
+
305
+
431
306
  // Autocomplete suggestion with HUE Lights
432
307
  $("#node-input-name").autocomplete({
433
308
  minLength: 1,
@@ -503,36 +378,131 @@
503
378
 
504
379
  $("#getColorAtSwitchOnDayTimeButton").on("click", function () {
505
380
  $("#getColorAtSwitchOnDayTimeButton").text("Wait...");
506
- $.getJSON("knxUltimateGetHueColor?id=" + $("#node-input-hueDevice").val().split("#")[0], (data) => {
507
- $("#node-input-colorAtSwitchOnDayTime").val(data.toString());
508
- $("#node-input-colorAtSwitchOnDayTime").css("background-color", "lightgreen");
381
+ let jRet;
382
+ let sQuery;
383
+ if ($("#node-input-specifySwitchOnBrightness").val() === "yes") sQuery = "knxUltimateGetHueColor";
384
+ if ($("#node-input-specifySwitchOnBrightness").val() === "temperature") sQuery = "knxUltimateGetKelvinColor";
385
+ $.getJSON(sQuery + "?id=" + $("#node-input-hueDevice").val().split("#")[0], (data) => {
386
+ $("#node-input-colorAtSwitchOnDayTime").val(data);
387
+ $("#colorPickerDay").val(data);
388
+ $("#colorPickerDay").css("background-color", "lightgreen");
509
389
  setTimeout(() => {
510
- $("#node-input-colorAtSwitchOnDayTime").css("background-color", "");
390
+ $("#colorPickerDay").css("background-color", "");
511
391
  }, 500);
512
- $("#getColorAtSwitchOnDayTimeButton").text("Get current");
392
+ $("#getColorAtSwitchOnDayTimeButton").text("Get again");
513
393
  });
514
394
  });
395
+
515
396
  $("#getColorAtSwitchOnNightTimeButton").on("click", function () {
516
397
  $("#getColorAtSwitchOnNightTimeButton").text("Wait...");
517
- $.getJSON("knxUltimateGetHueColor?id=" + $("#node-input-hueDevice").val().split("#")[0], (data) => {
518
- $("#node-input-colorAtSwitchOnNightTime").val(data.toString());
519
- $("#node-input-colorAtSwitchOnNightTime").css("background-color", "lightgreen");
398
+ let jRet;
399
+ let sQuery;
400
+ if ($("#node-input-enableDayNightLighting").val() === "yes") sQuery = "knxUltimateGetHueColor";
401
+ if ($("#node-input-enableDayNightLighting").val() === "temperature") sQuery = "knxUltimateGetKelvinColor";
402
+ $.getJSON(sQuery + "?id=" + $("#node-input-hueDevice").val().split("#")[0], (data) => {
403
+ $("#node-input-colorAtSwitchOnNightTime").val(data);
404
+ $("#colorPickerNight").val(data);
405
+ $("#colorPickerNight").css("background-color", "lightgreen");
520
406
  setTimeout(() => {
521
- $("#node-input-colorAtSwitchOnNightTime").css("background-color", "");
407
+ $("#colorPickerNight").css("background-color", "");
522
408
  }, 500);
523
- $("#getColorAtSwitchOnNightTimeButton").text("Get current");
409
+ $("#getColorAtSwitchOnNightTimeButton").text("Get again");
524
410
  });
525
411
  });
526
412
 
527
- // Fill options for minDimLevel and maxDimLevel
528
- for (let index = 0; index <= 90; index++) {
413
+ // Fill options for minDimLevel and maxDimLevel and comboBrightnessAtSwitchOn (for color brightness at switch on, with temperature toghedher)
414
+ for (let index = 0; index <= 100; index += 5) {
529
415
  if (index === 0) {
530
416
  $("#node-input-minDimLevelLight").append($("<option>").val(index).text(index.toString() + "% (Switch Off)"));
417
+ $("#comboBrightnessAtSwitchOn").append($("<option>").val(index).text(index.toString() + "% (Switch Off)"));
418
+ $("#comboBrightnessAtSwitchOnNightTime").append($("<option>").val(index).text(index.toString() + "% (Switch Off)"));
531
419
  } else {
532
420
  $("#node-input-minDimLevelLight").append($("<option>").val(index).text(index.toString() + "%"));
421
+ $("#comboBrightnessAtSwitchOn").append($("<option>").val(index).text(index.toString() + "%"));
422
+ $("#comboBrightnessAtSwitchOnNightTime").append($("<option>").val(index).text(index.toString() + "%"));
423
+ }
424
+ }
425
+ // Temperatures, from 2000 to 6535K (circa)
426
+ for (let index = 2000; index <= 6500; index += 100) {
427
+ if (index === 2200) {
428
+ $("#comboTemperatureAtSwitchOn").append($("<option>").val(index).text(index.toString() + "K (start of philips white ambiance lights range)"));
429
+ $("#comboTemperatureAtSwitchOnNightTime").append($("<option>").val(index).text(index.toString() + "K (start of philips white ambiance lights range)"));
430
+ } else if (index === 2700) {
431
+ $("#comboTemperatureAtSwitchOn").append($("<option>").val(index).text(index.toString() + "K (warm white, intimate, cozy, personal, for living rooms)"));
432
+ $("#comboTemperatureAtSwitchOnNightTime").append($("<option>").val(index).text(index.toString() + "K (warm white, intimate, cozy, personal, for living rooms)"));
433
+ } else if (index === 3000) {
434
+ $("#comboTemperatureAtSwitchOn").append($("<option>").val(index).text(index.toString() + "K (soft white, warm, calming, for bathrooms and kitchens)"));
435
+ $("#comboTemperatureAtSwitchOnNightTime").append($("<option>").val(index).text(index.toString() + "K (soft white, warm, calming, for bathrooms and kitchens)"));
436
+ } else if (index === 3500) {
437
+ $("#comboTemperatureAtSwitchOn").append($("<option>").val(index).text(index.toString() + "K (neutral white, balanced, friendly, inviting, for office spaces and retail)"));
438
+ $("#comboTemperatureAtSwitchOnNightTime").append($("<option>").val(index).text(index.toString() + "K (not recommended for night time - neutral white, for office spaces and retail)"));
439
+ } else if (index === 4100) {
440
+ $("#comboTemperatureAtSwitchOn").append($("<option>").val(index).text(index.toString() + "K (cool white, precise, clean, focused, for garages and grocery stores)"));
441
+ $("#comboTemperatureAtSwitchOnNightTime").append($("<option>").val(index).text(index.toString() + "K (not recommended for night time - cool white, precise, clean, focused, for garages and grocery stores)"));
442
+ } else if (index === 5000) {
443
+ $("#comboTemperatureAtSwitchOn").append($("<option>").val(index).text(index.toString() + "K (bright white, vibrant, crisp, for warehouses, sports stadiums and healthcare)"));
444
+ $("#comboTemperatureAtSwitchOnNightTime").append($("<option>").val(index).text(index.toString() + "K (not recommended for night time - bright white, vibrant, crisp, for warehouses, sports stadiums and healthcare)"));
445
+ } else if (index === 6500) {
446
+ $("#comboTemperatureAtSwitchOn").append($("<option>").val(index).text(index.toString() + "K (daylight, alert, energetic, for indoor agriculture)"));
447
+ $("#comboTemperatureAtSwitchOnNightTime").append($("<option>").val(index).text(index.toString() + "K (not recommended for night time - daylight, alert, energetic, for indoor agriculture)"));
448
+ } else {
449
+ $("#comboTemperatureAtSwitchOn").append($("<option>").val(index).text(index.toString() + "K"));
450
+ $("#comboTemperatureAtSwitchOnNightTime").append($("<option>").val(index).text(index.toString() + "K"));
533
451
  }
452
+ }
534
453
 
454
+
455
+ // Calculate kelvin/color
456
+ let json;
457
+ try {
458
+ json = JSON.parse(this.colorAtSwitchOnDayTime);
459
+ } catch (error) { }
460
+ if (json !== undefined && json.kelvin !== undefined) {
461
+ // Kelvin
462
+ $("#comboTemperatureAtSwitchOn").val(json.kelvin);
463
+ $("#comboBrightnessAtSwitchOn").val(json.brightness);
464
+ } else if (json !== undefined && json.red !== undefined) {
465
+ // Must transform RGB into HTML HEX color
466
+ $("#node-input-colorAtSwitchOnDayTime").val("#" + rgbHex(json.red, json.green, json.blue));
467
+ $("#colorPickerDay").val($("#node-input-colorAtSwitchOnDayTime").val());
468
+ } else {
469
+ // It's already an HEX color
470
+ $("#colorPickerDay").val(this.colorAtSwitchOnDayTime);
471
+ }
472
+ //Night
473
+ json = undefined;
474
+ try {
475
+ json = JSON.parse(this.colorAtSwitchOnNightTime);
476
+ } catch (error) { }
477
+ if (json !== undefined && json.kelvin !== undefined) {
478
+ // Kelvin
479
+ $("#comboTemperatureAtSwitchOnNightTime").val(json.kelvin);
480
+ $("#comboBrightnessAtSwitchOnNightTime").val(json.brightness);
481
+ } else if (json !== undefined && json.red !== undefined) {
482
+ // Must transform RGB into HTML HEX color
483
+ $("#node-input-colorAtSwitchOnNightTime").val("#" + rgbHex(json.red, json.green, json.blue));
484
+ $("#colorPickerNight").val($("#node-input-colorAtSwitchOnNightTime").val());
485
+ } else {
486
+ // It's already an HEX color
487
+ $("#colorPickerNight").val(this.colorAtSwitchOnNightTime);
535
488
  }
489
+
490
+ $("#comboTemperatureAtSwitchOn, #comboBrightnessAtSwitchOn").on("change", function () {
491
+ $("#node-input-colorAtSwitchOnDayTime").val('{ "kelvin":' + $("#comboTemperatureAtSwitchOn").val() + ', "brightness":' + $("#comboBrightnessAtSwitchOn").val() + ' }');
492
+ });
493
+ $("#comboTemperatureAtSwitchOnNightTime, #comboBrightnessAtSwitchOnNightTime").on("change", function () {
494
+ $("#node-input-colorAtSwitchOnNightTime").val('{ "kelvin":' + $("#comboTemperatureAtSwitchOnNightTime").val() + ', "brightness":' + $("#comboBrightnessAtSwitchOnNightTime").val() + ' }');
495
+ });
496
+
497
+ // Create and put the JSON to node-input-colorAtSwitchOnDayTime
498
+ $("#colorPickerDay").on("change", function () {
499
+ $("#node-input-colorAtSwitchOnDayTime").val(this.value);
500
+ });
501
+ $("#colorPickerNight").on("change", function () {
502
+ $("#node-input-colorAtSwitchOnNightTime").val(this.value);
503
+ });
504
+
505
+
536
506
  $("#node-input-minDimLevelLight").val(this.minDimLevelLight);
537
507
  for (let index = 100; index >= 10; index--) {
538
508
  $("#node-input-maxDimLevelLight").append(
@@ -543,13 +513,12 @@
543
513
  }
544
514
  $("#node-input-maxDimLevelLight").val(this.maxDimLevelLight);
545
515
 
546
- if (this.hueDevice !== "") $("#tabs").show();
547
-
516
+ if (this.hueDevice !== "") $("#tabs").show(); // Light options
548
517
 
549
518
  },
550
519
  oneditsave: function () {
551
- RED.sidebar.removeTab("tabNRColor");
552
- RED.sidebar.show("help");
520
+ //RED.sidebar.removeTab("tabNRColor");
521
+ //RED.sidebar.show("help");
553
522
  if ($("#node-input-enableNodePINS").val() === "yes") {
554
523
  this.outputs = 1;
555
524
  this.inputs = 1;
@@ -559,379 +528,500 @@
559
528
  }
560
529
  },
561
530
  oneditcancel: function () {
562
- RED.sidebar.removeTab("tabNRColor");
563
- RED.sidebar.show("help");
531
+ //RED.sidebar.removeTab("tabNRColor");
532
+ //RED.sidebar.show("help");
564
533
  }
565
534
  });
566
535
 
536
+ function rgbHex(red, green, blue, alpha) {
537
+ const toHex = (red, green, blue, alpha) => ((blue | green << 8 | red << 16) | 1 << 24).toString(16).slice(1) + alpha;
538
+ const parseCssRgbString = (input) => {
539
+ const parts = input.replace(/rgba?\(([^)]+)\)/, '$1').split(/[,\s/]+/).filter(Boolean);
540
+ if (parts.length < 3) {
541
+ return;
542
+ }
543
+
544
+ const parseValue = (value, max) => {
545
+ value = value.trim();
546
+
547
+ if (value.endsWith('%')) {
548
+ return Math.min(Number.parseFloat(value) * max / 100, max);
549
+ }
550
+
551
+ return Math.min(Number.parseFloat(value), max);
552
+ };
553
+
554
+ const red = parseValue(parts[0], 255);
555
+ const green = parseValue(parts[1], 255);
556
+ const blue = parseValue(parts[2], 255);
557
+ let alpha;
558
+
559
+ if (parts.length === 4) {
560
+ alpha = parseValue(parts[3], 1);
561
+ }
562
+
563
+ return [red, green, blue, alpha];
564
+ };
565
+
566
+ let isPercent = (red + (alpha || '')).toString().includes('%');
567
567
 
568
+ if (typeof red === 'string' && !green) { // Single string parameter.
569
+ const parsed = parseCssRgbString(red);
570
+ if (!parsed) {
571
+ throw new TypeError('Invalid or unsupported color format.');
572
+ }
573
+
574
+ isPercent = false;
575
+ [red, green, blue, alpha] = parsed;
576
+ } else if (alpha !== undefined) {
577
+ alpha = Number.parseFloat(alpha);
578
+ }
579
+
580
+ if (typeof red !== 'number'
581
+ || typeof green !== 'number'
582
+ || typeof blue !== 'number'
583
+ || red > 255
584
+ || green > 255
585
+ || blue > 255
586
+ ) {
587
+ throw new TypeError('Expected three numbers below 256');
588
+ }
589
+
590
+ if (typeof alpha === 'number') {
591
+ if (!isPercent && alpha >= 0 && alpha <= 1) {
592
+ alpha = Math.round(255 * alpha);
593
+ } else if (isPercent && alpha >= 0 && alpha <= 100) {
594
+ alpha = Math.round(255 * alpha / 100);
595
+ } else {
596
+ throw new TypeError(`Expected alpha value (${alpha}) as a fraction or percentage`);
597
+ }
598
+
599
+ alpha = (alpha | 1 << 8).toString(16).slice(1); // eslint-disable-line no-mixed-operators
600
+ } else {
601
+ alpha = '';
602
+ }
603
+
604
+ return toHex(red, green, blue, alpha);
605
+ }
568
606
 
569
607
 
570
608
  </script>
571
- <script src="resources/node-red-contrib-knx-ultimate/11f26b4500.js"></script>
572
- <script src="resources/node-red-contrib-knx-ultimate/iro@5"></script>
609
+
573
610
 
574
611
  <script type="text/html" data-template-name="knxUltimateHueLight">
575
612
 
613
+ <div class="form-row">
614
+ <b>HUE Light/Group node</b>&nbsp&nbsp<span style="color:red" &nbsp &nbsp<i class="fa fa-youtube"></i></span>&nbsp<a
615
+ target="_blank" href="https://youtu.be/jjEUI1J8bkA"><u>Youtube sample</u></a>
616
+ <br />
617
+ <br />
618
+ <p align="center">
619
+ <i class="fa-regular fa-lightbulb fa-bounce fa-8x"></i>
620
+ </p>
621
+ <br />
622
+ <label for="node-input-server">
623
+ <img
624
+ src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAKnRFWHRDcmVhdGlvbiBUaW1lAEZyIDYgQXVnIDIwMTAgMjE6NTI6MTkgKzAxMDD84aS8AAAAB3RJTUUH3gYYCicNV+4WIQAAAAlwSFlzAAALEgAACxIB0t1+/AAAAARnQU1BAACxjwv8YQUAAACUSURBVHjaY2CgFZg5c+Z/ZEyWAZ8+f/6/ZsWs/xoamqMGkGrA6Wla/1+fVARjEBuGsSoGmY4eZSCNL59d/g8DIDbIAHR14OgFGQByKjIGKX5+6/T///8gGMQGiV1+/B0Fg70GIkD+RMYgxf/O5/7//2MSmAZhkBi6OrgB6Bg5DGB4ajr3f2xqsYYLSDE2THJUDg0AAAqyDVd4tp4YAAAAAElFTkSuQmCC"></img>
625
+ KNX GW
626
+ </label>
627
+ <input type="text" id="node-input-server" />
628
+ </div>
576
629
 
577
- <div class="form-row">
578
- <b>HUE Light/Group node</b>&nbsp&nbsp<span style="color:red"
579
- &nbsp
580
- &nbsp<i class="fa fa-youtube"></i></span>&nbsp<a target="_blank" href="https://youtu.be/jjEUI1J8bkA"><u>Youtube sample</u></a>
581
- <br />
582
- <br />
583
- <p align="center">
584
- <i class="fa-regular fa-lightbulb fa-bounce fa-8x"></i>
585
- </p>
586
- <br />
587
- <label for="node-input-server" >
588
- <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAKnRFWHRDcmVhdGlvbiBUaW1lAEZyIDYgQXVnIDIwMTAgMjE6NTI6MTkgKzAxMDD84aS8AAAAB3RJTUUH3gYYCicNV+4WIQAAAAlwSFlzAAALEgAACxIB0t1+/AAAAARnQU1BAACxjwv8YQUAAACUSURBVHjaY2CgFZg5c+Z/ZEyWAZ8+f/6/ZsWs/xoamqMGkGrA6Wla/1+fVARjEBuGsSoGmY4eZSCNL59d/g8DIDbIAHR14OgFGQByKjIGKX5+6/T///8gGMQGiV1+/B0Fg70GIkD+RMYgxf/O5/7//2MSmAZhkBi6OrgB6Bg5DGB4ajr3f2xqsYYLSDE2THJUDg0AAAqyDVd4tp4YAAAAAElFTkSuQmCC"></img>
589
- KNX GW
590
- </label>
591
- <input type="text" id="node-input-server" />
592
- </div>
630
+ <div class="form-row">
631
+ <label for="node-input-serverHue">
632
+ <img
633
+ src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAEKADAAQAAAABAAAAEAAAAAA0VXHyAAABFUlEQVQ4EZWSsWoCQRCG1yiENEFEi6QSkjqWWoqFoBYJ+Br6JHkMn8Iibd4ihQpaJIhWNkry/ZtdGZY78Qa+m39nZ+dm9s4550awglNBluS/gVtAX6KgDclf68w2OThgfR9iT/jnoEv4TtByDThWTCDKW4SSZTf/zj9/eZbN+izTDuKGimu0vPF8B/YN8aC8LmcOj/AAn9CFTEs70Js/oGqy79C69bqJ5XbQI2kGO5N8QL9D08S8zBtBF5ZaVsznpCMoqJnVdjTpb1Db0fwIWmQV6BLXzFOYgA6/gDVfQN9bBWp2J2hdWDPoBV5FrKnAJutHikk/CHHR8i7x4iG7qQ720IYvu3GFbpHjx3pFrOFYkA354z/5bkK826phyAAAAABJRU5ErkJggg==" />
634
+ HUE Bridge
635
+ </label>
636
+ <input type="text" id="node-input-serverHue" />
637
+ </div>
593
638
 
594
- <div class="form-row">
595
- <label for="node-input-serverHue">
596
- <img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAEKADAAQAAAABAAAAEAAAAAA0VXHyAAABFUlEQVQ4EZWSsWoCQRCG1yiENEFEi6QSkjqWWoqFoBYJ+Br6JHkMn8Iibd4ihQpaJIhWNkry/ZtdGZY78Qa+m39nZ+dm9s4550awglNBluS/gVtAX6KgDclf68w2OThgfR9iT/jnoEv4TtByDThWTCDKW4SSZTf/zj9/eZbN+izTDuKGimu0vPF8B/YN8aC8LmcOj/AAn9CFTEs70Js/oGqy79C69bqJ5XbQI2kGO5N8QL9D08S8zBtBF5ZaVsznpCMoqJnVdjTpb1Db0fwIWmQV6BLXzFOYgA6/gDVfQN9bBWp2J2hdWDPoBV5FrKnAJutHikk/CHHR8i7x4iG7qQ720IYvu3GFbpHjx3pFrOFYkA354z/5bkK826phyAAAAABJRU5ErkJggg=="/>
597
- HUE Bridge
598
- </label>
599
- <input type="text" id="node-input-serverHue" />
639
+ <br />
640
+ <p>
641
+ <b>Philips HUE</b>
642
+ </p>
643
+
644
+ <div class="form-row">
645
+ <label for="node-input-hueDevice">
646
+ <i class="fa fa-play-circle"></i>&nbspName</label>
647
+ <input type="text" id="node-input-name" placeholder="Enter your hue device name" />
648
+ <input type="hidden" id="node-input-hueDevice" />
649
+ </div>
650
+
651
+ <br />
652
+
653
+
654
+ <div id="tabs" style="width:680px" hidden>
655
+ <ul>
656
+ <li><a href="#tabs-1">Switching</a></li>
657
+ <li><a href="#tabs-2">Dim/Brightness</a></li>
658
+ <li><a href="#tabs-3">Tunable white</a></li>
659
+ <li><a href="#tabs-4">Colors</a></li>
660
+ <li><a href="#tabs-5">Effects</a></li>
661
+ <li><a href="#tabs-6">Behaviour</a></li>
662
+ </ul>
663
+ <div id="tabs-1">
664
+ <p>
665
+ <div class="form-row">
666
+ <label for="node-input-nameLightSwitch" style="width:110px;"><i class="fa fa-play-circle-o"></i> Control</label>
667
+
668
+ <label for="node-input-GALightSwitch" style="width:20px;"><span
669
+ data-i18n="knxUltimateHueLight.node-input-GALightSwitch"></span></label>
670
+ <input type="text" id="node-input-GALightSwitch" placeholder="Ex: 1/1/1"
671
+ style="width:70px;margin-left: 5px; text-align: left;">
672
+
673
+ <label for="node-input-dptLightSwitch" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
674
+ <select id="node-input-dptLightSwitch" style="width:140px;"></select>
675
+
676
+ <label for="node-input-nameLightSwitch" style="width:50px; margin-left: 0px; text-align: right;"><span
677
+ data-i18n="knxUltimateHueLight.node-input-name"></span></label>
678
+ <input type="text" id="node-input-nameLightSwitch" style="width:190px;margin-left: 5px; text-align: left;">
679
+ </div>
680
+ <div class="form-row">
681
+ <label for="node-input-nameLightState" style="width:110px;"><i class="fa fa-play-circle-o"></i> Status</label>
682
+
683
+ <label for="node-input-GALightState" style="width:20px;">GA</label>
684
+ <input type="text" id="node-input-GALightState" placeholder="Ex: 1/1/1"
685
+ style="width:70px;margin-left: 5px; text-align: left;">
686
+
687
+ <label for="node-input-dptLightState" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
688
+ <select id="node-input-dptLightState" style="width:140px;"></select>
689
+
690
+ <label for="node-input-nameLightState" style="width:50px; margin-left: 0px; text-align: right;"><span
691
+ data-i18n="knxUltimateHueLight.node-input-name"></span></label>
692
+ <input type="text" id="node-input-nameLightState" style="width:190px;margin-left: 5px; text-align: left;">
693
+ </div>
694
+ </p>
600
695
  </div>
696
+ <div id="tabs-2">
697
+ <p>
698
+ <div class="form-row">
699
+ <label for="node-input-nameLightDIM" style="width:110px;"><i class="fa fa-play-circle-o"></i> Control</label>
700
+
701
+ <label for="node-input-GALightDIM" style="width:20px;"><span
702
+ data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
703
+ <input type="text" id="node-input-GALightDIM" placeholder="Ex: 1/1/1"
704
+ style="width:70px;margin-left: 5px; text-align: left;">
705
+
706
+ <label for="node-input-dptLightDIM" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
707
+ <select id="node-input-dptLightDIM" style="width:140px;"></select>
708
+
709
+ <label for="node-input-nameLightDIM" style="width:50px; margin-left: 0px; text-align: right;"><span
710
+ data-i18n="knxUltimateHueLight.node-input-name"></span></label>
711
+ <input type="text" id="node-input-nameLightDIM" style="width:190px;margin-left: 5px; text-align: left;">
712
+ </div>
713
+ <div class="form-row">
714
+ <label for="node-input-nameLightBrightness" style="width:110px;"><i class="fa fa-play-circle-o"></i> Control
715
+ %</label>
601
716
 
602
- <br/>
603
- <p>
604
- <b>Philips HUE</b>
605
- </p>
717
+ <label for="node-input-GALightBrightness" style="width:20px;"><span
718
+ data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
719
+ <input type="text" id="node-input-GALightBrightness" placeholder="Ex: 1/1/1"
720
+ style="width:70px;margin-left: 5px; text-align: left;">
721
+
722
+ <label for="node-input-dptLightBrightness" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
723
+ <select id="node-input-dptLightBrightness" style="width:140px;"></select>
724
+
725
+ <label for="node-input-nameLightBrightness" style="width:50px; margin-left: 0px; text-align: right;"><span
726
+ data-i18n="knxUltimateHueLight.node-input-name"></span></label>
727
+ <input type="text" id="node-input-nameLightBrightness" style="width:190px;margin-left: 5px; text-align: left;">
728
+ </div>
729
+
730
+ <div class="form-row">
731
+ <label for="node-input-nameLightBrightnessState" style="width:110px;"><i class="fa fa-play-circle-o"></i>
732
+ Status</label>
733
+
734
+ <label for="node-input-GALightBrightnessState" style="width:20px;"><span
735
+ data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
736
+ <input type="text" id="node-input-GALightBrightnessState" placeholder="Ex: 1/1/1"
737
+ style="width:70px;margin-left: 5px; text-align: left;">
606
738
 
607
- <div class="form-row">
608
- <label for="node-input-hueDevice" >
609
- <i class="fa fa-play-circle"></i>&nbspName</label>
610
- <input type="text" id="node-input-name" placeholder="Enter your hue device name"/>
611
- <input type="hidden" id="node-input-hueDevice"/>
739
+ <label for="node-input-dptLightBrightnessState"
740
+ style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
741
+ <select id="node-input-dptLightBrightnessState" style="width:140px;"></select>
742
+
743
+ <label for="node-input-nameLightBrightnessState" style="width:50px; margin-left: 0px; text-align: right;"><span
744
+ data-i18n="knxUltimateHueLight.node-input-name"></span></label>
745
+ <input type="text" id="node-input-nameLightBrightnessState"
746
+ style="width:190px;margin-left: 5px; text-align: left;">
747
+ </div>
748
+ </p>
612
749
  </div>
750
+ <div id="tabs-3">
751
+ <p>
752
+ <div class="form-row">
753
+ <label for="node-input-nameLightHSV" style="width:110px;"><i class="fa fa-play-circle-o"></i> Control dim</label>
613
754
 
614
- <br/>
615
-
616
-
617
- <div id="tabs" style="width:680px" hidden>
618
- <ul>
619
- <li><a href="#tabs-1">Switching</a></li>
620
- <li><a href="#tabs-2">Dim/Brightness</a></li>
621
- <li><a href="#tabs-3">Tunable white</a></li>
622
- <li><a href="#tabs-4">Colors</a></li>
623
- <li><a href="#tabs-5">Effects</a></li>
624
- <li><a href="#tabs-6">Behaviour</a></li>
625
- </ul>
626
- <div id="tabs-1">
627
- <p>
628
- <div class="form-row">
629
- <label for="node-input-nameLightSwitch" style="width:110px;"><i class="fa fa-play-circle-o"></i> Control</label>
630
-
631
- <label for="node-input-GALightSwitch" style="width:20px;"><span data-i18n="knxUltimateHueLight.node-input-GALightSwitch"></span></label>
632
- <input type="text" id="node-input-GALightSwitch" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
633
-
634
- <label for="node-input-dptLightSwitch" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
635
- <select id="node-input-dptLightSwitch" style="width:140px;"></select>
636
-
637
- <label for="node-input-nameLightSwitch" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
638
- <input type="text" id="node-input-nameLightSwitch" style="width:190px;margin-left: 5px; text-align: left;">
639
- </div>
640
- <div class="form-row">
641
- <label for="node-input-nameLightState" style="width:110px;"><i class="fa fa-play-circle-o"></i> Status</label>
642
-
643
- <label for="node-input-GALightState" style="width:20px;">GA</label>
644
- <input type="text" id="node-input-GALightState" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
645
-
646
- <label for="node-input-dptLightState" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
647
- <select id="node-input-dptLightState" style="width:140px;"></select>
648
-
649
- <label for="node-input-nameLightState" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
650
- <input type="text" id="node-input-nameLightState" style="width:190px;margin-left: 5px; text-align: left;">
651
- </div>
652
- </p>
653
- </div>
654
- <div id="tabs-2">
655
- <p>
656
- <div class="form-row">
657
- <label for="node-input-nameLightDIM" style="width:110px;"><i class="fa fa-play-circle-o"></i> Control</label>
755
+ <label for="node-input-GALightHSV" style="width:20px;">GA</label>
756
+ <input type="text" id="node-input-GALightHSV" placeholder="Ex: 1/1/1"
757
+ style="width:70px;margin-left: 5px; text-align: left;">
658
758
 
659
- <label for="node-input-GALightDIM" style="width:20px;"><span data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
660
- <input type="text" id="node-input-GALightDIM" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
759
+ <label for="node-input-dptLightHSV" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
760
+ <select id="node-input-dptLightHSV" style="width:140px;"></select>
661
761
 
662
- <label for="node-input-dptLightDIM" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
663
- <select id="node-input-dptLightDIM" style="width:140px;"></select>
762
+ <label for="node-input-nameLightHSV" style="width:50px; margin-left: 0px; text-align: right;">Name</label>
763
+ <input type="text" id="node-input-nameLightHSV" style="width:190px;margin-left: 5px; text-align: left;">
764
+ </div>
765
+ <div class="form-row">
766
+ <label for="node-input-nameLightHSVPercentage" style="width:110px;"><i class="fa fa-play-circle-o"></i> Control
767
+ %</label>
664
768
 
665
- <label for="node-input-nameLightDIM" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
666
- <input type="text" id="node-input-nameLightDIM" style="width:190px;margin-left: 5px; text-align: left;">
667
- </div>
668
- <div class="form-row">
669
- <label for="node-input-nameLightBrightness" style="width:110px;"><i class="fa fa-play-circle-o"></i> Control %</label>
769
+ <label for="node-input-GALightHSVPercentage" style="width:20px;">GA</label>
770
+ <input type="text" id="node-input-GALightHSVPercentage" placeholder="Ex: 1/1/1"
771
+ style="width:70px;margin-left: 5px; text-align: left;">
670
772
 
671
- <label for="node-input-GALightBrightness" style="width:20px;"><span data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
672
- <input type="text" id="node-input-GALightBrightness" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
773
+ <label for="node-input-dptLightHSVPercentage" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
774
+ <select id="node-input-dptLightHSVPercentage" style="width:140px;"></select>
673
775
 
674
- <label for="node-input-dptLightBrightness" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
675
- <select id="node-input-dptLightBrightness" style="width:140px;"></select>
776
+ <label for="node-input-nameLightHSVPercentage"
777
+ style="width:50px; margin-left: 0px; text-align: right;">Name</label>
778
+ <input type="text" id="node-input-nameLightHSVPercentage" style="width:190px;margin-left: 5px; text-align: left;">
779
+ </div>
780
+ <div class="form-row">
781
+ <label for="node-input-nameLightKelvin" style="width:110px;"><i class="fa fa-play-circle-o"></i> Control
782
+ Kelvin</label>
676
783
 
677
- <label for="node-input-nameLightBrightness" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
678
- <input type="text" id="node-input-nameLightBrightness" style="width:190px;margin-left: 5px; text-align: left;">
679
- </div>
784
+ <label for="node-input-GALightKelvin" style="width:20px;">GA</label>
785
+ <input type="text" id="node-input-GALightKelvin" placeholder="Ex: 1/1/1"
786
+ style="width:70px;margin-left: 5px; text-align: left;">
680
787
 
681
- <div class="form-row">
682
- <label for="node-input-nameLightBrightnessState" style="width:110px;"><i class="fa fa-play-circle-o"></i> Status</label>
788
+ <label for="node-input-dptLightKelvin" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
789
+ <select id="node-input-dptLightKelvin" style="width:140px;"></select>
683
790
 
684
- <label for="node-input-GALightBrightnessState" style="width:20px;"><span data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
685
- <input type="text" id="node-input-GALightBrightnessState" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
791
+ <label for="node-input-nameLightKelvin" style="width:50px; margin-left: 0px; text-align: right;">Name</label>
792
+ <input type="text" id="node-input-nameLightKelvin" style="width:190px;margin-left: 5px; text-align: left;">
793
+ </div>
794
+ <div class="form-row">
795
+ <label for="node-input-nameLightHSVState" style="width:110px;"><i class="fa fa-play-circle-o"></i> Status
796
+ %</label>
686
797
 
687
- <label for="node-input-dptLightBrightnessState" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
688
- <select id="node-input-dptLightBrightnessState" style="width:140px;"></select>
798
+ <label for="node-input-GALightHSVState" style="width:20px;"><span
799
+ data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
800
+ <input type="text" id="node-input-GALightHSVState" placeholder="Ex: 1/1/1"
801
+ style="width:70px;margin-left: 5px; text-align: left;">
689
802
 
690
- <label for="node-input-nameLightBrightnessState" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
691
- <input type="text" id="node-input-nameLightBrightnessState" style="width:190px;margin-left: 5px; text-align: left;">
692
- </div>
693
- </p>
694
- </div>
695
- <div id="tabs-3">
696
- <p>
697
- <div class="form-row">
698
- <label for="node-input-nameLightHSV" style="width:110px;"><i class="fa fa-play-circle-o"></i> Control dim</label>
699
-
700
- <label for="node-input-GALightHSV" style="width:20px;">GA</label>
701
- <input type="text" id="node-input-GALightHSV" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
702
-
703
- <label for="node-input-dptLightHSV" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
704
- <select id="node-input-dptLightHSV" style="width:140px;"></select>
705
-
706
- <label for="node-input-nameLightHSV" style="width:50px; margin-left: 0px; text-align: right;">Name</label>
707
- <input type="text" id="node-input-nameLightHSV" style="width:190px;margin-left: 5px; text-align: left;">
708
- </div>
709
- <div class="form-row">
710
- <label for="node-input-nameLightHSVPercentage" style="width:110px;"><i class="fa fa-play-circle-o"></i> Control %</label>
711
-
712
- <label for="node-input-GALightHSVPercentage" style="width:20px;">GA</label>
713
- <input type="text" id="node-input-GALightHSVPercentage" placeholder="Ex: 1/1/1"
714
- style="width:70px;margin-left: 5px; text-align: left;">
715
-
716
- <label for="node-input-dptLightHSVPercentage" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
717
- <select id="node-input-dptLightHSVPercentage" style="width:140px;"></select>
718
-
719
- <label for="node-input-nameLightHSVPercentage" style="width:50px; margin-left: 0px; text-align: right;">Name</label>
720
- <input type="text" id="node-input-nameLightHSVPercentage" style="width:190px;margin-left: 5px; text-align: left;">
721
- </div>
722
- <div class="form-row">
723
- <label for="node-input-nameLightKelvin" style="width:110px;"><i class="fa fa-play-circle-o"></i> Control Kelvin</label>
724
-
725
- <label for="node-input-GALightKelvin" style="width:20px;">GA</label>
726
- <input type="text" id="node-input-GALightKelvin" placeholder="Ex: 1/1/1"
727
- style="width:70px;margin-left: 5px; text-align: left;">
728
-
729
- <label for="node-input-dptLightKelvin" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
730
- <select id="node-input-dptLightKelvin" style="width:140px;"></select>
731
-
732
- <label for="node-input-nameLightKelvin" style="width:50px; margin-left: 0px; text-align: right;">Name</label>
733
- <input type="text" id="node-input-nameLightKelvin" style="width:190px;margin-left: 5px; text-align: left;">
734
- </div>
735
- <div class="form-row">
736
- <label for="node-input-nameLightHSVState" style="width:110px;"><i class="fa fa-play-circle-o"></i> Status %</label>
737
-
738
- <label for="node-input-GALightHSVState" style="width:20px;"><span data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
739
- <input type="text" id="node-input-GALightHSVState" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
740
-
741
- <label for="node-input-dptLightHSVState" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
742
- <select id="node-input-dptLightHSVState" style="width:140px;"></select>
743
-
744
- <label for="node-input-nameLightHSVState" style="width:50px; margin-left: 0px; text-align: right;">Name</label>
745
- <input type="text" id="node-input-nameLightHSVState" style="width:190px;margin-left: 5px; text-align: left;">
746
- </div>
747
- <div class="form-row">
748
- <label for="node-input-nameLightKelvinState" style="width:110px;"><i class="fa fa-play-circle-o"></i> Status Kelvin</label>
749
-
750
- <label for="node-input-GALightKelvinState" style="width:20px;">GA</label>
751
- <input type="text" id="node-input-GALightKelvinState" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
752
-
753
- <label for="node-input-dptLightKelvinState" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
754
- <select id="node-input-dptLightKelvinState" style="width:140px;"></select>
755
-
756
- <label for="node-input-nameLightKelvinState" style="width:50px; margin-left: 0px; text-align: right;">Name</label>
757
- <input type="text" id="node-input-nameLightKelvinState" style="width:190px;margin-left: 5px; text-align: left;">
758
- </div>
759
- </p>
760
- </div>
761
- <div id="tabs-4">
762
- <p>
763
- <div class="form-row">
764
- <label for="node-input-nameLightColor" style="width:110px;"><i class="fa fa-play-circle-o"></i> Control</label>
803
+ <label for="node-input-dptLightHSVState" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
804
+ <select id="node-input-dptLightHSVState" style="width:140px;"></select>
765
805
 
766
- <label for="node-input-GALightColor" style="width:20px;"><span data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
767
- <input type="text" id="node-input-GALightColor" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
806
+ <label for="node-input-nameLightHSVState" style="width:50px; margin-left: 0px; text-align: right;">Name</label>
807
+ <input type="text" id="node-input-nameLightHSVState" style="width:190px;margin-left: 5px; text-align: left;">
808
+ </div>
809
+ <div class="form-row">
810
+ <label for="node-input-nameLightKelvinState" style="width:110px;"><i class="fa fa-play-circle-o"></i> Status
811
+ Kelvin</label>
768
812
 
769
- <label for="node-input-dptLightColor" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
770
- <select id="node-input-dptLightColor" style="width:140px;"></select>
813
+ <label for="node-input-GALightKelvinState" style="width:20px;">GA</label>
814
+ <input type="text" id="node-input-GALightKelvinState" placeholder="Ex: 1/1/1"
815
+ style="width:70px;margin-left: 5px; text-align: left;">
771
816
 
772
- <label for="node-input-nameLightColor" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
773
- <input type="text" id="node-input-nameLightColor" style="width:190px;margin-left: 5px; text-align: left;">
774
- </div>
775
- <div class="form-row">
776
- <label for="node-input-nameLightColorState" style="width:110px;"><i class="fa fa-play-circle-o"></i> Status</label>
817
+ <label for="node-input-dptLightKelvinState" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
818
+ <select id="node-input-dptLightKelvinState" style="width:140px;"></select>
777
819
 
778
- <label for="node-input-GALightColorState" style="width:20px;"><span data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
779
- <input type="text" id="node-input-GALightColorState" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
820
+ <label for="node-input-nameLightKelvinState" style="width:50px; margin-left: 0px; text-align: right;">Name</label>
821
+ <input type="text" id="node-input-nameLightKelvinState" style="width:190px;margin-left: 5px; text-align: left;">
822
+ </div>
823
+ </p>
824
+ </div>
825
+ <div id="tabs-4">
826
+ <p>
827
+ <div class="form-row">
828
+ <label for="node-input-nameLightColor" style="width:110px;"><i class="fa fa-play-circle-o"></i> Control</label>
829
+
830
+ <label for="node-input-GALightColor" style="width:20px;"><span
831
+ data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
832
+ <input type="text" id="node-input-GALightColor" placeholder="Ex: 1/1/1"
833
+ style="width:70px;margin-left: 5px; text-align: left;">
834
+
835
+ <label for="node-input-dptLightColor" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
836
+ <select id="node-input-dptLightColor" style="width:140px;"></select>
837
+
838
+ <label for="node-input-nameLightColor" style="width:50px; margin-left: 0px; text-align: right;"><span
839
+ data-i18n="knxUltimateHueLight.node-input-name"></span></label>
840
+ <input type="text" id="node-input-nameLightColor" style="width:190px;margin-left: 5px; text-align: left;">
841
+ </div>
842
+ <div class="form-row">
843
+ <label for="node-input-nameLightColorState" style="width:110px;"><i class="fa fa-play-circle-o"></i>
844
+ Status</label>
780
845
 
781
- <label for="node-input-dptLightColorState" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
782
- <select id="node-input-dptLightColorState" style="width:140px;"></select>
846
+ <label for="node-input-GALightColorState" style="width:20px;"><span
847
+ data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
848
+ <input type="text" id="node-input-GALightColorState" placeholder="Ex: 1/1/1"
849
+ style="width:70px;margin-left: 5px; text-align: left;">
783
850
 
784
- <label for="node-input-nameLightColorState" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
785
- <input type="text" id="node-input-nameLightColorState" style="width:190px;margin-left: 5px; text-align: left;">
786
- </div>
787
- </p>
788
- </div>
789
- <div id="tabs-5">
790
- <p>
791
- <div class="form-row">
792
- <label for="node-input-nameLightBlink" style="width:110px;"><i class="fa fa-play-circle-o"></i> Blink</label>
851
+ <label for="node-input-dptLightColorState" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
852
+ <select id="node-input-dptLightColorState" style="width:140px;"></select>
793
853
 
794
- <label for="node-input-GALightBlink" style="width:20px;"><span data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
795
- <input type="text" id="node-input-GALightBlink" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
854
+ <label for="node-input-nameLightColorState" style="width:50px; margin-left: 0px; text-align: right;"><span
855
+ data-i18n="knxUltimateHueLight.node-input-name"></span></label>
856
+ <input type="text" id="node-input-nameLightColorState" style="width:190px;margin-left: 5px; text-align: left;">
857
+ </div>
858
+ </p>
859
+ </div>
860
+ <div id="tabs-5">
861
+ <p>
862
+ <div class="form-row">
863
+ <label for="node-input-nameLightBlink" style="width:110px;"><i class="fa fa-play-circle-o"></i> Blink</label>
864
+
865
+ <label for="node-input-GALightBlink" style="width:20px;"><span
866
+ data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
867
+ <input type="text" id="node-input-GALightBlink" placeholder="Ex: 1/1/1"
868
+ style="width:70px;margin-left: 5px; text-align: left;">
869
+
870
+ <label for="node-input-dptLightBlink" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
871
+ <select id="node-input-dptLightBlink" style="width:140px;"></select>
872
+
873
+ <label for="node-input-nameLightBlink" style="width:50px; margin-left: 0px; text-align: right;"><span
874
+ data-i18n="knxUltimateHueLight.node-input-name"></span></label>
875
+ <input type="text" id="node-input-nameLightBlink" style="width:190px;margin-left: 5px; text-align: left;">
876
+ </div>
796
877
 
797
- <label for="node-input-dptLightBlink" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
798
- <select id="node-input-dptLightBlink" style="width:140px;"></select>
878
+ <div id="divColorCycle">
879
+ <div class="form-row">
880
+ <label for="node-input-nameLightColorCycle" style="width:110px;"><i class="fa fa-play-circle-o"></i> Color
881
+ Cycle</label>
799
882
 
800
- <label for="node-input-nameLightBlink" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
801
- <input type="text" id="node-input-nameLightBlink" style="width:190px;margin-left: 5px; text-align: left;">
802
- </div>
883
+ <label for="node-input-GALightColorCycle" style="width:20px;">GA</label>
884
+ <input type="text" id="node-input-GALightColorCycle" placeholder="Ex: 1/1/1"
885
+ style="width:70px;margin-left: 5px; text-align: left;">
803
886
 
804
- <div id="divColorCycle">
805
- <div class="form-row">
806
- <label for="node-input-nameLightColorCycle" style="width:110px;"><i class="fa fa-play-circle-o"></i> Color Cycle</label>
887
+ <label for="node-input-dptLightColorCycle" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
888
+ <select id="node-input-dptLightColorCycle" style="width:140px;"></select>
807
889
 
808
- <label for="node-input-GALightColorCycle" style="width:20px;">GA</label>
809
- <input type="text" id="node-input-GALightColorCycle" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
890
+ <label for="node-input-nameLightColorCycle" style="width:50px; margin-left: 0px; text-align: right;"><span
891
+ data-i18n="knxUltimateHueLight.node-input-name"></span></label>
892
+ <input type="text" id="node-input-nameLightColorCycle" style="width:190px;margin-left: 5px; text-align: left;">
893
+ </div>
894
+ </div>
895
+ </p>
896
+ </div>
897
+ <div id="tabs-6">
898
+ <p>
899
+ <div class="form-row">
900
+ <label style="width:260px;" for="node-input-readStatusAtStartup"><i class="fa fa-play-circle"></i> Read status at
901
+ startup</label>
902
+ <select id="node-input-readStatusAtStartup">
903
+ <option value="no">No</option>
904
+ <option value="yes">Yes, and emit KNX telegrams.</option>
905
+ </select>
906
+ </div>
907
+ <div class="form-row">
908
+ <label style="width:260px;" for="node-input-updateKNXBrightnessStatusOnHUEOnOff">
909
+ <i class="fa fa-tag"></i> KNX Brightness Status
910
+ </label>
911
+ <select id="node-input-updateKNXBrightnessStatusOnHUEOnOff">
912
+ <option value="onhueoff">When HUE light is Off, send 0% (Default KNX behaviour)</option>
913
+ <option value="no">Leave as is (default HUE behaviour)</option>
914
+ </select>
915
+ </div>
916
+ <div class="form-row">
917
+ <label for="node-input-specifySwitchOnBrightness" style="width:260px;">
918
+ <i class="fa fa-tag"></i> Switch on behaviour
919
+ </label>
920
+ <select id="node-input-specifySwitchOnBrightness">
921
+ <option value="temperature">Select temperature and brightness</option>
922
+ <option value="yes">Select color</option>
923
+ <option value="no">Last status</option>
924
+ </select>
925
+ </div>
810
926
 
811
- <label for="node-input-dptLightColorCycle" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
812
- <select id="node-input-dptLightColorCycle" style="width:140px;"></select>
927
+ <div class="form-row" id="divColorsAtSwitchOn">
928
+ <label for="node-input-colorAtSwitchOnDayTime" style="width:260px">
929
+ </label>
930
+ <input type="hidden" id="node-input-colorAtSwitchOnDayTime">
931
+ <input type="color" id="colorPickerDay" style="width:260px">
932
+ <button id="getColorAtSwitchOnDayTimeButton" type="button" class="red-ui-button">Get current</button>
933
+ </div>
934
+ <div class="form-row" id="divTemperatureAtSwitchOn" hidden>
935
+ <label for="node-input-colorAtSwitchOnDayTime" style="width:260px">
936
+ </label>
937
+ <select style="width:180px;" id="comboTemperatureAtSwitchOn"></select>
938
+ <select style="width:180px;" id="comboBrightnessAtSwitchOn"></select>
939
+ </div>
813
940
 
814
- <label for="node-input-nameLightColorCycle" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
815
- <input type="text" id="node-input-nameLightColorCycle" style="width:190px;margin-left: 5px; text-align: left;">
816
- </div>
817
- </div>
818
- </p>
941
+ <div id="divCCSBoxAtNightLighting">
942
+ <div class="form-row">
943
+ <label for="node-input-enableDayNightLighting" style="width:260px;">
944
+ <i class="fa fa-clone"></i> Night Lighting
945
+ </label>
946
+ <select id="node-input-enableDayNightLighting">
947
+ <option value="temperature">Select temperature and brightness</option>
948
+ <option value="yes">Select color</option>
949
+ <option value="no">Last status</option>
950
+ </select>
819
951
  </div>
820
- <div id="tabs-6">
821
- <p>
822
- <div class="form-row">
823
- <label style="width:260px;" for="node-input-readStatusAtStartup"><i class="fa fa-play-circle"></i> Read status at startup</label>
824
- <select id="node-input-readStatusAtStartup">
825
- <option value="no">No</option>
826
- <option value="yes">Yes, and emit KNX telegrams.</option>
827
- </select>
952
+
953
+ <div id="divEnableDayNightLighting">
954
+
955
+ <div class="form-row" id="divColorsAtSwitchOnNightTime">
956
+ <label for="node-input-colorAtSwitchOnNightTime" style="width:260px"></label>
957
+ <input type="hidden" id="node-input-colorAtSwitchOnNightTime">
958
+ <input type="color" id="colorPickerNight" style="width:260px">
959
+ <button id="getColorAtSwitchOnNightTimeButton" type="button" class="red-ui-button">Get current</button>
960
+ </div>
961
+ <div class="form-row" id="divTemperatureAtSwitchOnNightTime" hidden>
962
+ <label for="node-input-colorAtSwitchOnNightTime" style="width:260px"></label>
963
+ <select style="width:25%;" id="comboTemperatureAtSwitchOnNightTime"></select>
964
+ <select style="width:25%;" id="comboBrightnessAtSwitchOnNightTime"></select>
965
+ </div>
966
+
967
+ <div class="form-row">
968
+ <label for="node-input-nameDaylightSensor" style="width:110px;"><i class="fa fa-clock-o"></i>
969
+ Day/Night</label>
970
+ <label for="node-input-GADaylightSensor" style="width:20px;">GA</label>
971
+ <input type="text" id="node-input-GADaylightSensor" placeholder="Ex: 1/1/1"
972
+ style="width:70px;margin-left: 5px; text-align: left;">
973
+
974
+ <label for="node-input-dptDaylightSensor" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
975
+ <select id="node-input-dptDaylightSensor" style="width:140px;"></select>
976
+
977
+ <label for="node-input-nameDaylightSensor" style="width:50px; margin-left: 0px; text-align: right;"><span
978
+ data-i18n="knxUltimateHueLight.node-input-name"></span></label>
979
+ <input type="text" id="node-input-nameDaylightSensor" style="width:190px;margin-left: 5px; text-align: left;">
980
+ </div>
981
+ <div class="form-row">
982
+ <label style="width:170px" for="node-input-invertDayNight">
983
+ <i class="fa fa-shuffle"></i> Invert day/night values
984
+ </label>
985
+ <input type="checkbox" id="node-input-invertDayNight"
986
+ style="display:inline-block; width:auto; vertical-align:top;" />
828
987
  </div>
829
- <div class="form-row">
830
- <label style="width:260px;" for="node-input-updateKNXBrightnessStatusOnHUEOnOff">
831
- <i class="fa fa-tag"></i> KNX Brightness Status
832
- </label>
833
- <select id="node-input-updateKNXBrightnessStatusOnHUEOnOff">
834
- <option value="onhueoff">When HUE light is Off, send 0% (Default KNX behaviour)</option>
835
- <option value="no">Leave as is (default HUE behaviour)</option>
836
- </select>
837
- </div>
838
- <div class="form-row">
839
- <label for="node-input-specifySwitchOnBrightness" style="width:260px;">
840
- <i class="fa fa-tag"></i> Specify switch on brightness
841
- </label>
842
- <select id="node-input-specifySwitchOnBrightness">
843
- <option value="yes">Yes</option>
844
- <option value="no">No</option>
845
- </select>
846
- </div>
847
-
848
- <div class="form-row" id="divColorsAtSwitchOn">
849
- <label for="node-input-colorAtSwitchOnDayTime" style="width:260px">
850
- <i class="fa fa-sun-o"></i> Switch On - color/brightness
851
- </label>
852
- <input type="text" id="node-input-colorAtSwitchOnDayTime"
853
- placeholder='For example, {"red":255, "green":255, "blue":255}' style="width:260px">
854
- <button id="getColorAtSwitchOnDayTimeButton" type="button" class="red-ui-button">Get current</button>
855
- </div>
856
- <div id="divCCSBoxayNightLighting">
857
- <div class="form-row">
858
- <label for="node-input-enableDayNightLighting" style="width:260px;">
859
- <i class="fa fa-clone"></i> Night Lighting
860
- </label>
861
- <select id="node-input-enableDayNightLighting">
862
- <option value="yes">Yes</option>
863
- <option value="no">No</option>
864
- </select>
865
- </div>
866
- <div id="divEnableDayNightLighting">
867
- <div class="form-row">
868
- <label for="node-input-colorAtSwitchOnNightTime" style="width:260px">
869
- <i class="fa fa-moon-o"></i> Switch On color/brigh. at Night
870
- </label>
871
- <input type="text" id="node-input-colorAtSwitchOnNightTime"
872
- placeholder='Example {"red":100, "green":0, "blue":50}' style="width:260px">
873
- <button id="getColorAtSwitchOnNightTimeButton" type="button" class="red-ui-button">Get current</button>
874
- </div>
875
- <div class="form-row">
876
- <label for="node-input-nameDaylightSensor" style="width:110px;"><i class="fa fa-clock-o"></i>
877
- Day/Night</label>
878
- <label for="node-input-GADaylightSensor" style="width:20px;">GA</label>
879
- <input type="text" id="node-input-GADaylightSensor" placeholder="Ex: 1/1/1"
880
- style="width:70px;margin-left: 5px; text-align: left;">
881
-
882
- <label for="node-input-dptDaylightSensor"
883
- style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
884
- <select id="node-input-dptDaylightSensor" style="width:140px;"></select>
885
-
886
- <label for="node-input-nameDaylightSensor" style="width:50px; margin-left: 0px; text-align: right;"><span
887
- data-i18n="knxUltimateHueLight.node-input-name"></span></label>
888
- <input type="text" id="node-input-nameDaylightSensor"
889
- style="width:190px;margin-left: 5px; text-align: left;">
890
- </div>
891
- <div class="form-row">
892
- <label style="width:170px" for="node-input-invertDayNight">
893
- <i class="fa fa-shuffle"></i> Invert day/night values
894
- </label>
895
- <input type="checkbox" id="node-input-invertDayNight"
896
- style="display:inline-block; width:auto; vertical-align:top;" />
897
- </div>
898
- </div>
899
- </div>
900
- <br />
901
- <div class="form-row">
902
- <label for="node-input-dimSpeed" style="width:260px">
903
- <i class="fa fa-bolt"></i> Dim Speed (ms)
904
- </label>
905
- <input type="text" id="node-input-dimSpeed" placeholder='Default is 5000' style="width:260px">
906
- </div>
907
- <div class="form-row">
908
- <label for="node-input-minDimLevelLight" style="width:260px;">
909
- <i class="fa fa-clone"></i> Min Dim Brightness
910
- </label>
911
- <select id="node-input-minDimLevelLight">
912
- <option value="useHueLightLevel">Use minimum brightness specified in the HUE light</option>
913
- </select>
914
- </div>
915
- <div class="form-row">
916
- <label for="node-input-maxDimLevelLight" style="width:260px;">
917
- <i class="fa fa-clone"></i> Max Dim Brightness
918
- </label>
919
- <select id="node-input-maxDimLevelLight"></select>
920
- </div>
921
- <div class="form-row">
922
- <label for="node-input-enableNodePINS" style="width:260px;">
923
- <i class="fa fa-square-o"></i> Node Input/Output PINs
924
- </label>
925
- <select id="node-input-enableNodePINS">
926
- <option value="no">Hide</option>
927
- <option value="yes">Show node input/output PINs</option>
928
- </select>
929
- </div>
930
- </p>
931
988
  </div>
989
+ </div>
990
+ <br />
991
+ <div class="form-row">
992
+ <label for="node-input-dimSpeed" style="width:260px">
993
+ <i class="fa fa-bolt"></i> Dim Speed (ms)
994
+ </label>
995
+ <input type="text" id="node-input-dimSpeed" placeholder='Default is 5000' style="width:260px">
996
+ </div>
997
+ <div class="form-row">
998
+ <label for="node-input-minDimLevelLight" style="width:260px;">
999
+ <i class="fa fa-clone"></i> Min Dim Brightness
1000
+ </label>
1001
+ <select id="node-input-minDimLevelLight">
1002
+ <option value="useHueLightLevel">Use minimum brightness specified in the HUE light</option>
1003
+ </select>
1004
+ </div>
1005
+ <div class="form-row">
1006
+ <label for="node-input-maxDimLevelLight" style="width:260px;">
1007
+ <i class="fa fa-clone"></i> Max Dim Brightness
1008
+ </label>
1009
+ <select id="node-input-maxDimLevelLight"></select>
1010
+ </div>
1011
+ <div class="form-row">
1012
+ <label for="node-input-enableNodePINS" style="width:260px;">
1013
+ <i class="fa fa-square-o"></i> Node Input/Output PINs
1014
+ </label>
1015
+ <select id="node-input-enableNodePINS">
1016
+ <option value="no">Hide</option>
1017
+ <option value="yes">Show node input/output PINs</option>
1018
+ </select>
1019
+ </div>
1020
+ </p>
1021
+ </div>
932
1022
 
933
- <br/>
934
- </script>
1023
+ <br />
1024
+ </script>
935
1025
 
936
1026
  <script type="text/markdown" data-help-name="knxUltimateHueLight">
937
1027
  <p>This node lets you control your Philips HUE light and grouped lights and also gets the states of this lights, to be sent to the KNX bus.</p>
@@ -972,9 +1062,9 @@ Start typing in the GA field, the name or group address of your KNX device, the
972
1062
  |--|--|
973
1063
  | Control dim | Changes the HUE light's white temperature, using DPT 3.007 dimming. You can set the dimming speed in the **_Behaviour_** tab.|
974
1064
  | Control % | Changes the HUE light's white temperature, using the DPT 5.001. A value of 0 is full warm, a value of 100 is full cold.|
975
- | Control kelvin | Changes the HUE light's temperature in Kelvin degrees, using the DPT 7.600. |
1065
+ | Control kelvin | **DPT 7.600:** set the HUE light's temperature in Kelvin degrees, using the KNX range from 0 to 65536. This range will be then transformed in mirek.<br/>**DPT 9.002:** set the temperature using Philips HUE range: 2000K - 6535K (Ambiance range starts at 2200K). Please be aware, conversion may produce slightly changes in Kelvin degrees value, due to KNX RGB or Kelvin degrees to HUE mirek degrees conversion.|
976
1066
  | Status %| Link this to the light temperature status group address. Datapoint is 5.001 absolute value. 0 is full warm, 100 is full cold.|
977
- | Status kelvin | Link this to the light temperature status group address. Datapoint 7.600. |
1067
+ | Status kelvin | **DPT 7.600:** get the HUE light's temperature in Kelvin degrees, using the KNX range from 0 to 65536. This range will be then transformed in kelvin degrees.<br/>**DPT 9.002:** get the temperature using Philips HUE range: 2000K - 6535K (Ambiance range starts at 2200K). Please be aware, conversion may produce slightly changes in Kelvin degrees value, due to KNX RGB or Kelvin degrees to HUE mirek degrees conversion. |
978
1068
 
979
1069
  <br/>
980
1070
 
@@ -998,11 +1088,9 @@ Start typing in the GA field, the name or group address of your KNX device, the
998
1088
 
999
1089
  | Property | Description |
1000
1090
  | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1001
- | KNX Brightness Status | Updates the KNX brightness group address whenever the HUE lamp is switched ON/OFF. The options are `When HUE light is Off, send 0% (Default KNX behaviour)` and `Leave as is (default HUE behaviour)` |
1002
- | Specify switch on brightness | It enables the brightness value to follow the on/off status of the light. If you change the HUE brightness value to 0% (from the HUE App), an "off" telegram is also sent to the KNX bus; if you set it other than 0%, an "on" telegram is also sent to the KNX bus. This is valid also vice-versa: if you change the brightness via KNX bus, the HUE on/off value is also sent to the lamp. If you set it to **No**, the previous HUE light brightness value is retained. Default value is **Yes**. |
1003
- | Switch On - color/brightness | You can choose the color/brightness of your light, at switch on. Set it as JSON object, for example **{ "red": 255, "green": 255, "blue": 255 }** |
1091
+ | KNX Brightness Status | Updates the KNX brightness group address status, whenever the HUE lamp is switched ON/OFF. The options are **When HUE light is Off, send 0% (Default KNX behaviour)** and **Leave as is (default HUE behaviour)** |
1092
+ | Switch on behaviour | It sets the behaviour of your lights when switched on. You can choose from differents behaviours.<br/>**Select color:** the light will be switched on with the color of your choice.<br/>**Select temperature and brightness:** the light will be switched on with the temperature (Kelvin) and brightness (0-100) of your choice.<br>**Last status:** the light will be switched on in the last status. |
1004
1093
  | Night Lighting | It allows to set a particular light color/brightness at nighttime. If **checked**, a further set of option shows up and the light changes the behaviour based on these options, everytime you switch the light _on_. |
1005
- | Switch On - color/brightness at Nighttime | You can choose the color/brightness of your light, at switch on, on night time. Set it as JSON object. Default value if you leave blank is **{ "red": 100, "green": 0, "blue": 0 }** |
1006
1094
  | Day/Night | Select the group address used to set the day/night behaviour. The group address value is _true_ if daytime, _false_ if nighttime. |
1007
1095
  | Invert day/night values | Invert the values of _Day/Night_ group address. Default value is **unchecked**. |
1008
1096
  | Dim Speed (ms) | The dimming speed, in Milliseconds. This applies to the **light** and also to the **tunable white** dimming datapoints. It' calculated from 0% to 100%. |
@@ -1019,4 +1107,4 @@ The Dimming function works in **KNX mode `start` and `stop`**. To start dimming,
1019
1107
  [Find it useful?](https://www.paypal.me/techtoday)
1020
1108
 
1021
1109
  <br/>
1022
- </script>
1110
+ </script>-