node-red-contrib-knx-ultimate 2.4.12 → 2.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,13 +6,15 @@
6
6
 
7
7
  # CHANGELOG
8
8
 
9
- **Version 2.4.12** - April 2024<br/>
9
+ **Version 2.4.13** - April 2024<br/>
10
10
  - Warning: this version uses the Node-Red plugin system; the Node-Red version must be **equals or major than 3.1.1**<br/>
11
11
  - NEW: Home Assistant translator node: translates the HA input msg, to a KNX value. Comes with a built-in translation table, that's user editable.<br/>
12
12
  - NEW: HUE Contact Sensor node.<br/>
13
+ - NEW: You can now get a list of all node's GA, to paste it into your KNX/IP routing table list. (See in the Gateway config window, TAB Utility.<br/>
13
14
  - Updated KNX-Ultimate device node help.<br/>
14
15
  - Minor KNX-Ultimate device node UI changes.<br/>
15
16
 
17
+
16
18
  **Version 2.4.9** - March 2024<br/>
17
19
  - WARNING: this version uses the Node-Red plugin system; the Node-Red version must be **equals or major than 3.1.1**<br/>
18
20
  - Fixed [this](https://github.com/Supergiovane/node-red-contrib-knx-ultimate/issues/338).<br/>
@@ -161,13 +161,17 @@ dpts.fromBuffer = function (buf, dpt) {
161
161
  // knxLog.get().trace('generic fromBuffer buf=%j, value=%j', buf, value);
162
162
  return value;
163
163
  };
164
-
165
164
  function cloneDpt(d) {
166
165
  let result = {};
167
- result = JSON.parse(JSON.stringify(d));
168
- result.fromBuffer = d.fromBuffer;
169
- result.formatAPDU = d.formatAPDU;
170
- return result;
166
+ try {
167
+ result = JSON.parse(JSON.stringify(d));
168
+ result.fromBuffer = d.fromBuffer;
169
+ result.formatAPDU = d.formatAPDU;
170
+ return result;
171
+ } catch (error) {
172
+
173
+ }
174
+
171
175
  }
172
176
 
173
177
  module.exports = dpts;
@@ -122,10 +122,25 @@
122
122
 
123
123
  var sRetDebugText = "";
124
124
  $("#getinfocam").click(function () {
125
+ sRetDebugText = "";
125
126
  $("#divDebugText").show();
126
127
  for (const [key, value] of Object.entries(node)) {
127
128
  sRetDebugText += (`-> ${key}: ${value}\r`);
128
129
  }
130
+ sRetDebugText = 'Open a new github issue and paste this text into it. https://github.com/Supergiovane/node-red-contrib-knx-ultimate/issues/new?assignees=Supergiovane&labels=&template=bug_report.md&title=KNXDebugText\r\r' + sRetDebugText;
131
+ $("#debugText").val(sRetDebugText); // Store the config-node);
132
+ });
133
+ $("#getallgaused").click(function () {
134
+ sRetDebugText = "";
135
+ $("#divDebugText").show();
136
+ let aFound = [];
137
+ RED.nodes.eachNode(function (node) {
138
+ if (!aFound.includes(node.topic)) {
139
+ aFound.push(node.topic);
140
+ sRetDebugText += node.topic + "\r"
141
+ }
142
+ });
143
+ sRetDebugText = 'Copy these group addresses in your routing table list of your KNX/IP router.\r' + sRetDebugText;
129
144
  $("#debugText").val(sRetDebugText); // Store the config-node);
130
145
  });
131
146
 
@@ -265,7 +280,7 @@
265
280
  <li><a href="#tabs-1"><i class="fa fa-list-ol"></i> Configuration</a></li>
266
281
  <li><a href="#tabs-2"><i class="fa fa-braille"></i> Advanced</a></li>
267
282
  <li><a href="#tabs-3"><i class="fa fa-code"></i> ETS file import</a></li>
268
- <li><a href="#tabs-4"><i class="fa fa-key"></i> Maintenance</a></li>
283
+ <li><a href="#tabs-4"><i class="fa fa-key"></i> Utility</a></li>
269
284
  </ul>
270
285
  <div id="tabs-1">
271
286
  <p>
@@ -359,8 +374,6 @@
359
374
  </div>
360
375
  </p>
361
376
  </div>
362
-
363
-
364
377
  <div id="tabs-3">
365
378
  <p>
366
379
  <div id="etsCSVListBox">
@@ -407,10 +420,12 @@
407
420
  <input type="button" id="getinfocam" class="ui-button ui-corner-all ui-widget"
408
421
  style="background-color:#AEE1FF;width:150px" value="Read">
409
422
  </div>
410
- <div class="form-row" id="divDebugText" style="display: none;">
411
- Copy this text, open a new github issue <a target="_blank"
412
- href="https://github.com/Supergiovane/node-red-contrib-knx-ultimate/issues/new?assignees=Supergiovane&labels=&template=bug_report.md&title=KNXDebugText">
413
- ->by CLICKING HERE</a>, or paste it to an already open issue.
423
+ <div class="form-row">
424
+ <label style="width:300px"><i class="fa fa-sign-in"></i> Get all used GA for KNX routing filter</label>
425
+ <input type="button" id="getallgaused" class="ui-button ui-corner-all ui-widget"
426
+ style="background-color:#AEE1FF;width:150px" value="Read">
427
+ </div>
428
+ <div class="form-row" id="divDebugText" style="display: none;">
414
429
  <textarea rows="10" id="debugText" style="width:100%"></textarea>
415
430
  </div>
416
431
  </p>
@@ -459,10 +474,11 @@
459
474
 
460
475
  <br/>
461
476
 
462
- **Maintenance**
477
+ **Utility**
463
478
  |Property|Description|
464
479
  |--|--|
465
480
  | Gather debug info for troubleshoot | Please click the button and add it to the gitHub issue you want to open, it will help me a lot to helping you. |
481
+ | Get all used GA for KNX routing filter | Press READ to retrieve a plain text list of all group address belonging to this gateway, that has been used in the flows. You can use this list to populate your KNX/IP router filter table. |
466
482
 
467
483
  <br/>
468
484
 
@@ -236,7 +236,7 @@
236
236
 
237
237
  |Property|Description|
238
238
  |--|--|
239
- | Contact | As soon as a contact sensor is being opene/closed, a *true* KNX value is sent to this group address, otherwise *false* is sent. |
239
+ | Contact | As soon as a contact sensor is being open/closed, a *true* KNX value is sent to this group address, otherwise *false* is sent. |
240
240
 
241
241
  ### Outputs
242
242
 
@@ -74,7 +74,12 @@ module.exports = function (RED) {
74
74
  config.colorAtSwitchOnDayTime = { kelvin: 3000, brightness: 100 };
75
75
  }
76
76
  } else {
77
- config.colorAtSwitchOnDayTime = JSON.parse(config.colorAtSwitchOnDayTime);
77
+ try {
78
+ config.colorAtSwitchOnDayTime = JSON.parse(config.colorAtSwitchOnDayTime);
79
+ } catch (error) {
80
+ RED.log.error(`knxUltimateHueLight: config.colorAtSwitchOnDayTime = JSON.parse(config.colorAtSwitchOnDayTime): ${error.message} : ${error.stack || ""} `);
81
+ config.colorAtSwitchOnDayTime = "";
82
+ }
78
83
  }
