node-red-contrib-knx-ultimate 1.2.56 → 1.2.57

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
@@ -4,6 +4,14 @@
4
4
 
5
5
  <br/>
6
6
  <p>
7
+ <b>Version 1.2.57</b> - November 2021<br/>
8
+ - Added following datapoints:<br/>
9
+ - 12.100 counter timesec (s)<br/>
10
+ - 12.101 counter timemin (min)<br/>
11
+ - 12.102 counter timehrs (h)<br/>
12
+ - 12.1200 volume liquid (l)<br/>
13
+ </p>
14
+ <p>
7
15
  <b>Version 1.2.56</b> - November 2021<br/>
8
16
  - FIX: hotfix echo in tunneling mode doesn't work since 1.2.55.<br/>
9
17
  </p>
@@ -26,22 +26,23 @@ const onUdpSocketMessage = function (msg /*, rinfo, callback */) {
26
26
  // // DISCONNECT_RESPONSE: 0x020a,
27
27
  // var pera =true;
28
28
  // }
29
-
29
+
30
30
  try {
31
31
  let reader = KnxNetProtocol.createReader(msg)
32
32
  let dg
33
-
33
+
34
34
  reader.KNXNetHeader('tmp')
35
-
35
+
36
36
  if (reader.next()['tmp']) {
37
37
  dg = reader.next()['tmp']
38
38
  }
39
-
39
+
40
40
  /* Catch broken messages */
41
41
  if (dg) {
42
42
  /*******************************/
43
43
  // if (pera === true) console.log ("BANANA OCCHIO PERA TRUE",msg.toString("hex"),dg)
44
44
  const descr = this.datagramDesc(dg)
45
+
45
46
 
46
47
  KnxLog.get().trace('(%s): Received %s message: %j', this.compositeState(), descr, dg)
47
48
 
@@ -84,7 +85,6 @@ const onUdpSocketMessage = function (msg /*, rinfo, callback */) {
84
85
  }
85
86
  /*******************************/
86
87
  } catch (err) {
87
- console.trace(err)
88
88
  KnxLog.get().debug('(%s): Incomplete/unparseable UDP packet: %s: %s',
89
89
  this.compositeState(), err, msg.toString()
90
90
  );
@@ -214,17 +214,17 @@ const send = function (datagram, callback) {
214
214
 
215
215
  if (datagram.constructor !== Buffer) {
216
216
  try {
217
- this.writer = KnxNetProtocol.createWriter()
218
- } catch (error) {
217
+ this.writer = KnxNetProtocol.createWriter()
218
+ } catch (error) {
219
219
  }
220
220
 
221
221
 
222
222
  // Forge the datagram
223
223
  try {
224
- ret = this.writer.KNXNetHeader(datagram)
225
- } catch (error) {
224
+ ret = this.writer.KNXNetHeader(datagram)
225
+ } catch (error) {
226
226
  }
227
-
227
+
228
228
 
229
229
  // Check if ret.buffer is null ==> if this.writer.KNXNetHeader() failed
230
230
  if (ret === null || ret.buffer === null) {
@@ -376,7 +376,7 @@ const Disconnect = function (/* cb */) {
376
376
  //KnxLog.get().info('Socket disconnected.');
377
377
  //console.log("BANANA Socket disconnected.")
378
378
  //this.socket.disconnect();
379
- } catch (error) {
379
+ } catch (error) {
380
380
  //console.log("BANANA ORRORE Socket disconnected.",error)
381
381
  }
382
382
  try {
@@ -688,12 +688,13 @@ const initialize = function (options) {
688
688
  this.isTunnelConnected = false; // 08/04/2021 Supergiovane: signal that the tunnel is up or down
689
689
  this.useTunneling = options.forceTunneling || false
690
690
  this.localEchoInTunneling = typeof options.localEchoInTunneling !== "undefined" ? options.localEchoInTunneling : true; // 24/03/2021 Supergiovane (local echo of emitEvent if in tunneling mode)
691
+ this.isSecureKNXEnabled = options.isSecureKNXEnabled || false; // Is using KNX-Secure?
691
692
 
692
- this.remoteEndpoint = {
693
- addrstring: options.ipAddr,
694
- addr: ipaddr.parse(options.ipAddr),
695
- port: options.ipPort || 3671
696
- }
693
+ this.remoteEndpoint = {
694
+ addrstring: options.ipAddr,
695
+ addr: ipaddr.parse(options.ipAddr),
696
+ port: options.ipPort || 3671
697
+ }
697
698
 
698
699
  let range = this.remoteEndpoint.addr.range()
699
700
  this.log.debug('initializing %s connection to %s', range, this.remoteEndpoint.addrstring)
@@ -229,7 +229,8 @@ KnxConstants.KNX_RSM_CMDS = {
229
229
 
230
230
  // KNX protocol version 27/07/2021
231
231
  KnxConstants.PROTOCOL_VERSION = {
232
- KNXNETIP_VERSION_10 : 0x10
232
+ KNXNETIP_VERSION_10 : 0x10,
233
+ KNXNETIP_VERSION_13 : 0x13 // Secure
233
234
  }
234
235
 
235
236
  // The broadcast group address on every KNX bus
@@ -855,8 +855,19 @@ KnxProtocol.define('KNXNetHeader', {
855
855
  this.buffer.length + hdr.header_length, this.total_length)
856
856
  }
857
857
  //! Sono arrivato qui
858
- // 27/07/2021 check if the frame is secured
859
- //hdr.isSecure = hdr.protocol_version == KnxConstants.PROTOCOL_VERSION.KNXNETIP_VERSION_10 && ((service_type & KnxConstants.KNX_SECURE.SecureWrapper) == KnxConstants.KNX_SECURE.SecureWrapper);
858
+ // 18/11/2021 check if the frame is secured
859
+ //hdr.isSecure = hdr.protocol_version == KnxConstants.PROTOCOL_VERSION.KNXNETIP_VERSION_13;
860
+ //console.log("BANANA HEADER",hdr);
861
+
862
+ // console.log("BANANA", this.isSecureKNXEnabled, hdr);
863
+ // if (this.isSecureKNXEnabled !== undefined) {
864
+ // if (this.isSecureKNXEnabled && hdr.protocol_version !== KnxConstants.PROTOCOL_VERSION.KNXNETIP_VERSION_13) {
865
+ // console.log("Ricevuto header non Secure, scarto");
866
+ // throw new Error("Unsecure Header received while secure-knx was enabled.");
867
+ // } else {
868
+ // console.log("Ricevuto header Secure, procedo")
869
+ // };
870
+ // }
860
871
 
861
872
  switch (hdr.service_type) {
862
873
  // case SERVICE_TYPE.SEARCH_REQUEST:
@@ -43,7 +43,19 @@ return msg;`
43
43
  exports.subtypes = {
44
44
  // 12.001 counter pulses
45
45
  "001": {
46
- "name": "Counter pulses (unsigned)", "desc": "counter pulses"
46
+ "name": "Counter pulses (unsigned)", "desc": "Counter pulses"
47
+ },
48
+ "100": {
49
+ "name": "Counter timesec (s)", "desc": "Counter timesec (s)"
50
+ },
51
+ "101": {
52
+ "name": "Counter timemin (min)", "desc": "Counter timemin (min)"
53
+ },
54
+ "102": {
55
+ "name": "Counter timehrs (h)", "desc": "Counter timehrs (h)"
56
+ },
57
+ "1200": {
58
+ "name": "Volume liquid (l)", "desc": "Volume liquid (l)"
47
59
  },
48
60
  "1201": {
49
61
  "name": "Volume (m3)", "desc": "Volume m3"
@@ -177,8 +177,8 @@ return msg;`, "helplink": "https://github.com/Supergiovane/node-red-contrib-knx-
177
177
  if (node.knxSecureSelected) {
178
178
  node.jKNXSecureKeyring = await knx.KNXSecureKeyring.load(node.keyringFileXML, node.credentials.keyringFilePassword);
179
179
  RED.log.info("KNX-Secure: Keyring for ETS proj " + node.jKNXSecureKeyring.ETSProjectName + ", created by " + node.jKNXSecureKeyring.ETSCreatedBy + " on " + node.jKNXSecureKeyring.ETSCreated + " succesfully validated with provided password, using node " + node.name || node.id);
180
- }else{
181
- RED.log.info("KNX-Unsecure: connection to insecure interface/router using node " + node.name || node.id);
180
+ } else {
181
+ RED.log.info("KNX-Unsecure: connection to insecure interface/router using node " + node.name || node.id);
182
182
  }
183
183
  })();
184
184
  } catch (error) {
@@ -612,7 +612,7 @@ return msg;`, "helplink": "https://github.com/Supergiovane/node-red-contrib-knx-
612
612
  };
613
613
 
614
614
 
615
- //08/10/2021 Called from the Watchdog or other nodes needing to set the properties
615
+ // 08/10/2021
616
616
  var knxConnectionProperties = null;
617
617
  setKnxConnectionProperties = () => {
618
618
  // 25/08/2021 Moved out of node.initKNXConnection
@@ -627,6 +627,7 @@ return msg;`, "helplink": "https://github.com/Supergiovane/node-red-contrib-knx-
627
627
  autoReconnect: false,
628
628
  reconnectDelayMs: 5000,
629
629
  manualConnect: true,
630
+ isSecureKNXEnabled: node.knxSecureSelected,
630
631
  TTL: 128, // 11/11/2021 Supergiovane: added adjustable TTL (128 is wrote on the Gira Router PDF user manual)
631
632
  //minimumDelay: 60, // With api2 it works again, but better handling it on knx-ultimate queue
632
633
  handlers: {
@@ -989,7 +990,7 @@ return msg;`, "helplink": "https://github.com/Supergiovane/node-red-contrib-knx-
989
990
  msg.previouspayload = typeof input.currentPayload !== "undefined" ? input.currentPayload : ""; // 24/01/2020 Added previous payload
990
991
  input.currentPayload = msg.payload;// Set the current value for the RBE input
991
992
  input.setNodeStatus({ fill: "green", shape: "dot", text: "", payload: msg.payload, GA: input.topic, dpt: input.dpt, devicename: "" });
992
- input.handleSend(msg);
993
+ input.handleSend(msg);
993
994
  };
994
995
  };
995
996
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-knx-ultimate",
3
- "version": "1.2.56",
3
+ "version": "1.2.57",
4
4
  "description": "Control your KNX intallation via Node-Red! Single Node KNX IN/OUT with optional ETS group address importer. Easy to use and highly configurable.",
5
5
  "dependencies": {
6
6
  "fs": "0.0.1-security",