node-red-contrib-knx-ultimate 2.2.6 → 2.2.10

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,24 +1,5 @@
1
1
  <script type="text/javascript">
2
- RED.events.on('nodes:add', function (node) {
3
- if (node.type === 'uibuilder') {
4
- // Keep a list of uib nodes in the editor
5
- // may be different to the deployed list
6
- editorInstances[node.id] = node.url
7
- // -- IF uibuilderInstances <> editorInstances THEN there are undeployed instances. --
8
- }
9
- })
10
- RED.events.on('nodes:change', function (node) {
11
- if (node.type === 'uibuilder') {
12
- mylog('nodes:change:', node)
13
- editorInstances[node.id] = node.url
14
- }
15
- })
16
- RED.events.on('nodes:remove', function (node) {
17
- if (node.type === 'uibuilder') {
18
- mylog('>> nodes:remove >>', node)
19
- delete editorInstances[node.id]
20
- }
21
- })
2
+
22
3
  RED.nodes.registerType("knxUltimateHueLight", {
23
4
  category: "KNX Ultimate",
24
5
  color: "#C0C7E9",
@@ -85,12 +66,24 @@
85
66
  GADaylightSensor: { value: "" },
86
67
  dptDaylightSensor: { value: "" },
87
68
 
69
+ nameLightKelvin: { value: "" },
70
+ GALightKelvin: { value: "" },
71
+ dptLightKelvin: { value: "" },
72
+
73
+ nameLightKelvinState: { value: "" },
74
+ GALightKelvinState: { value: "" },
75
+ dptLightKelvinState: { value: "" },
76
+
88
77
  specifySwitchOnBrightness: { value: "yes" },
89
78
  updateKNXBrightnessStatusOnHUEOnOff: { value: "no" },
90
79
  dimSpeed: { value: 5000, required: false },
91
80
  minDimLevelLight: { value: 10, required: false },
92
81
  maxDimLevelLight: { value: 100, required: false },
93
82
  readStatusAtStartup: { value: "yes" },
83
+ enableNodePINS: { value: "no" },
84
+
85
+ outputs: { value: 0 },
86
+ inputs: { value: 0 },
94
87
 
95
88
  hueDevice: { value: "" },
96
89
  },
@@ -105,46 +98,67 @@
105
98
  // enabled: function() {
106
99
  // // return whether or not the button is enabled, based on the current
107
100
  // // configuration of the node
108
- // return !this.changed
101
+ // return !node.changed
109
102
  // },
110
103
  // visible: function() {
111
104
  // // return whether or not the button is visible, based on the current
112
105
  // // configuration of the node
113
- // return this.hasButton
106
+ // return node.hasButton
114
107
  // },
115
108
  // //toggle: "buttonState",
116
109
  // onclick: function() {}
117
110
  // },
118
- oneditprepare: function () {
119
- var node = this;
120
- var oNodeServer = RED.nodes.node($("#node-input-server").val()); // Store the config-node
121
- var oNodeServerHue = RED.nodes.node($("#node-input-serverHue").val()); // Store the config-node
111
+ oneditprepare: prepareUI,
112
+ oneditsave: function () {
113
+ RED.sidebar.removeTab("tabNRColor");
114
+ RED.sidebar.show("help");
115
+ if ($("#node-input-enableNodePINS").val() === "yes") {
116
+ this.outputs = 1;
117
+ this.inputs = 1;
118
+ } else {
119
+ this.outputs = 0;
120
+ this.inputs = 0;
121
+ }
122
+ },
123
+ oneditcancel: function () {
124
+ RED.sidebar.removeTab("tabNRColor");
125
+ RED.sidebar.show("help");
126
+ }
127
+ });
122
128
 
123
- // Create the TAB in Node-Red
124
- // ####################################
125
- const content = `<html>
129
+
130
+ function prepareUI() {
131
+ var node = this;
132
+ var oNodeServer = RED.nodes.node($("#node-input-server").val()); // Store the config-node
133
+ var oNodeServerHue = RED.nodes.node($("#node-input-serverHue").val()); // Store the config-node
134
+
135
+ // Create the TAB in Node-Red
136
+ // ####################################
137
+ const content = `<html>
126
138
 
127
139
  <head>
128
140
  <div class="red-ui-sidebar-header">Color Selector</div>
129
141
  </head>
130
142
  <div style='position:relative;height:100%;margin:10px'>
131
- <p>Choose the desired color/temperature, copy the <b>Result RGB</b> text and paste it into the required fields.</p>
143
+ <p>Choose the desired color/temperature, then click <b>Apply</b></p>
132
144
  <div>
133
- <h3>Color</h3>
145
+ <h3>Color RGB</h3>
134
146
  <div id="colorPicker"></div>
135
147
  </div>
136
- </br>
148
+ </br>
149
+ <div>
150
+ <input style="width:100%" type="text" id="resultRGB">
151
+ <input type="hidden" id="tabNRColor_destinationTextbox">
152
+ </div>
153
+ </br>
137
154
  <div>
138
- <h3>Temperature</h3>
155
+ <h3>Temperature Kelvin</h3>
139
156
  <div id="kelvinPicker"></div>
140
157
  </div>
141
- </br>
158
+ </br>
142
159
  <div>
143
- <h3>Result RGB</h3>
144
- <div>
145
- <input style="width:100%" type="text" id="resultRGB">
146
- <input type="hidden" id="tabNRColor_destinationTextbox">
147
- </div>
160
+ <input style="width:100%" type="text" id="resultKelvin">
161
+ <input type="hidden" id="tabNRColor_destinationTextbox">
148
162
  </div>
149
163
  <div id="tabNRColor_divApplyCancel" hidden>
150
164
  <button id="tabNRColor_colorSelectorTABApplyTextButton" type="button" class="red-ui-button">Apply</button>
@@ -155,392 +169,407 @@
155
169
  </html>