79
84
  // Same thing, but with night color
80
85
  if (config.colorAtSwitchOnNightTime.indexOf("#") !== -1) {
@@ -85,7 +90,13 @@ module.exports = function (RED) {
85
90
  config.colorAtSwitchOnNightTime = { kelvin: 2700, brightness: 20 };
86
91
  }
87
92
  } else {
88
- config.colorAtSwitchOnNightTime = JSON.parse(config.colorAtSwitchOnNightTime);
93
+ try {
94
+ config.colorAtSwitchOnNightTime = JSON.parse(config.colorAtSwitchOnNightTime);
95
+ } catch (error) {
96
+ RED.log.error(`knxUltimateHueLight: config.colorAtSwitchOnDayTime = JSON.parse(config.colorAtSwitchOnNightTime): ${error.message} : ${error.stack || ""} `);
97
+ config.colorAtSwitchOnNightTime = "";
98
+ }
99
+
89
100
  }
90
101
 
91
102
  // Used to call the status update from the config node.
@@ -28,14 +28,18 @@ module.exports.use = (config) => {
28
28
  } else {
29
29
  // log.trace('http data ' + data);
30
30
  if (res.statusCode >= 100 && res.statusCode < 400) {
31
- let result = JSON.parse(data);
32
- if (result.errors && result.errors.length > 0) {
33
- reject(new Error("The response for " + opt.url + " returned errors " + JSON.stringify(result.errors)));
31
+ try {
32
+ let result = JSON.parse(data);
33
+ if (result.errors && result.errors.length > 0) {
34
+ reject(new Error("The response for " + opt.url + " returned errors " + JSON.stringify(result.errors)));
35
+ }
36
+ if (!result.data) {
37
+ reject(new Error("Unexpected result with no data. " + JSON.stringify(result)));
38
+ }
39
+ resolve(result.data);
40
+ } catch (error) {
41
+ RED.log.error(`utils.https: config.http.call: let result = JSON.parse(data); =: ${error.message} : ${error.stack || ""} `);
34
42
  }
35
- if (!result.data) {
36
- reject(new Error("Unexpected result with no data. " + JSON.stringify(result)));
37
- }
38
- resolve(result.data);
39
43
  } else {
40
44
  reject(new Error("Error response for " + opt.url + " with status " + res.statusCode + " " + res.statusMessage));
41
45
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "engines": {
4
4
  "node": ">=16.0.0"
5
5
  },
6
- "version": "2.4.12",
6
+ "version": "2.4.13",
7
7
  "description": "Control your KNX intallation via Node-Red! A bunch of KNX nodes, with integrated Philips HUE control and ETS group address importer. Easy to use and highly configurable.",
8
8
  "dependencies": {
9
9
  "binary-parser": "2.2.1",