node-red-contrib-knx-ultimate 1.3.18 → 1.3.19

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,18 +4,23 @@
4
4
 
5
5
  <br/>
6
6
  <p>
7
- <b>Version 1.3.18</b> - Januar 2022<br/>
7
+ <b>Version 1.3.19</b> - January 2022<br/>
8
+ - NEW: Added Datapoint 14.058 Pressure (Pa).<br/>
9
+ - Added some more description while disconnecting from the BUS.<br/>
10
+ </p>
11
+ <p>
12
+ <b>Version 1.3.18</b> - January 2022<br/>
8
13
  - FIX: Scene Controller: fixed an issue preventing the node to work if you haven't set the RECALL and SAVE group addresses.<br/>
9
14
  - WIKI: updated the samples in the scene controller node.<br/>
10
15
  </p>
11
16
  <p>
12
- <b>Version 1.3.16</b> - Januar 2022<br/>
17
+ <b>Version 1.3.16</b> - January 2022<br/>
13
18
  - KNXEngine: there are some weird KNX gateways out there, either sending malformed header or CEMI messages. Now KNX-Ultimate will simply ignore these bad messages. Prior, it was disconnecting.<br/>
14
19
  - KNXEngine: KNX-Secure packets are silently discarded for now, until KNX Secure will be ready.<br/>
15
20
  - KNXEngine: added more logs to for troubleshooting pourposes.<br/>
16
21
  </p>
17
22
  <p>
18
- <b>Version 1.3.15</b> - Januar 2022<br/>
23
+ <b>Version 1.3.15</b> - January 2022<br/>
19
24
  - KNXEngine: better handling of disconnection in UDP mode, allowing very old grandpa KNX/IP interfaces enough time to understand what's happening, avoiding it to go crazy.<br/>
20
25
  - KNXEngine: corrected Curve Crypto in KNX-Secure (KNX Secure is not enabled yet!).<br/>
21
26
  </p>
@@ -626,7 +626,7 @@ class KNXClient extends EventEmitter {
626
626
  this.emit(KNXClientEvents.error, deadError);
627
627
  } catch (error) {
628
628
  }
629
- this._setDisconnected();
629
+ this._setDisconnected(deadError.message);
630
630
  }
631
631
  }, 1000 * KNXConstants.KNX_CONSTANTS.CONNECTIONSTATE_REQUEST_TIMEOUT);
632
632
  this._awaitingResponseType = KNXConstants.KNX_CONSTANTS.CONNECTIONSTATE_RESPONSE;
@@ -641,13 +641,13 @@ class KNXClient extends EventEmitter {
641
641
  this._awaitingResponseType = KNXConstants.KNX_CONSTANTS.DISCONNECT_RESPONSE;
642
642
  this._sendDisconnectRequestMessage(this._channelID);
643
643
  //this._timerTimeoutSendDisconnectRequestMessage = setTimeout(() => {
644
- this._setDisconnected();
644
+ this._setDisconnected("Called from KNXClient Disconnected");
645
645
  //}, 1000 * KNXConstants.KNX_CONSTANTS.CONNECT_REQUEST_TIMEOUT);
646
646
  }
647
647
  isConnected() {
648
648
  return this._connectionState === STATE.CONNECTED;
649
649
  }