156
170
  `;
157
171
 
158
- // COLOR BAR HANDLING ###########################
159
- RED.sidebar.addTab({
160
- id: "tabNRColor",
161
- label: "Color Picker",
162
- name: "Color Picker",
163
- iconClass: "fa fa-pencil",
164
- content: content,
165
- enableOnEdit: true,
166
- });
167
-
168
- // Temperature
169
- node.kelvinPicker = new iro.ColorPicker("#kelvinPicker", {
170
- width: 250,
171
- color: "rgb(255, 0, 0)",
172
- borderWidth: 1,
173
- borderColor: "#fff",
174
- layoutDirection: "vertical",
175
- layout: [
176
- {
177
- component: iro.ui.Slider,
178
- options: {
179
- sliderType: "kelvin",
180
- sliderSize: 20,
181
- },
172
+ // COLOR BAR HANDLING ###########################
173
+ RED.sidebar.addTab({
174
+ id: "tabNRColor",
175
+ label: "Color Picker",
176
+ name: "Color Picker",
177
+ iconClass: "fa fa-pencil",
178
+ content: content,
179
+ enableOnEdit: true,
180
+ });
181
+
182
+ // Temperature
183
+ this.kelvinPicker = new iro.ColorPicker("#kelvinPicker", {
184
+ width: 250,
185
+ color: "rgb(255, 0, 0)",
186
+ borderWidth: 1,
187
+ borderColor: "#fff",
188
+ layoutDirection: "vertical",
189
+ layout: [
190
+ {
191
+ component: iro.ui.Slider,
192
+ options: {
193
+ sliderType: "kelvin",
194
+ sliderSize: 20,
182
195
  },
183
- ],
184
- });
185
- // color:change callbacks receive the current color
186
- node.kelvinPicker.on("color:change", function (color) {
187
- const resultRGBForNode = '{"red": ' + color.rgb.r + ', "green": ' + color.rgb.g + ', "blue": ' + color.rgb.b + "}";
188
- $("#resultRGB").val(resultRGBForNode);
189
- });
196
+ },
197
+ ],
198
+ });
199
+ // color:change callbacks receive the current color
200
+ this.kelvinPicker.on("color:change", function (color) {
201
+ const resultRGBForNode = '{"red": ' + color.rgb.r + ', "green": ' + color.rgb.g + ', "blue": ' + color.rgb.b + "}";
202
+ $("#resultRGB").val(resultRGBForNode);
203
+ $("#resultKelvin").val(Math.round(color.kelvin, 0));
204
+ });
205
+
206
+ $("#resultKelvin").on("keyup", function () {
207
+ setIroColorKelvin();
208
+ });
209
+ function setIroColorKelvin() {
210
+ try {
211
+ const color = JSON.parse($("#resultKelvin").val());
212
+ this.kelvinPicker.color.setChannel("kelvin", color);
213
+ } catch (error) { }
214
+ }
190
215
 
191
- // Color
192
- node.colorPicker = new iro.ColorPicker("#colorPicker", {
193
- width: 250,
194
- color: "rgb(255, 0, 0)",
195
- borderWidth: 1,
196
- borderColor: "#fff",
197
- layout: [
198
- {
199
- component: iro.ui.Box,
200
- },
201
- {
202
- component: iro.ui.Slider,
203
- options: {
204
- id: "hue-slider",
205
- sliderType: "hue",
206
- },
216
+ // Color
217
+ this.colorPicker = new iro.ColorPicker("#colorPicker", {
218
+ width: 250,
219
+ color: "rgb(255, 0, 0)",
220
+ borderWidth: 1,
221
+ borderColor: "#fff",
222
+ layout: [
223
+ {
224
+ component: iro.ui.Box,
225
+ },
226
+ {
227
+ component: iro.ui.Slider,
228
+ options: {
229
+ id: "hue-slider",
230
+ sliderType: "hue",
207
231
  },
208
- ],
209
- });
210
- // color:change callbacks receive the current color
211
- node.colorPicker.on("color:change", function (color) {
212
- // Transform to compatible value for the node { "red": 255, "green": 255, "blue": 255 }
213
- const resultRGBForNode = '{"red": ' + color.rgb.r + ', "green": ' + color.rgb.g + ', "blue": ' + color.rgb.b + "}";
214
- $("#resultRGB").val(resultRGBForNode);
215
- });
216
- $("#resultRGB").on("keyup", function () {
217
- setIroColor();
218
- });
219
- function setIroColor() {
220
- try {
221
- const color = JSON.parse($("#resultRGB").val());
222
- node.colorPicker.color.setChannel("rgb", "r", color.red);
223
- node.colorPicker.color.setChannel("rgb", "g", color.green);
224
- node.colorPicker.color.setChannel("rgb", "b", color.blue);
225
- } catch (error) { }
226
- }
227
- // Copy to clipboard button
228
- $("#tabNRColor_colorSelectorTABApplyTextButton").on("click", function () {
229
- // const aa = $("#resultRGB").val()
230
- // navigator.clipboard.writeText(aa)
231
- const destTextBox = "#" + $("#tabNRColor_destinationTextbox").val();
232
- const resultRGB = $("#resultRGB").val();
232
+ },
233
+ ],
234
+ });
235
+ // color:change callbacks receive the current color
236
+ this.colorPicker.on("color:change", function (color) {
237
+ // Transform to compatible value for the node { "red": 255, "green": 255, "blue": 255 }
238
+ const resultRGBForNode = '{"red": ' + color.rgb.r + ', "green": ' + color.rgb.g + ', "blue": ' + color.rgb.b + "}";
239
+ $("#resultRGB").val(resultRGBForNode);
240
+ });
241
+
242
+ $("#resultRGB").on("keyup", function () {
243
+ setIroColor();
244
+ });
245
+ function setIroColor() {
246
+ try {
247
+ const color = JSON.parse($("#resultRGB").val());
248
+ this.colorPicker.color.setChannel("rgb", "r", color.red);
249
+ this.colorPicker.color.setChannel("rgb", "g", color.green);
250
+ this.colorPicker.color.setChannel("rgb", "b", color.blue);
251
+ } catch (error) { }
252
+ }
253
+ // Copy to clipboard button
254
+ $("#tabNRColor_colorSelectorTABApplyTextButton").on("click", function () {
255
+ // const aa = $("#resultRGB").val()
256
+ // navigator.clipboard.writeText(aa)
257
+ const destTextBox = "#" + $("#tabNRColor_destinationTextbox").val();
258
+ const resultRGB = $("#resultRGB").val();
259
+ const resultKelvin = node.kelvinPicker.colors[0].kelvin;
260
+ if (destTextBox === "#node-input-colorAtSwitchOnNightTime" || destTextBox === "#node-input-colorAtSwitchOnDayTime") {
233
261
  $(destTextBox).val(resultRGB);
234
- // Flash the destination control
235
- $(destTextBox).css("background-color", "lightgreen");
236
- $("#tabNRColor_divApplyCancel").hide();
237
- RED.sidebar.show("help");
238
- setTimeout(() => {
239
- $(destTextBox).css("background-color", "");
240
- }, 500);
241
- });
242
- $("#tabNRColor_colorSelectorTABCancelTextButton").on("click", function () {
243
- $("#tabNRColor_destinationTextbox").val("");
244
- RED.sidebar.show("help");
245
- $("#tabNRColor_divApplyCancel").hide();
246
- });
247
- $("#node-input-colorAtSwitchOnDayTime").on("focus", function () {
248
- RED.sidebar.show("tabNRColor"); // Node-Red custom color TAB
249
- $("#tabNRColor_destinationTextbox").val("node-input-colorAtSwitchOnDayTime");
250
- $("#tabNRColor_divApplyCancel").show();
251
- const color = $("#node-input-colorAtSwitchOnDayTime").val();
252
- $("#resultRGB").val(color);
253
- setIroColor();
254
- });
255
- // $("#node-input-colorAtSwitchOnDayTime").on("blur", function () {
256
- // RED.sidebar.show("help");
257
- // });
258
- $("#node-input-colorAtSwitchOnNightTime").on("focus", function () {
259
- RED.sidebar.show("tabNRColor"); // Node-Red custom color TAB
260
- $("#tabNRColor_destinationTextbox").val("node-input-colorAtSwitchOnNightTime");
261
- $("#tabNRColor_divApplyCancel").show();
262
- const color = $("#node-input-colorAtSwitchOnNightTime").val();
263
- $("#resultRGB").val(color);
264
- setIroColor();
265
- });
266
- // ####################################
267
-
268
- $("#tabs").tabs(); // Tabs gestione KNX
262
+ } else {
263
+ $(destTextBox).val(resultKelvin);
264
+ }
265
+ // Flash the destination control
266
+ $(destTextBox).css("background-color", "lightgreen");
267
+ $("#tabNRColor_divApplyCancel").hide();
268
+ RED.sidebar.show("help");
269
+ setTimeout(() => {
270
+ $(destTextBox).css("background-color", "");
271
+ }, 500);
272
+ });
273
+ $("#tabNRColor_colorSelectorTABCancelTextButton").on("click", function () {
274
+ $("#tabNRColor_destinationTextbox").val("");
275
+ RED.sidebar.show("help");
276
+ $("#tabNRColor_divApplyCancel").hide();
277
+ });
278
+ $("#node-input-colorAtSwitchOnDayTime").on("focus", function () {
279
+ RED.sidebar.show("tabNRColor"); // Node-Red custom color TAB
280
+ $("#tabNRColor_destinationTextbox").val("node-input-colorAtSwitchOnDayTime");
281
+ $("#tabNRColor_divApplyCancel").show();
282
+ const color = $("#node-input-colorAtSwitchOnDayTime").val();
283
+ $("#resultRGB").val(color);
284
+ setIroColor();
285
+ });
286
+ // $("#node-input-colorAtSwitchOnDayTime").on("blur", function () {
287
+ // RED.sidebar.show("help");
288
+ // });
289
+ $("#node-input-colorAtSwitchOnNightTime").on("focus", function () {
290
+ RED.sidebar.show("tabNRColor"); // Node-Red custom color TAB
291
+ $("#tabNRColor_destinationTextbox").val("node-input-colorAtSwitchOnNightTime");
292
+ $("#tabNRColor_divApplyCancel").show();
293
+ const color = $("#node-input-colorAtSwitchOnNightTime").val();
294
+ $("#resultRGB").val(color);
295
+ setIroColor();
296
+ });
297
+ // ####################################
298
+
299
+ $("#tabs").tabs(); // Tabs gestione KNX
300
+
301
+ // 19/02/2020 Used to get the server sooner als deploy.
302
+ $("#node-input-server").change(function () {
303
+ try {
304
+ oNodeServer = RED.nodes.node($(this).val());
305
+ } catch (error) { }
306
+ });
307
+ // 19/02/2020 Used to get the server sooner als deploy.
308
+ $("#node-input-serverHue").change(function () {
309
+ try {
310
+ oNodeServerHue = RED.nodes.node($(this).val());
311
+ } catch (error) { }
312
+ });
313
+
314
+ // 31/03/2020 Search Helper
315
+ function fullSearch(sourceText, searchString) {
316
+ // This searches for all words in a string
317
+ var aSearchWords = searchString.toLowerCase().split(" ");
318
+ var i = 0;
319
+ for (let index = 0; index < aSearchWords.length; index++) {
320
+ if (sourceText.toLowerCase().indexOf(aSearchWords[index]) > -1) i += 1;
321
+ }
322
+ return i == aSearchWords.length;
323
+ }
269
324
 
270
- // 19/02/2020 Used to get the server sooner als deploy.
271
- $("#node-input-server").change(function () {
272
- try {
273
- oNodeServer = RED.nodes.node($(this).val());
274
- } catch (error) { }
325
+ function getDPT(_dpt, _destinationWidget) {
326
+ // DPT Switch command
327
+ // ########################
328
+ $.getJSON("knxUltimateDpts", (data) => {
329
+ data.forEach((dpt) => {
330
+ if (dpt.value.startsWith(_dpt)) {
331
+ $(_destinationWidget).append($("<option></option>").attr("value", dpt.value).text(dpt.text));
332
+ }
333
+ });
334
+ // Eval
335
+ const format = "this." + _destinationWidget.replace("#node-input-", "");
336
+ $(_destinationWidget).val(eval(format).toString());
275
337
  });
276
- // 19/02/2020 Used to get the server sooner als deploy.
277
- $("#node-input-serverHue").change(function () {
278
- try {
279
- oNodeServerHue = RED.nodes.node($(this).val());
280
- } catch (error) { }
338
+ }
339
+
340
+ function getGroupAddress(_sourceWidgetAutocomplete, _destinationWidgetName, _destinationWidgetDPT, _additionalSearchTerm) {
341
+ $(_sourceWidgetAutocomplete).autocomplete({
342
+ minLength: 1,
343
+ source: function (request, response) {
344
+ //$.getJSON("csv", request, function( data, status, xhr ) {
345
+ $.getJSON("knxUltimatecsv?nodeID=" + oNodeServer.id, (data) => {
346
+ response(
347
+ $.map(data, function (value, key) {
348
+ var sSearch = value.ga + " (" + value.devicename + ") DPT" + value.dpt;
349
+ if (fullSearch(sSearch, request.term + _additionalSearchTerm)) {
350
+ return {
351
+ label: value.ga + " # " + value.devicename + " # " + value.dpt, // Label for Display
352
+ value: value.ga, // Value
353
+ };
354
+ } else {
355
+ return null;
356
+ }
357
+ })
358
+ );
359
+ });
360
+ },
361
+ select: function (event, ui) {
362
+ // Sets Datapoint and device name automatically
363
+ var sDevName = ui.item.label.split("#")[1].trim();
364
+ try {
365
+ sDevName = sDevName.substr(sDevName.indexOf(")") + 1).trim();
366
+ } catch (error) { }
367
+ $(_destinationWidgetName).val(sDevName);
368
+ var optVal = $(_destinationWidgetDPT + " option:contains('" + ui.item.label.split("#")[2].trim() + "')").attr("value");
369
+ // Select the option value
370
+ $(_destinationWidgetDPT).val(optVal);
371
+ },
281
372
  });
373
+ }
282
374
 
283
- // 31/03/2020 Search Helper
284
- function fullSearch(sourceText, searchString) {
285
- // This searches for all words in a string
286
- var aSearchWords = searchString.toLowerCase().split(" ");
287
- var i = 0;
288
- for (let index = 0; index < aSearchWords.length; index++) {
289
- if (sourceText.toLowerCase().indexOf(aSearchWords[index]) > -1) i += 1;
290
- }
291
- return i == aSearchWords.length;
292
- }
375
+ getDPT("1.", "#node-input-dptLightSwitch");
376
+ getGroupAddress("#node-input-GALightSwitch", "#node-input-nameLightSwitch", "#node-input-dptLightSwitch", " 1.");
293
377
 
294
- function getDPT(_dpt, _destinationWidget) {
295
- // DPT Switch command
296
- // ########################
297
- $.getJSON("knxUltimateDpts", (data) => {
298
- data.forEach((dpt) => {
299
- if (dpt.value.startsWith(_dpt)) {
300
- $(_destinationWidget).append($("<option></option>").attr("value", dpt.value).text(dpt.text));
301
- }
302
- });
303
- // Eval
304
- const format = "node." + _destinationWidget.replace("#node-input-", "");
305
- $(_destinationWidget).val(eval(format).toString());
306
- });
307
- }
378
+ getDPT("1.", "#node-input-dptLightState");
379
+ getGroupAddress("#node-input-GALightState", "#node-input-nameLightState", "#node-input-dptLightState", " 1.");
308
380
 
309
- function getGroupAddress(_sourceWidgetAutocomplete, _destinationWidgetName, _destinationWidgetDPT, _additionalSearchTerm) {
310
- $(_sourceWidgetAutocomplete).autocomplete({
311
- minLength: 1,
312
- source: function (request, response) {
313
- //$.getJSON("csv", request, function( data, status, xhr ) {
314
- $.getJSON("knxUltimatecsv?nodeID=" + oNodeServer.id, (data) => {
315
- response(
316
- $.map(data, function (value, key) {
317
- var sSearch = value.ga + " (" + value.devicename + ") DPT" + value.dpt;
318
- if (fullSearch(sSearch, request.term + _additionalSearchTerm)) {
319
- return {
320
- label: value.ga + " # " + value.devicename + " # " + value.dpt, // Label for Display
321
- value: value.ga, // Value
322
- };
323
- } else {
324
- return null;
325
- }
326
- })
327
- );
328
- });
329
- },
330
- select: function (event, ui) {
331
- // Sets Datapoint and device name automatically
332
- var sDevName = ui.item.label.split("#")[1].trim();
333
- try {
334
- sDevName = sDevName.substr(sDevName.indexOf(")") + 1).trim();
335
- } catch (error) { }
336
- $(_destinationWidgetName).val(sDevName);
337
- var optVal = $(_destinationWidgetDPT + " option:contains('" + ui.item.label.split("#")[2].trim() + "')").attr("value");
338
- // Select the option value
339
- $(_destinationWidgetDPT).val(optVal);
340
- },
341
- });
342
- }
381
+ getDPT("3.007", "#node-input-dptLightDIM");
382
+ getGroupAddress("#node-input-GALightDIM", "#node-input-nameLightDIM", "#node-input-dptLightDIM", " 3.007");
383
+
384
+ getDPT("5.001", "#node-input-dptLightBrightness");
385
+ getGroupAddress("#node-input-GALightBrightness", "#node-input-nameLightBrightness", "#node-input-dptLightBrightness", " 5.001");
343
386
 
344
- getDPT("1.", "#node-input-dptLightSwitch");
345
- getGroupAddress("#node-input-GALightSwitch", "#node-input-nameLightSwitch", "#node-input-dptLightSwitch", " 1.");
387
+ getDPT("5.001", "#node-input-dptLightBrightnessState");
388
+ getGroupAddress("#node-input-GALightBrightnessState", "#node-input-nameLightBrightnessState", "#node-input-dptLightBrightnessState", " 5.001");
346
389
 
347
- getDPT("1.", "#node-input-dptLightState");
348
- getGroupAddress("#node-input-GALightState", "#node-input-nameLightState", "#node-input-dptLightState", " 1.");
390
+ getDPT("232.600", "#node-input-dptLightColor");
391
+ getGroupAddress("#node-input-GALightColor", "#node-input-nameLightColor", "#node-input-dptLightColor", " 232.600");
349
392
 
350
- getDPT("3.007", "#node-input-dptLightDIM");
351
- getGroupAddress("#node-input-GALightDIM", "#node-input-nameLightDIM", "#node-input-dptLightDIM", " 3.007");
393
+ getDPT("232.600", "#node-input-dptLightColorState");
394
+ getGroupAddress("#node-input-GALightColorState", "#node-input-nameLightColorState", "#node-input-dptLightColorState", " 232.600");
352
395
 
353
- getDPT("5.001", "#node-input-dptLightBrightness");
354
- getGroupAddress("#node-input-GALightBrightness", "#node-input-nameLightBrightness", "#node-input-dptLightBrightness", " 5.001");
396
+ getDPT("3.007", "#node-input-dptLightHSV");
397
+ getGroupAddress("#node-input-GALightHSV", "#node-input-nameLightHSV", "#node-input-dptLightHSV", " 3.007");
355
398
 
356
- getDPT("5.001", "#node-input-dptLightBrightnessState");
357
- getGroupAddress("#node-input-GALightBrightnessState", "#node-input-nameLightBrightnessState", "#node-input-dptLightBrightnessState", " 5.001");
399
+ getDPT("5.001", "#node-input-dptLightHSVPercentage");
400
+ getGroupAddress("#node-input-GALightHSVPercentage", "#node-input-nameLightHSVPercentage", "#node-input-dptLightHSVPercentage", " 5.001");
358
401
 
359
- getDPT("232.600", "#node-input-dptLightColor");
360
- getGroupAddress("#node-input-GALightColor", "#node-input-nameLightColor", "#node-input-dptLightColor", " 232.600");
402
+ getDPT("5.001", "#node-input-dptLightHSVState");
403
+ getGroupAddress("#node-input-GALightHSVState", "#node-input-nameLightHSVState", "#node-input-dptLightHSVState", " 5.001");
361
404
 
362
- getDPT("232.600", "#node-input-dptLightColorState");
363
- getGroupAddress("#node-input-GALightColorState", "#node-input-nameLightColorState", "#node-input-dptLightColorState", " 232.600");
405
+ getDPT("1.", "#node-input-dptLightBlink");
406
+ getGroupAddress("#node-input-GALightBlink", "#node-input-nameLightBlink", "#node-input-dptLightBlink", " 1.");
364
407
 
365
- getDPT("3.007", "#node-input-dptLightHSV");
366
- getGroupAddress("#node-input-GALightHSV", "#node-input-nameLightHSV", "#node-input-dptLightHSV", " 3.007");
408
+ getDPT("1.", "#node-input-dptLightColorCycle");
409
+ getGroupAddress("#node-input-GALightColorCycle", "#node-input-nameLightColorCycle", "#node-input-dptLightColorCycle", " 1.");
367
410
 
368
- getDPT("5.001", "#node-input-dptLightHSVPercentage");
369
- getGroupAddress("#node-input-GALightHSVPercentage", "#node-input-nameLightHSVPercentage", "#node-input-dptLightHSVPercentage", " 5.001");
411
+ getDPT("1.", "#node-input-dptDaylightSensor");
412
+ getGroupAddress("#node-input-GADaylightSensor", "#node-input-nameDaylightSensor", "#node-input-dptDaylightSensor", " 1.");
370
413
 
371
- getDPT("5.001", "#node-input-dptLightHSVState");
372
- getGroupAddress("#node-input-GALightHSVState", "#node-input-nameLightHSVState", "#node-input-dptLightHSVState", " 5.001");
414
+ getDPT("7.600", "#node-input-dptLightKelvin");
415
+ getGroupAddress("#node-input-GALightKelvin", "#node-input-nameLightKelvin", "#node-input-dptLightKelvin", " 7.600");
373
416
 
374
- getDPT("1.", "#node-input-dptLightBlink");
375
- getGroupAddress("#node-input-GALightBlink", "#node-input-nameLightBlink", "#node-input-dptLightBlink", " 1.");
417
+ getDPT("7.600", "#node-input-dptLightKelvinState");
418
+ getGroupAddress("#node-input-GALightKelvinState", "#node-input-nameLightKelvinState", "#node-input-dptLightKelvinState", " 7.600");
376
419
 
377
- getDPT("1.", "#node-input-dptLightColorCycle");
378
- getGroupAddress("#node-input-GALightColorCycle", "#node-input-nameLightColorCycle", "#node-input-dptLightColorCycle", " 1.");
379
420
 
380
- getDPT("1.", "#node-input-dptDaylightSensor");
381
- getGroupAddress("#node-input-GADaylightSensor", "#node-input-nameDaylightSensor", "#node-input-dptDaylightSensor", " 1.");
421
+ // Show/Hide and enable/disable day/night Lighting behaviour
422
+ if (this.enableDayNightLighting === "yes") {
423
+ $("#divEnableDayNightLighting").show();
424
+ $("#divCCSBoxayNightLighting").css({ border: "1px solid dimgrey", "border-radius": "12px", padding: "5px" }); // Add little box to better understand the property page
425
+ } else {
426
+ $("#divEnableDayNightLighting").hide();
427
+ $("#divCCSBoxayNightLighting").css({ border: "", "border-radius": "", padding: "" });
428
+ }
382
429
 
383
- // Show/Hide and enable/disable day/night Lighting behaviour
384
- if (this.enableDayNightLighting === "yes") {
430
+ $("#node-input-enableDayNightLighting").on("change", function () {
431
+ if ($("#node-input-enableDayNightLighting").val() === "yes") {
385
432
  $("#divEnableDayNightLighting").show();
386
433
  $("#divCCSBoxayNightLighting").css({ border: "1px solid dimgrey", "border-radius": "12px", padding: "5px" }); // Add little box to better understand the property page
387
434
  } else {
388
435
  $("#divEnableDayNightLighting").hide();
389
436
  $("#divCCSBoxayNightLighting").css({ border: "", "border-radius": "", padding: "" });
390
437
  }
438
+ });
439
+
440
+ // Show/Hide the div of the color at swich on
441
+ if (this.specifySwitchOnBrightness === "yes") {
442
+ $("#divColorsAtSwitchOn").show();
443
+ } else {
444
+ $("#divColorsAtSwitchOn").hide();
445
+ $("#node-input-colorAtSwitchOnDayTime").val("");
446
+ }
391
447
 
392
- $("#node-input-enableDayNightLighting").on("change", function () {
393
- if ($("#node-input-enableDayNightLighting").val() === "yes") {
394
- $("#divEnableDayNightLighting").show();
395
- $("#divCCSBoxayNightLighting").css({ border: "1px solid dimgrey", "border-radius": "12px", padding: "5px" }); // Add little box to better understand the property page
396
- } else {
397
- $("#divEnableDayNightLighting").hide();
398
- $("#divCCSBoxayNightLighting").css({ border: "", "border-radius": "", padding: "" });
399
- }
400
- });
401
-
402
- // Show/Hide the div of the color at swich on
403
- if (this.specifySwitchOnBrightness === "yes") {
448
+ $("#node-input-specifySwitchOnBrightness").on("change", function () {
449
+ if ($("#node-input-specifySwitchOnBrightness").val() === "yes") {
404
450
  $("#divColorsAtSwitchOn").show();
451
+ if ($("#node-input-colorAtSwitchOnDayTime").val() === "") $("#node-input-colorAtSwitchOnDayTime").val('{ "red": 255, "green": 255, "blue": 255 }');
405
452
  } else {
406
453
  $("#divColorsAtSwitchOn").hide();
407
454
  $("#node-input-colorAtSwitchOnDayTime").val("");
408
455
  }
409
-
410
- $("#node-input-specifySwitchOnBrightness").on("change", function () {
411
- if ($("#node-input-specifySwitchOnBrightness").val() === "yes") {
412
- $("#divColorsAtSwitchOn").show();
413
- if ($("#node-input-colorAtSwitchOnDayTime").val() === "") $("#node-input-colorAtSwitchOnDayTime").val('{ "red": 255, "green": 255, "blue": 255 }');
456
+ });
457
+
458
+ // Autocomplete suggestion with HUE Lights
459
+ $("#node-input-name").autocomplete({
460
+ minLength: 1,
461
+ source: function (request, response) {
462
+ $.getJSON("KNXUltimateGetResourcesHUE?rtype=light&nodeID=" + oNodeServerHue.id, (data) => {
463
+ response(
464
+ $.map(data.devices, function (value, key) {
465
+ //alert(JSON.stringify(value) + " "+ key)
466
+ var sSearch = value.name;
467
+ if (fullSearch(sSearch, request.term)) {
468
+ return {
469
+ hueDevice: value.id,
470
+ value: value.name,
471
+ };
472
+ } else {
473
+ return null;
474
+ }
475
+ })
476
+ );
477
+ });
478
+ },
479
+ select: function (event, ui) {
480
+ // Distinguish between group of lights an single light.
481
+ if (ui.item.value.toLowerCase().startsWith("grouped_light")) {
482
+ $("#node-input-hueDevice").val(ui.item.hueDevice + "#grouped_light");
483
+ $("#getColorAtSwitchOnDayTimeButton").hide();
484
+ $("#getColorAtSwitchOnNightTimeButton").hide();
414
485
  } else {
415
- $("#divColorsAtSwitchOn").hide();
416
- $("#node-input-colorAtSwitchOnDayTime").val("");
486
+ $("#node-input-hueDevice").val(ui.item.hueDevice + "#light");
487
+ $("#getColorAtSwitchOnDayTimeButton").show();
488
+ $("#getColorAtSwitchOnNightTimeButton").show();
417
489
  }
418
- });
419
-
420
- // Autocomplete suggestion with HUE Lights
421
- $("#node-input-name").autocomplete({
422
- minLength: 1,
423
- source: function (request, response) {
424
- $.getJSON("KNXUltimateGetResourcesHUE?rtype=light&nodeID=" + oNodeServerHue.id, (data) => {
425
- response(
426
- $.map(data.devices, function (value, key) {
427
- //alert(JSON.stringify(value) + " "+ key)
428
- var sSearch = value.name;
429
- if (fullSearch(sSearch, request.term)) {
430
- return {
431
- hueDevice: value.id,
432
- value: value.name,
433
- };
434
- } else {
435
- return null;
436
- }
437
- })
438
- );
439
- });
440
- },
441
- select: function (event, ui) {
442
- // Distinguish between group of lights an single light.
443
- if (ui.item.value.toLowerCase().startsWith("grouped_light")) {
444
- $("#node-input-hueDevice").val(ui.item.hueDevice + "#grouped_light");
490
+ $("#tabs").show();
491
+ },
492
+ });
493
+
494
+ // Get the HUE capabilities to enable/disable UI parts
495
+ $.getJSON("KNXUltimateGetResourcesHUE?rtype=light&nodeID=" + oNodeServerHue.id, (data) => {
496
+ data.devices.forEach((element) => {
497
+ if (element.id === this.hueDevice.split("#")[0] && element.deviceObject !== undefined) {
498
+ // Check dimming
499
+ if (element.deviceObject.dimming === undefined) {
500
+ $("#tabs").tabs("disable", "#tabs-2");
501
+ $("#divColorsAtSwitchOn").hide();
502
+ $("#divColorCycle").hide();
503
+ }
504
+ // Check color
505
+ if (element.deviceObject.color_temperature === undefined) $("#tabs").tabs("disable", "#tabs-3");
506
+ if (element.deviceObject.color === undefined) {
507
+ $("#tabs").tabs("disable", "#tabs-4");
508
+ $("#divColorsAtSwitchOn").hide();
509
+ $("#divColorCycle").hide();
510
+ }
511
+ // Check if grouped, to hide/show the "Get current" buttons
512
+ if (element.deviceObject.type === "grouped_light") {
445
513
  $("#getColorAtSwitchOnDayTimeButton").hide();
446
514
  $("#getColorAtSwitchOnNightTimeButton").hide();
447
515
  } else {
448
- $("#node-input-hueDevice").val(ui.item.hueDevice + "#light");
449
516
  $("#getColorAtSwitchOnDayTimeButton").show();
450
517
  $("#getColorAtSwitchOnNightTimeButton").show();
451
518
  }
452
- $("#tabs").show();
453
- },
454
- });
455
-
456
- // Get the HUE capabilities to enable/disable UI parts
457
- $.getJSON("KNXUltimateGetResourcesHUE?rtype=light&nodeID=" + oNodeServerHue.id, (data) => {
458
- data.devices.forEach((element) => {
459
- if (element.id === this.hueDevice.split("#")[0] && element.deviceObject !== undefined) {
460
- // Check dimming
461
- if (element.deviceObject.dimming === undefined) {
462
- $("#tabs").tabs("disable", "#tabs-2");
463
- $("#divColorsAtSwitchOn").hide();
464
- $("#divColorCycle").hide();
465
- }
466
- // Check color
467
- if (element.deviceObject.color_temperature === undefined) $("#tabs").tabs("disable", "#tabs-3");
468
- if (element.deviceObject.color === undefined) {
469
- $("#tabs").tabs("disable", "#tabs-4");
470
- $("#divColorsAtSwitchOn").hide();
471
- $("#divColorCycle").hide();
472
- }
473
- // Check if grouped, to hide/show the "Get current" buttons
474
- if (element.deviceObject.type === "grouped_light") {
475
- $("#getColorAtSwitchOnDayTimeButton").hide();
476
- $("#getColorAtSwitchOnNightTimeButton").hide();
477
- } else {
478
- $("#getColorAtSwitchOnDayTimeButton").show();
479
- $("#getColorAtSwitchOnNightTimeButton").show();
480
- }
481
- return;
482
- }
483
- });
519
+ return;
520
+ }
484
521
  });
522
+ });
485
523
 
486
- $("#getColorAtSwitchOnDayTimeButton").on("click", function () {
487
- // Get the HUE capabilities to enable/disable UI parts
488
- $("#getColorAtSwitchOnDayTimeButton").text("Wait...");
489
- $.getJSON("knxUltimateGetHueColor?id=" + $("#node-input-hueDevice").val().split("#")[0], (data) => {
490
- $("#node-input-colorAtSwitchOnDayTime").val(data.toString());
491
- $("#node-input-colorAtSwitchOnDayTime").css("background-color", "lightgreen");
492
- setTimeout(() => {
493
- $("#node-input-colorAtSwitchOnDayTime").css("background-color", "");
494
- }, 500);
495
- $("#getColorAtSwitchOnDayTimeButton").text("Get current");
496
- });
524
+ $("#getColorAtSwitchOnDayTimeButton").on("click", function () {
525
+ $("#getColorAtSwitchOnDayTimeButton").text("Wait...");
526
+ $.getJSON("knxUltimateGetHueColor?id=" + $("#node-input-hueDevice").val().split("#")[0], (data) => {
527
+ $("#node-input-colorAtSwitchOnDayTime").val(data.toString());
528
+ $("#node-input-colorAtSwitchOnDayTime").css("background-color", "lightgreen");
529
+ setTimeout(() => {
530
+ $("#node-input-colorAtSwitchOnDayTime").css("background-color", "");
531
+ }, 500);
532
+ $("#getColorAtSwitchOnDayTimeButton").text("Get current");
497
533
  });
498
- $("#getColorAtSwitchOnNightTimeButton").on("click", function () {
499
- // Get the HUE capabilities to enable/disable UI parts
500
- $("#getColorAtSwitchOnNightTimeButton").text("Wait...");
501
- $.getJSON("knxUltimateGetHueColor?id=" + $("#node-input-hueDevice").val().split("#")[0], (data) => {
502
- $("#node-input-colorAtSwitchOnNightTime").val(data.toString());
503
- $("#node-input-colorAtSwitchOnNightTime").css("background-color", "lightgreen");
504
- setTimeout(() => {
505
- $("#node-input-colorAtSwitchOnNightTime").css("background-color", "");
506
- }, 500);
507
- $("#getColorAtSwitchOnNightTimeButton").text("Get current");
508
- });
534
+ });
535
+ $("#getColorAtSwitchOnNightTimeButton").on("click", function () {
536
+ $("#getColorAtSwitchOnNightTimeButton").text("Wait...");
537
+ $.getJSON("knxUltimateGetHueColor?id=" + $("#node-input-hueDevice").val().split("#")[0], (data) => {
538
+ $("#node-input-colorAtSwitchOnNightTime").val(data.toString());
539
+ $("#node-input-colorAtSwitchOnNightTime").css("background-color", "lightgreen");
540
+ setTimeout(() => {
541
+ $("#node-input-colorAtSwitchOnNightTime").css("background-color", "");
542
+ }, 500);
543
+ $("#getColorAtSwitchOnNightTimeButton").text("Get current");
509
544
  });
545
+ });
510
546
 
511
- // Fill options for minDimLevel and maxDimLevel
512
- for (let index = 0; index <= 90; index++) {
513
- if (index === 0) {
514
- $("#node-input-minDimLevelLight").append($("<option>").val(index).text(index.toString() + "% (Switch Off)"));
515
- } else {
516
- $("#node-input-minDimLevelLight").append($("<option>").val(index).text(index.toString() + "%"));
517
- }
518
-
519
- }
520
- $("#node-input-minDimLevelLight").val(node.minDimLevelLight);
521
- for (let index = 100; index >= 10; index--) {
522
- $("#node-input-maxDimLevelLight").append(
523
- $("<option>")
524
- .val(index)
525
- .text(index.toString() + "%")
526
- );
547
+ // Fill options for minDimLevel and maxDimLevel
548
+ for (let index = 0; index <= 90; index++) {
549
+ if (index === 0) {
550
+ $("#node-input-minDimLevelLight").append($("<option>").val(index).text(index.toString() + "% (Switch Off)"));
551
+ } else {
552
+ $("#node-input-minDimLevelLight").append($("<option>").val(index).text(index.toString() + "%"));
527
553
  }
528
- $("#node-input-maxDimLevelLight").val(node.maxDimLevelLight);
529
554
 
530
- if (this.hueDevice !== "") $("#tabs").show();
531
- },
532
- oneditsave: function () {
533
- RED.sidebar.removeTab("tabNRColor");
534
- RED.sidebar.show("help");
535
- },
536
- oneditcancel: function () {
537
- RED.sidebar.removeTab("tabNRColor");
538
- RED.sidebar.show("help");
539
- },
540
- });
555
+ }
556
+ $("#node-input-minDimLevelLight").val(this.minDimLevelLight);
557
+ for (let index = 100; index >= 10; index--) {
558
+ $("#node-input-maxDimLevelLight").append(
559
+ $("<option>")
560
+ .val(index)
561
+ .text(index.toString() + "%")
562
+ );
563
+ }
564
+ $("#node-input-maxDimLevelLight").val(this.maxDimLevelLight);
565
+
566
+ if (this.hueDevice !== "") $("#tabs").show();
567
+
568
+ }
569
+
541
570
  </script>
542
- <script src="https://kit.fontawesome.com/11f26b4500.js" crossorigin="anonymous"></script>
543
- <script src="https://cdn.jsdelivr.net/npm/@jaames/iro@5"></script>
571
+ <script src="http://localhost:1880/resources/node-red-contrib-knx-ultimate/11f26b4500.js"></script>
572
+ <script src="http://localhost:1880/resources/node-red-contrib-knx-ultimate/iro@5"></script>
544
573
 
545
574
  <script type="text/html" data-template-name="knxUltimateHueLight">
546
575
 
@@ -665,43 +694,68 @@
665
694
  </div>
666
695
  <div id="tabs-3">
667
696
  <p>
668
- <div class="form-row">
669
- <label for="node-input-nameLightHSV" style="width:110px;"><i class="fa fa-play-circle-o"></i> Control</label>
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>
670
699
 
671
- <label for="node-input-GALightHSV" style="width:20px;">GA</label>
672
- <input type="text" id="node-input-GALightHSV" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
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;">
673
702
 
674
- <label for="node-input-dptLightHSV" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
675
- <select id="node-input-dptLightHSV" style="width:140px;"></select>
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>
676
705
 
677
- <label for="node-input-nameLightHSV" style="width:50px; margin-left: 0px; text-align: right;">Name</label>
678
- <input type="text" id="node-input-nameLightHSV" style="width:190px;margin-left: 5px; text-align: left;">
679
- </div>
680
- <div class="form-row">
681
- <label for="node-input-nameLightHSVPercentage" style="width:110px;"><i class="fa fa-play-circle-o"></i> Control %</label>
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>
682
724
 
683
- <label for="node-input-GALightHSVPercentage" style="width:20px;">GA</label>
684
- <input type="text" id="node-input-GALightHSVPercentage" placeholder="Ex: 1/1/1"
725
+ <label for="node-input-GALightKelvin" style="width:20px;">GA</label>
726
+ <input type="text" id="node-input-GALightKelvin" placeholder="Ex: 1/1/1"
685
727
  style="width:70px;margin-left: 5px; text-align: left;">
686
728
 
687
- <label for="node-input-dptLightHSVPercentage" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
688
- <select id="node-input-dptLightHSVPercentage" style="width:140px;"></select>
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>
689
731
 
690
- <label for="node-input-nameLightHSVPercentage" style="width:50px; margin-left: 0px; text-align: right;">Name</label>
691
- <input type="text" id="node-input-nameLightHSVPercentage" style="width:190px;margin-left: 5px; text-align: left;">
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;">
692
734
  </div>
693
- <div class="form-row">
694
- <label for="node-input-nameLightHSVState" style="width:110px;"><i class="fa fa-play-circle-o"></i> Status</label>
735
+ <div class="form-row">
736
+ <label for="node-input-nameLightHSVState" style="width:110px;"><i class="fa fa-play-circle-o"></i> Status %</label>
695
737
 
696
- <label for="node-input-GALightHSVState" style="width:20px;"><span data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
697
- <input type="text" id="node-input-GALightHSVState" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
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;">
698
740
 
699
- <label for="node-input-dptLightHSVState" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
700
- <select id="node-input-dptLightHSVState" style="width:140px;"></select>
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>
701
743
 
702
- <label for="node-input-nameLightHSVState" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
703
- <input type="text" id="node-input-nameLightHSVState" style="width:190px;margin-left: 5px; text-align: left;">
704
- </div>
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>
705
759
  </p>
706
760
  </div>
707
761
  <div id="tabs-4">
@@ -863,7 +917,16 @@
863
917
  <i class="fa fa-clone"></i> Max Dim Brightness
864
918
  </label>
865
919
  <select id="node-input-maxDimLevelLight"></select>
866
- </div>
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>
867
930
  </p>
868
931
  </div>
869
932
 
@@ -871,87 +934,89 @@
871
934
  </script>
872
935
 
873
936
  <script type="text/markdown" data-help-name="knxUltimateHueLight">
874
- <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>
875
-
876
- **General**
877
- |Property|Description|
878
- |--|--|
879
- | KNX GW | Select the KNX gateway to be used |
880
- | HUE Bridge | Select the HUE Bridge to be used |
881
- | Name | HUE light or HUE grouped light to be used. The avaiable lights and groups start showing up while you're typing.|
882
-
883
- <br/>
884
-
885
- **OPTIONS**
886
-
887
- Here you can choose the KNX addresses to be linked to the avaiable HUE light commands/states.<br/>
888
- Start typing in the GA field, the name or group address of your KNX device, the avaiable devices start showing up while you're typing.
889
-
890
- **Switching**
891
- |Property|Description|
892
- |--|--|
893
- | Control | This GA is used to turn on/off the HUE light via a boolean KNX value true/false|
894
- | Status | Link this to the light's switch status group address|
895
-
896
- <br/>
897
-
898
- **Dim/Brightness**
899
- |Property|Description|
900
- |--|--|
901
- | Control | Relative DIM the HUE light. You can set the dimming speed in the **_Behaviour_** tab. |
902
- | Control % | Changes the absolute HUE light's brightness (0-100%)|
903
- | Status| Link this to the light's brightness status group address |
904
-
905
- <br/>
906
-
907
- **Tunable white**
908
- |Property|Description|
909
- |--|--|
910
- | Control| Changes the HUE light's white temperature, using DPT 3.007 dimming. You can set the dimming speed in the **_Behaviour_** tab.|
911
- | 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.|
912
- | Status | Link this to the light temperature status group address. Datapoint is 5.001 absolute value. 0 is full warm, 100 is full cold.|
913
-
914
- <br/>
915
-
916
- **Colors**
917
- |Property|Description|
918
- |--|--|
919
- | Control | This command is used to change the HUE light's color. Accepted datapoint is RGB triplet (r,g,b). The node handles the gamut color correction. As soon as you send a color KNX telegran, the light turns on and sets color and brightness, derived from the brightness human perception. As soon as you send a KNX telegram with r,g,b set to zero, the light turns off |
920
- | Status | Link this to the light's color status group address. Accepted datapoint is RGB triplet (r,g,b)|
921
-
922
- <br/>
923
-
924
- **Effects**
925
- |Property|Description|
926
- |--|--|
927
- | Blink | _true_ Blink the light, _false_ Stop blinking. Blinks the light on and off. Useful for signalling. Works with all HUE lights. |
928
- | Color Cycle | _true_ start cycle, _false_ Stop cycle. Randomly changes the HUE light's color at regular interval. Works with all HUE lights having color capabilities. The color effect will start 10 seconds after set. |
929
-
930
- <br/>
931
-
932
- **Behaviour**
933
-
934
- | Property | Description |
935
- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
936
- | 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)` |
937
- | 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**. |
938
- | 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 }** |
939
- | 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_. |
940
- | 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 }** |
941
- | Day/Night | Select the group address used to set the day/night behaviour. The group address value is _true_ if daytime, _false_ if nighttime. |
942
- | Invert day/night values | Invert the values of _Day/Night_ group address. Default value is **unchecked**. |
943
- | 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%. |
944
- | Min Dim brightness | Tha Minimum brightness that the lamp can reach. For example, if you are dimming the light down, the light will stop dimming at the specified brightness %. |
945
- | Max Dim brightness | Tha Maximum brightness that the lamp can reach. For example, if you are dimming the light up, the light will stop dimming at the specified brightness %. |
946
- | Read status at startup | Read the status at startup and emit the event to the KNX bus at startup/reconnection. (Default "no")|
947
-
948
- ### Note
949
-
950
- The Dimming function works in **KNX mode `start` and `stop`**. To start dimming, send only one "start" KNX telegram. To stop dimming, send a "stop" KNX telegram. Please **remember that**, when you set your wall swiches properties.
951
-
952
- <br/>
953
-
954
- [Find it useful?](https://www.paypal.me/techtoday)
955
-
956
- <br/>
937
+ <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>
938
+
939
+ **General**
940
+ |Property|Description|
941
+ |--|--|
942
+ | KNX GW | Select the KNX gateway to be used |
943
+ | HUE Bridge | Select the HUE Bridge to be used |
944
+ | Name | HUE light or HUE grouped light to be used. The avaiable lights and groups start showing up while you're typing.|
945
+
946
+ <br/>
947
+
948
+ **OPTIONS**
949
+
950
+ Here you can choose the KNX addresses to be linked to the avaiable HUE light commands/states.<br/>
951
+ Start typing in the GA field, the name or group address of your KNX device, the avaiable devices start showing up while you're typing.
952
+
953
+ **Switching**
954
+ |Property|Description|
955
+ |--|--|
956
+ | Control | This GA is used to turn on/off the HUE light via a boolean KNX value true/false|
957
+ | Status | Link this to the light's switch status group address|
958
+
959
+ <br/>
960
+
961
+ **Dim/Brightness**
962
+ |Property|Description|
963
+ |--|--|
964
+ | Control | Relative DIM the HUE light. You can set the dimming speed in the **_Behaviour_** tab. |
965
+ | Control % | Changes the absolute HUE light's brightness (0-100%)|
966
+ | Status| Link this to the light's brightness status group address |
967
+
968
+ <br/>
969
+
970
+ **Tunable white**
971
+ |Property|Description|
972
+ |--|--|
973
+ | 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
+ | 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. |
976
+ | 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. |
978
+
979
+ <br/>
980
+
981
+ **Colors**
982
+ |Property|Description|
983
+ |--|--|
984
+ | Control | This command is used to change the HUE light's color. Accepted datapoint is RGB triplet (r,g,b). The node handles the gamut color correction. As soon as you send a color KNX telegran, the light turns on and sets color and brightness, derived from the brightness human perception. As soon as you send a KNX telegram with r,g,b set to zero, the light turns off |
985
+ | Status | Link this to the light's color status group address. Accepted datapoint is RGB triplet (r,g,b)|
986
+
987
+ <br/>
988
+
989
+ **Effects**
990
+ |Property|Description|
991
+ |--|--|
992
+ | Blink | _true_ Blink the light, _false_ Stop blinking. Blinks the light on and off. Useful for signalling. Works with all HUE lights. |
993
+ | Color Cycle | _true_ start cycle, _false_ Stop cycle. Randomly changes the HUE light's color at regular interval. Works with all HUE lights having color capabilities. The color effect will start 10 seconds after set. |
994
+
995
+ <br/>
996
+
997
+ **Behaviour**
998
+
999
+ | Property | Description |
1000
+ | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
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 }** |
1004
+ | 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
+ | 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
+ | Invert day/night values | Invert the values of _Day/Night_ group address. Default value is **unchecked**. |
1008
+ | 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%. |
1009
+ | Min Dim brightness | Tha Minimum brightness that the lamp can reach. For example, if you are dimming the light down, the light will stop dimming at the specified brightness %. |
1010
+ | Max Dim brightness | Tha Maximum brightness that the lamp can reach. For example, if you are dimming the light up, the light will stop dimming at the specified brightness %. |
1011
+ | Read status at startup | Read the status at startup and emit the event to the KNX bus at startup/reconnection. (Default "no")|
1012
+ | Node Input/Output PINs | Hide or show the input/output PINs. Input/output PINS allow the node to accept msg input from the flow and send msg output to the flow. Input msg must follow the HUE API v.2 Standards. This is an example msg, that turns on the light: <code>msg.on = {"on":true}</code>. Please refer to the [official HUE Api page](https://developers.meethue.com/develop/hue-api-v2/api-reference/#resource_light__id__put) |
1013
+ ### Note
1014
+
1015
+ The Dimming function works in **KNX mode `start` and `stop`**. To start dimming, send only one "start" KNX telegram. To stop dimming, send a "stop" KNX telegram. Please **remember that**, when you set your wall swiches properties.
1016
+
1017
+ <br/>
1018
+
1019
+ [Find it useful?](https://www.paypal.me/techtoday)
1020
+
1021
+ <br/>
957
1022
  </script>