650
- _setDisconnected() {
650
+ _setDisconnected(_sReason = "") {
651
651
  if (this._timerTimeoutSendDisconnectRequestMessagetimer !== null) clearTimeout(this._timerTimeoutSendDisconnectRequestMessagetimer);
652
652
  this._timerTimeoutSendDisconnectRequestMessage = null;
653
653
  if (this._connectionTimeoutTimer !== null) clearTimeout(this._connectionTimeoutTimer);
@@ -655,7 +655,7 @@ class KNXClient extends EventEmitter {
655
655
  this.stopHeartBeat();
656
656
  this._connectionState = STATE.DISCONNECTED;
657
657
  try {
658
- this.emit(KNXClientEvents.disconnected, `${this._options.ipAddr}:${this._options.ipPort}`);
658
+ this.emit(KNXClientEvents.disconnected, this._options.ipAddr + ":" + this._options.ipPort + " " + _sReason);
659
659
  } catch (error) {
660
660
  }
661
661
 
@@ -740,13 +740,13 @@ class KNXClient extends EventEmitter {
740
740
  if (knxHeader.service_type === KNXConstants.KNX_CONSTANTS.ROUTING_LOST_MESSAGE) {
741
741
  try {
742
742
  this.emit(KNXClientEvents.error, new Error('ROUTING_LOST_MESSAGE'));
743
- this._setDisconnected();
743
+ this._setDisconnected("Routing Lost Message");
744
744
  return;
745
745
  } catch (error) { }
746
746
  } else if (knxHeader.service_type === KNXConstants.KNX_CONSTANTS.ROUTING_BUSY) {
747
747
  try {
748
748
  this.emit(KNXClientEvents.error, new Error('ROUTING_BUSY'));
749
- this._setDisconnected();
749
+ this._setDisconnected("Routing Busy");
750
750
  return;
751
751
  } catch (error) { }
752
752
  }
@@ -771,7 +771,7 @@ class KNXClient extends EventEmitter {
771
771
  try {
772
772
  this.emit(KNXClientEvents.error, KNXConnectResponse.KNXConnectResponse.statusToString(knxConnectResponse.status));
773
773
  } catch (error) { }
774
- this._setDisconnected();
774
+ this._setDisconnected("Connect response error " + knxConnectResponse.status);
775
775
  return;
776
776
  }
777
777
  this._connectionState = STATE.CONNECTED;
@@ -798,7 +798,7 @@ class KNXClient extends EventEmitter {
798
798
  } catch (error) {
799
799
  }
800
800
  }
801
- this._setDisconnected();
801
+ this._setDisconnected("Received Disconnect Response");
802
802
  }
803
803
  else if (knxHeader.service_type === KNXConstants.KNX_CONSTANTS.DISCONNECT_REQUEST) {
804
804
 
@@ -808,12 +808,12 @@ class KNXClient extends EventEmitter {
808
808
  }
809
809
 
810
810
  try {
811
- if (this.sysLogger !== undefined && this.sysLogger !== null) this.sysLogger.debug("Received KNX packet: DISCONNECT_REQUEST, ChannelID:" + this._channelID + " Host:" + this._options.ipAddr + ":" + this._options.ipPort);
811
+ if (this.sysLogger !== undefined && this.sysLogger !== null) this.sysLogger.warn("Received KNX packet: DISCONNECT_REQUEST, ChannelID:" + this._channelID + " Host:" + this._options.ipAddr + ":" + this._options.ipPort);
812
812
  } catch (error) { }
813
813
 
814
814
  this._connectionState = STATE.DISCONNECTING;
815
815
  this._sendDisconnectResponseMessage(knxDisconnectRequest.channelID);
816
- this._setDisconnected();
816
+ this._setDisconnected("Received Disconnect Request");
817
817
  }
818
818
  else if (knxHeader.service_type === KNXConstants.KNX_CONSTANTS.TUNNELING_REQUEST) {
819
819
 
@@ -934,7 +934,7 @@ class KNXClient extends EventEmitter {
934
934
  this.emit(KNXClientEvents.error, KNXConnectionStateResponse.KNXConnectionStateResponse.statusToString(knxConnectionStateResponse.status));
935
935
  } catch (error) {
936
936
  }
937
- this._setDisconnected();
937
+ this._setDisconnected("Awaiting response "+ this._awaitingResponseType + ", received connection state response with status " + knxConnectionStateResponse.status);
938
938
  }
939
939
  else {
940
940
  if (this._heartbeatTimer !== null) clearTimeout(this._heartbeatTimer);
@@ -129,9 +129,15 @@ exports.subtypes = {
129
129
  "057": {
130
130
  "desc": "DPT_Value_Power_Factor",
131
131
  "name": "Power factor",
132
- "unit": "-"
132
+ "unit": "cos Φ"
133
133
  },
134
134
 
135
+ "058": {
136
+ "desc": "DPT_Value_Pressure",
137
+ "name": "Pressure (Pa)",
138
+ "unit": "Pa"
139
+ },
140
+
135
141
  "065": {
136
142
  "desc": "DPT_Value_Speed",
137
143
  "name": "Speed",
@@ -3,36 +3,6 @@
3
3
  * (C) 2020-2022 Supergiovane
4
4
  */
5
5
 
6
- /*
7
- Datatypes
8
- =========
9
- KNX/EIB Function Information length EIS DPT Value
10
- Switch 1 Bit EIS 1 DPT 1 0,1
11
- Dimming (Position, Control, Value) 1 Bit, 4 Bit, 8 Bit EIS 2 DPT 3 [0,0]...[1,7]
12
- Time 3 Byte EIS 3 DPT 10
13
- Date 3 Byte EIS 4 DPT 11
14
- Floating point 2 Byte EIS 5 DPT 9 -671088,64 - 670760,96
15
- 8-bit unsigned value 1 Byte EIS 6 DPT 5 0...255
16
- 8-bit unsigned value 1 Byte DPT 5.001 DPT 5.001 0...100
17
- Blinds / Roller shutter 1 Bit EIS 7 DPT 1 0,1
18
- Priority 2 Bit EIS 8 DPT 2 [0,0]...[1,1]
19
- IEEE Floating point 4 Byte EIS 9 DPT 14 4-Octet Float Value IEEE 754
20
- 16-bit unsigned value 2 Byte EIS 10 DPT 7 0...65535
21
- 16-bit signed value 2 Byte DPT 8 DPT 8 -32768...32767
22
- 32-bit unsigned value 4 Byte EIS 11 DPT 12 0...4294967295
23
- 32-bit signed value 4 Byte DPT 13 DPT 13 -2147483648...2147483647
24
- Access control 1 Byte EIS 12 DPT 15
25
- ASCII character 1 Byte EIS 13 DPT 4
26
- 8859_1 character 1 Byte DPT 4.002 DPT 4.002
27
- 8-bit signed value 1 Byte EIS 14 DPT 6 -128...127
28
- 14 character ASCII 14 Byte EIS 15 DPT 16
29
- 14 character 8859_1 14 Byte DPT 16.001 DPT 16.001
30
- Scene 1 Byte DPT 17 DPT 17 0...63
31
- HVAC 1 Byte DPT 20 DPT 20 0..255
32
- Unlimited string 8859_1 . DPT 24 DPT 24
33
- List 3-byte value 3 Byte DPT 232 DPT 232 RGB[0,0,0]...[255,255,255]
34
- */
35
-
36
6
 
37
7
  const fs = require('fs');
38
8
  const path = require('path');
@@ -28,10 +28,12 @@ extractBaseNo = (kv) => {
28
28
  };
29
29
 
30
30
  convertSubtype = (baseType) => (kv) => {
31
- let value = `${baseType.base}.${kv[0]}`
31
+ let value = `${baseType.base}.${kv[0]}`;
32
+ //let sRet = value + " " + kv[1].name + (kv[1].unit === undefined ? "" : " (" + kv[1].unit + ")");
33
+ let sRet = value + " " + kv[1].name;
32
34
  return {
33
35
  value: value
34
- , text: value + ` ${kv[1].name}`
36
+ , text: sRet
35
37
  }
36
38
  }
37
39
 
@@ -760,7 +762,7 @@ return msg;`, "helplink": "https://github.com/Supergiovane/node-red-contrib-knx-
760
762
  node.timerDoInitialRead = setTimeout(DoInitialReadFromKNXBusOrFile, 6000); // 17/02/2020 Do initial read of all nodes requesting initial read
761
763
  setTimeout(() => {
762
764
  node.setAllClientsStatus("Connected.", "green", "On duty.")
763
- }, 500);
765
+ }, 500);
764
766
  if (node.sysLogger !== undefined && node.sysLogger !== null) node.sysLogger.info("knxUltimate-config: Connected to %o", info);
765
767
  });
766
768
  node.knxConnection.on(knx.KNXClient.KNXClientEvents.connecting, info => {
@@ -1754,7 +1756,7 @@ return msg;`, "helplink": "https://github.com/Supergiovane/node-red-contrib-knx-
1754
1756
  node.allowLauch_initKNXConnection = false;
1755
1757
  setTimeout(() => {
1756
1758
  node.setAllClientsStatus("Auto reconnect in progress...", "grey", "");
1757
- }, 100);
1759
+ }, 100);
1758
1760
  if (node.sysLogger !== undefined && node.sysLogger !== null) node.sysLogger.debug("knxUltimate-config: Auto Reconect by timerKNXUltimateCheckState in progress. node.LinkStatus:" + node.linkStatus + ", node.autoReconnect:" + node.autoReconnect);
1759
1761
  node.initKNXConnection();
1760
1762
  return;
@@ -1763,7 +1765,7 @@ return msg;`, "helplink": "https://github.com/Supergiovane/node-red-contrib-knx-
1763
1765
  node.allowLauch_initKNXConnection = true; // Next cycle, launch initKNXConnection, so it pauses more and leave more time
1764
1766
  setTimeout(() => {
1765
1767
  node.setAllClientsStatus("Next cycle will reconnect...", "grey", "");
1766
- }, 1000);
1768
+ }, 1000);
1767
1769
  if (node.sysLogger !== undefined && node.sysLogger !== null) node.sysLogger.debug("knxUltimate-config: Waiting next cycle to reconect. node.LinkStatus:" + node.linkStatus + ", node.autoReconnect:" + node.autoReconnect);
1768
1770
  //node.initKNXConnection();
1769
1771
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-knx-ultimate",
3
- "version": "1.3.18",
3
+ "version": "1.3.19",
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",