node-red-contrib-knx-ultimate 2.5.1 → 3.0.0-beta2

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.
Files changed (153) hide show
  1. package/.eslintrc.json +3 -2
  2. package/CHANGELOG.md +13 -0
  3. package/README.md +2 -1
  4. package/{KNXEngine → _JS_KNXEngine}/README.md +7 -7
  5. package/{KNXEngine → _JS_KNXEngine}/index.js +1 -1
  6. package/{KNXEngine → _JS_KNXEngine}/sample.js +5 -5
  7. package/{KNXEngine → _JS_KNXEngine}/sampleSecure.js +1 -1
  8. package/{KNXEngine → _JS_KNXEngine}/src/KNXClient.js +3 -3
  9. package/_JS_KNXEngine/src/dptlib/dpt60002.js +101 -0
  10. package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXConnectResponse.js +2 -0
  11. package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXConstants.js +1 -0
  12. package/nodes/commonFunctions.js +3 -3
  13. package/nodes/hue-config.html +2 -0
  14. package/nodes/hue-config.js +8 -0
  15. package/nodes/knxUltimate-config.html +2 -0
  16. package/nodes/knxUltimate-config.js +226 -223
  17. package/nodes/knxUltimate.html +124 -57
  18. package/nodes/knxUltimate.js +100 -60
  19. package/nodes/knxUltimateAlerter.html +7 -12
  20. package/nodes/knxUltimateAlerter.js +3 -2
  21. package/nodes/knxUltimateGarageDoorBarrierOpener.html +7 -12
  22. package/nodes/knxUltimateGarageDoorBarrierOpener.js +2 -2
  23. package/nodes/knxUltimateGlobalContext.html +2 -0
  24. package/nodes/knxUltimateHueBattery.html +11 -14
  25. package/nodes/knxUltimateHueButton.html +27 -22
  26. package/nodes/knxUltimateHueButton.js +1 -1
  27. package/nodes/knxUltimateHueContactSensor.html +12 -8
  28. package/nodes/knxUltimateHueLight.html +17 -24
  29. package/nodes/knxUltimateHueLight.js +1 -2
  30. package/nodes/knxUltimateHueLightSensor.html +11 -14
  31. package/nodes/knxUltimateHueMotion.html +11 -14
  32. package/nodes/knxUltimateHueScene.html +24 -19
  33. package/nodes/knxUltimateHueScene.js +2 -1
  34. package/nodes/knxUltimateHueTapDial.html +11 -14
  35. package/nodes/knxUltimateHueTemperatureSensor.html +11 -14
  36. package/nodes/knxUltimateHueZigbeeConnectivity.html +11 -14
  37. package/nodes/knxUltimateHuedevice_software_update.html +261 -0
  38. package/nodes/knxUltimateHuedevice_software_update.js +134 -0
  39. package/nodes/knxUltimateLoadControl.html +4 -11
  40. package/nodes/knxUltimateLoadControl.js +1 -1
  41. package/nodes/knxUltimateLogger.html +3 -1
  42. package/nodes/knxUltimateSceneController.html +14 -15
  43. package/nodes/knxUltimateViewer.html +2 -0
  44. package/nodes/knxUltimateViewer.js +1 -1
  45. package/nodes/knxUltimateWatchDog.html +3 -1
  46. package/nodes/utils/payloadManipulation.js +49 -1
  47. package/nodes/utils/utils.js +4 -0
  48. package/package.json +6 -4
  49. package/resources/htmlUtils.js +27 -0
  50. /package/{KNXEngine → _JS_KNXEngine}/CHANGELOG.md +0 -0
  51. /package/{KNXEngine → _JS_KNXEngine}/LICENSE +0 -0
  52. /package/{KNXEngine → _JS_KNXEngine}/img/dpt 2.png +0 -0
  53. /package/{KNXEngine → _JS_KNXEngine}/img/dpt.png +0 -0
  54. /package/{KNXEngine → _JS_KNXEngine}/img/logo 2.png +0 -0
  55. /package/{KNXEngine → _JS_KNXEngine}/img/logo-big 2.png +0 -0
  56. /package/{KNXEngine → _JS_KNXEngine}/img/logo-big.png +0 -0
  57. /package/{KNXEngine → _JS_KNXEngine}/img/logo.png +0 -0
  58. /package/{KNXEngine → _JS_KNXEngine}/img/nodered 2.png +0 -0
  59. /package/{KNXEngine → _JS_KNXEngine}/img/nodered.png +0 -0
  60. /package/{KNXEngine → _JS_KNXEngine}/package.json +0 -0
  61. /package/{KNXEngine → _JS_KNXEngine}/simpleSample.js +0 -0
  62. /package/{KNXEngine → _JS_KNXEngine}/src/Curve25519.js +0 -0
  63. /package/{KNXEngine → _JS_KNXEngine}/src/KNXSocketOptions.js +0 -0
  64. /package/{KNXEngine → _JS_KNXEngine}/src/KNXsecureKeyring.js +0 -0
  65. /package/{KNXEngine → _JS_KNXEngine}/src/KnxLog.js +0 -0
  66. /package/{KNXEngine → _JS_KNXEngine}/src/cur.js +0 -0
  67. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt1.js +0 -0
  68. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt10.js +0 -0
  69. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt11.js +0 -0
  70. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt12.js +0 -0
  71. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt13.js +0 -0
  72. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt14.js +0 -0
  73. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt15.js +0 -0
  74. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt16.js +0 -0
  75. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt17.js +0 -0
  76. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt18.js +0 -0
  77. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt19.js +0 -0
  78. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt2.js +0 -0
  79. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt20.js +0 -0
  80. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt21.js +0 -0
  81. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt213.js +0 -0
  82. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt22.js +0 -0
  83. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt222.js +0 -0
  84. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt232.js +0 -0
  85. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt235.js +0 -0
  86. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt237.js +0 -0
  87. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt238.js +0 -0
  88. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt242.js +0 -0
  89. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt249.js +0 -0
  90. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt251.js +0 -0
  91. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt275.js +0 -0
  92. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt28.js +0 -0
  93. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt29.js +0 -0
  94. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt3.js +0 -0
  95. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt4.js +0 -0
  96. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt5.js +0 -0
  97. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt6.js +0 -0
  98. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt60001.js +0 -0
  99. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt7.js +0 -0
  100. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt8.js +0 -0
  101. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt9.js +0 -0
  102. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt999.js +0 -0
  103. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/index.js +0 -0
  104. /package/{KNXEngine → _JS_KNXEngine}/src/errors/BufferLengthError.js +0 -0
  105. /package/{KNXEngine → _JS_KNXEngine}/src/errors/DateFormatError.js +0 -0
  106. /package/{KNXEngine → _JS_KNXEngine}/src/errors/DuplicateRequestError.js +0 -0
  107. /package/{KNXEngine → _JS_KNXEngine}/src/errors/InvalidValueError.js +0 -0
  108. /package/{KNXEngine → _JS_KNXEngine}/src/errors/NotImplementedError.js +0 -0
  109. /package/{KNXEngine → _JS_KNXEngine}/src/errors/RequestTimeoutError.js +0 -0
  110. /package/{KNXEngine → _JS_KNXEngine}/src/errors/index.js +0 -0
  111. /package/{KNXEngine → _JS_KNXEngine}/src/index.js +0 -0
  112. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/CRD.js +0 -0
  113. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/CRI.js +0 -0
  114. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/CRIFactory.js +0 -0
  115. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/DIB.js +0 -0
  116. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/DeviceInfo.js +0 -0
  117. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/HPAI.js +0 -0
  118. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/IPConfig.js +0 -0
  119. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/IPCurrentConfig.js +0 -0
  120. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXAddress.js +0 -0
  121. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXAddresses.js +0 -0
  122. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXConnectRequest.js +0 -0
  123. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXConnectionStateRequest.js +0 -0
  124. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXConnectionStateResponse.js +0 -0
  125. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXDataBuffer.js +0 -0
  126. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXDescriptionRequest.js +0 -0
  127. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXDescriptionResponse.js +0 -0
  128. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXDisconnectRequest.js +0 -0
  129. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXDisconnectResponse.js +0 -0
  130. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXHeader.js +0 -0
  131. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXPacket.js +0 -0
  132. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXProtocol.js +0 -0
  133. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXRoutingIndication.js +0 -0
  134. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXSearchRequest.js +0 -0
  135. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXSearchResponse.js +0 -0
  136. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXSecureSessionRequest.js +0 -0
  137. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXTunnelingAck.js +0 -0
  138. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXTunnelingRequest.js +0 -0
  139. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXUtils.js +0 -0
  140. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/ServiceFamilies.js +0 -0
  141. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/TunnelCRI.js +0 -0
  142. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/AdditionalInfo.js +0 -0
  143. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/CEMIConstants.js +0 -0
  144. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/CEMIFactory.js +0 -0
  145. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/CEMIMessage.js +0 -0
  146. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/ControlField.js +0 -0
  147. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/LDataCon.js +0 -0
  148. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/LDataInd.js +0 -0
  149. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/LDataReq.js +0 -0
  150. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/NPDU.js +0 -0
  151. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/TLVInfo.js +0 -0
  152. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/index.js +0 -0
  153. /package/{KNXEngine → _JS_KNXEngine}/src/util/ipAddressHelper.js +0 -0
package/.eslintrc.json CHANGED
@@ -9,6 +9,7 @@
9
9
  "ecmaVersion": "latest"
10
10
  },
11
11
  "rules": {
12
- "quotes": "off"
12
+ "quotes": "off",
13
+ "no-bitwise": "off"
13
14
  }
14
- }
15
+ }
package/CHANGELOG.md CHANGED
@@ -6,6 +6,19 @@
6
6
 
7
7
  # CHANGELOG
8
8
 
9
+ **Version 3.0.0-beta2** - Juni 2024<br/>
10
+ - Warning: Node-Red version **equals or major than 3.1.1** is needed to run this node.<br/>
11
+ - NEW: Hue Node Software Update Status for the HUE devices. <br/>
12
+
13
+ **Version 3.0.0-beta1** - Juni 2024<br/>
14
+ - Warning: Node-Red version **equals or major than 3.1.1** is needed to run this node.<br/>
15
+ - FEATURE CAUTION: rewrote the KNX engine in Typescript. If you encounter problems, please open a gitub issue. You can revert by installing the older version 2.5.1 <br/>
16
+ - FEATURE: KNX Ultimate node: you can now set the group address from a global, flow or $env variable, beside the standard 3-level format. <br/>
17
+ - FEATURE: KNX Ultimate node: if you imported the ETS file, as soon as you click to the Group Address field, the list shows up immediately. <br/>
18
+ - FEATURE: KNX Ultimate node: msg.setConfig passed to the node, now can read the group address name and datapoint automatically, based on the group address (require the ETS file to be imported). <br/>
19
+ - FEATURE: KNX Ultimate node: the object property *gainfo* has been added to the msg output. Refer to the help panel for further infos. <br/>
20
+
21
+
9
22
  **Version 2.5.1** - Mai 2024<br/>
10
23
  - Warning: Node-Red version **equals or major than 3.1.1** is needed to run this node.<br/>
11
24
  - NEW: HUE light node: you can now override the day/night mode by setting the day mode temporary, whenever you fast toggles the light switch on then off within 10 seconds. There are multiple choiches to select from. <br/>
package/README.md CHANGED
@@ -57,9 +57,10 @@ msg.payload = {red:255, green:200, blue:30} // Put some colors in our life
57
57
  |--|--|
58
58
  | KNX Tunnelling | ![](https://placehold.co/200x20/green/white?text=YES) |
59
59
  | KNX Routing | ![](https://placehold.co/200x20/green/white?text=YES) |
60
+ | Philips Hue v2 | ![](https://placehold.co/200x20/green/white?text=YES) |
60
61
  | KNX Secure Tunnelling | ![](https://placehold.co/200x20/orange/white?text=UNDER+DEVELOPMENT) |
61
62
  | KNX Secure Routing | ![](https://placehold.co/200x20/red/white?text=NO) |
62
- | KNX 3rd PARTY IOT API client | ![](https://placehold.co/200x20/orange/white?text=UNDER+DEVELOPMENT) |
63
+ | KNX 3rd PARTY IOT API client | ![](https://placehold.co/200x20/red/white?text=DELAYED) |
63
64
  | Matter | ![](https://placehold.co/200x20/blue/white?text=UNDER+BRAINSTORMING) |
64
65
 
65
66
  <br/>
@@ -92,7 +92,7 @@ You should see something like this in the console window (the **msg.payload** is
92
92
  |Properties|Description|
93
93
  |--|--|
94
94
  | .isConnected() | Returns **true** if you the client is connected to the KNX Gateway Router/Interface, **false** if not connected. |
95
- | ._getClearToSend() | Returns **true** if you can send a telegram, **false** if the client is still waiting for the last telegram's ACK or whenever the client cannot temporary send the telegram. In tunneling mode, you could also refer to the event **KNXClientEvents.ackReceived**, that is fired everytime a telegram has been succesfully acknowledge or not acknowledge. See the sample.js file. |
95
+ | .clearToSend | Returns **true** if you can send a telegram, **false** if the client is still waiting for the last telegram's ACK or whenever the client cannot temporary send the telegram. In tunneling mode, you could also refer to the event **KNXClientEvents.ackReceived**, that is fired everytime a telegram has been succesfully acknowledge or not acknowledge. See the sample.js file. |
96
96
 
97
97
  <br/>
98
98
  <br/>
@@ -333,24 +333,24 @@ knxUltimateClient.on(knx.KNXClient.KNXClientEvents.connected, info => {
333
333
  // Check wether knxUltimateClient is clear to send the next telegram.
334
334
  // This should be called bevore any .write, .response, and .read request.
335
335
  // If not clear to send, retry later because the knxUltimateClient is busy in sending another telegram.
336
- console.log("Clear to send: " + knxUltimateClient._getClearToSend())
336
+ console.log("Clear to send: " + knxUltimateClient.clearToSend)
337
337
 
338
338
  // // Send a WRITE telegram to the KNX BUS
339
339
  // // You need: group address, payload (true/false/or any message), datapoint as string
340
340
  let payload = false;
341
- if (knxUltimateClient._getClearToSend()) knxUltimateClient.write("0/1/1", payload, "1.001");
341
+ if (knxUltimateClient.clearToSend) knxUltimateClient.write("0/1/1", payload, "1.001");
342
342
 
343
343
  // Send a color RED to an RGB datapoint
344
344
  payload = { red: 125, green: 0, blue: 0 };
345
- if (knxUltimateClient._getClearToSend()) knxUltimateClient.write("0/1/2", payload, "232.600");
345
+ if (knxUltimateClient.clearToSend) knxUltimateClient.write("0/1/2", payload, "232.600");
346
346
 
347
347
  // // Send a READ request to the KNX BUS
348
- if (knxUltimateClient._getClearToSend()) knxUltimateClient.read("0/0/1");
348
+ if (knxUltimateClient.clearToSend) knxUltimateClient.read("0/0/1");
349
349
 
350
350
  // Send a RESPONSE telegram to the KNX BUS
351
351
  // You need: group address, payload (true/false/or any message), datapoint as string
352
352
  payload = false;
353
- if (knxUltimateClient._getClearToSend()) knxUltimateClient.respond("0/0/1", payload, "1.001");
353
+ if (knxUltimateClient.clearToSend) knxUltimateClient.respond("0/0/1", payload, "1.001");
354
354
 
355
355
  });
356
356
  knxUltimateClient.on(knx.KNXClient.KNXClientEvents.connecting, info => {
@@ -510,7 +510,7 @@ async function go() {
510
510
  // The client is connected
511
511
  console.log("Connected. On Duty", info)
512
512
  // Write something to the BUS
513
- if (knxUltimateClient._getClearToSend()) knxUltimateClient.write("0/1/1", false, "1.001");
513
+ if (knxUltimateClient.clearToSend) knxUltimateClient.write("0/1/1", false, "1.001");
514
514
  });
515
515
  knxUltimateClient.on(knx.KNXClient.KNXClientEvents.connecting, info => {
516
516
  // The client is setting up the connection
@@ -1,5 +1,5 @@
1
1
  const { KNXClient, KNXClientEvents, getDecodedKeyring, appendPropertyToDecodedKeyring } = require("./src/KNXClient.js");
2
- //const KNXSecureKeyring = require('./../knxultimate/src/KNXsecureKeyring.js');
2
+ //const KNXSecureKeyring = require('./.knxultimate/KNXsecureKeyring.js');
3
3
  //exports.KNXSecureKeyring = KNXSecureKeyring;
4
4
 
5
5
  //exports.KNXClientEvents = KNXClient.KNXClientEvents;
@@ -125,24 +125,24 @@ knxUltimateClient.on(knx.KNXClient.KNXClientEvents.connected, info => {
125
125
  // Check wether knxUltimateClient is clear to send the next telegram.
126
126
  // This should be called bevore any .write, .response, and .read request.
127
127
  // If not clear to send, retry later because the knxUltimateClient is busy in sending another telegram.
128
- console.log("Clear to send: " + knxUltimateClient._getClearToSend())
128
+ console.log("Clear to send: " + knxUltimateClient.clearToSend)
129
129
 
130
130
  // // Send a WRITE telegram to the KNX BUS
131
131
  // // You need: group address, payload (true/false/or any message), datapoint as string
132
132
  let payload = false;
133
- if (knxUltimateClient._getClearToSend()) knxUltimateClient.write("0/1/1", payload, "1.001");
133
+ if (knxUltimateClient.clearToSend) knxUltimateClient.write("0/1/1", payload, "1.001");
134
134
 
135
135
  // Send a color RED to an RGB datapoint
136
136
  payload = { red: 125, green: 0, blue: 0 };
137
- if (knxUltimateClient._getClearToSend()) knxUltimateClient.write("0/1/2", payload, "232.600");
137
+ if (knxUltimateClient.clearToSend) knxUltimateClient.write("0/1/2", payload, "232.600");
138
138
 
139
139
  // // Send a READ request to the KNX BUS
140
- if (knxUltimateClient._getClearToSend()) knxUltimateClient.read("0/0/1");
140
+ if (knxUltimateClient.clearToSend) knxUltimateClient.read("0/0/1");
141
141
 
142
142
  // Send a RESPONSE telegram to the KNX BUS
143
143
  // You need: group address, payload (true/false/or any message), datapoint as string
144
144
  payload = false;
145
- if (knxUltimateClient._getClearToSend()) knxUltimateClient.respond("0/0/1", payload, "1.001");
145
+ if (knxUltimateClient.clearToSend) knxUltimateClient.respond("0/0/1", payload, "1.001");
146
146
 
147
147
  });
148
148
  knxUltimateClient.on(knx.KNXClient.KNXClientEvents.connecting, info => {
@@ -88,7 +88,7 @@ async function go() {
88
88
  // The client is connected
89
89
  console.log("Connected. On Duty", info)
90
90
  // Write something to the BUS
91
- if (knxUltimateClient._getClearToSend()) knxUltimateClient.write("0/1/1", false, "1.001");
91
+ if (knxUltimateClient.clearToSend) knxUltimateClient.write("0/1/1", false, "1.001");
92
92
  });
93
93
  knxUltimateClient.on(knx.KNXClient.KNXClientEvents.connecting, info => {
94
94
  // The client is setting up the connection
@@ -736,12 +736,12 @@ class KNXClient extends EventEmitter {
736
736
  }
737
737
  this._clearToSend = true
738
738
  this.emit(KNXClientEvents.error, timeoutErr)
739
- if (this.sysLogger !== undefined && this.sysLogger !== null) this.sysLogger.error('KNXClient: _setTimerWaitingForACK: ' + (timeoutErr.message || 'Undef error') + ' no ACK received. ABORT sending datagram with seqNumber ' + this._getSeqNumber() + ' from ' + knxTunnelingRequest.cEMIMessage.srcAddress.toString() + ' to ' + knxTunnelingRequest.cEMIMessage.dstAddress.toString())
739
+ if (this.sysLogger !== undefined && this.sysLogger !== null) this.sysLogger.error('KNXClient: _setTimerWaitingForACK: ' + (timeoutErr.message || 'Undef error') + ' no ACK received. ABORT sending datagram with seqNumber ' + this.getSeqNumber() + ' from ' + knxTunnelingRequest.cEMIMessage.srcAddress.toString() + ' to ' + knxTunnelingRequest.cEMIMessage.dstAddress.toString())
740
740
  } else {
741
741
  // 26/12/2021 // If no ACK received, resend the datagram once with the same sequence number
742
742
  this._setTimerWaitingForACK(knxTunnelingRequest)
743
743
  this.send(knxTunnelingRequest)
744
- if (this.sysLogger !== undefined && this.sysLogger !== null) this.sysLogger.error('KNXClient: _setTimerWaitingForACK: ' + (timeoutErr.message || 'Undef error') + ' no ACK received. Retransmit datagram with seqNumber ' + this._getSeqNumber() + ' from ' + knxTunnelingRequest.cEMIMessage.srcAddress.toString() + ' to ' + knxTunnelingRequest.cEMIMessage.dstAddress.toString())
744
+ if (this.sysLogger !== undefined && this.sysLogger !== null) this.sysLogger.error('KNXClient: _setTimerWaitingForACK: ' + (timeoutErr.message || 'Undef error') + ' no ACK received. Retransmit datagram with seqNumber ' + this.getSeqNumber() + ' from ' + knxTunnelingRequest.cEMIMessage.srcAddress.toString() + ' to ' + knxTunnelingRequest.cEMIMessage.dstAddress.toString())
745
745
  }
746
746
  } catch (error) { }
747
747
  }, KNXConstants.KNX_CONSTANTS.TUNNELING_REQUEST_TIMEOUT * 1000)
@@ -907,7 +907,7 @@ class KNXClient extends EventEmitter {
907
907
 
908
908
  // Check the received ACK sequence number
909
909
  if (!this._options.suppress_ack_ldatareq) {
910
- if (knxTunnelingAck.seqCounter === this._getSeqNumber()) {
910
+ if (knxTunnelingAck.seqCounter === this.getSeqNumber()) {
911
911
  if (this._timerWaitingForACK !== null) clearTimeout(this._timerWaitingForACK)
912
912
  this._numFailedTelegramACK = 0 // 25/12/2021 clear the current ACK failed telegram number
913
913
  this._clearToSend = true // I'm ready to send a new datagram now
@@ -0,0 +1,101 @@
1
+ const knxLog = require('../KnxLog');
2
+
3
+ function bitsToShutterPosition(bits) {
4
+ switch (bits) {
5
+ case 0b00: return 'intermediate';
6
+ case 0b01: return 'top';
7
+ case 0b10: return 'bottom';
8
+ default:
9
+ knxLog.get().error(`unknown position value: ${bits}`);
10
+ return null;
11
+ }
12
+ }
13
+
14
+ function shutterPositionToBits(position) {
15
+ switch (position) {
16
+ case 'intermediate': return 0b00;
17
+ case 'top': return 0b01;
18
+ case 'bottom': return 0b10;
19
+ default:
20
+ knxLog.get().error(`Unknown position: ${position}`);
21
+ return null;
22
+ }
23
+ }
24
+
25
+ function bitsToOperationMode(bits) {
26
+ switch (bits) {
27
+ case 0b000: return 'normal';
28
+ case 0b001: return 'priority';
29
+ case 0b010: return 'wind alarm';
30
+ case 0b011: return 'rain alarm';
31
+ case 0b100: return 'disabled';
32
+ default:
33
+ knxLog.get().error(`unknown operation mode value: ${bits}`);
34
+ return null;
35
+ }
36
+ }
37
+
38
+ function operationModeToBits(mode) {
39
+ switch (mode) {
40
+ case 'normal': return 0b000;
41
+ case 'priority': return 0b001;
42
+ case 'wind alarm': return 0b010;
43
+ case 'rain alarm': return 0b011;
44
+ case 'disabled': return 0b100;
45
+ default:
46
+ knxLog.get().error(`Unknown operation mode: ${mode}`);
47
+ return null;
48
+ }
49
+ }
50
+
51
+ // DPT2 frame description.
52
+ // Always 8-bit aligned.
53
+ exports.formatAPDU = function formatAPDU(value) {
54
+ if (!value) {
55
+ knxLog.get().error('DPT60002: cannot write null value');
56
+ return null;
57
+ }
58
+
59
+ let apduData;
60
+ if (typeof value === 'object'
61
+ && Object.prototype.hasOwnProperty.call(value, 'mode')
62
+ && Object.prototype.hasOwnProperty.call(value, 'position')) {
63
+ const mode = operationModeToBits(value.mode);
64
+ const position = shutterPositionToBits(value.position);
65
+ apduData = (mode << 2) + position;
66
+ } else {
67
+ knxLog.get().error('DPT60002: Must supply a value {mode: "normal"|"priority"|"wind|alarm"|"rain|alarm"|"disabled", position: "intermediate"|"top"|"bottom"}');
68
+ }
69
+ return Buffer.from([apduData]);
70
+ };
71
+
72
+ exports.fromBuffer = function fromBuffer(buf) {
73
+ if (buf.length !== 1) {
74
+ knxLog.get().error(`DPT60002: Buffer should be 1 byte long, got ${buf.length}`);
75
+ return null;
76
+ }
77
+
78
+ return {
79
+ mode: bitsToOperationMode((buf[0] >> 2) & 0b111),
80
+ position: bitsToShutterPosition(buf[0] & 0b11),
81
+ };
82
+ };
83
+
84
+ // DPT basetype info hash
85
+ exports.basetype = {
86
+ bitlength: 2,
87
+ valuetype: 'composite',
88
+ desc: 'Status object for Hager TXA223/225',
89
+ help:
90
+ `// This would usually only be received.
91
+ msg.payload = {position: "top", mode: "normal"};
92
+ return msg;`,
93
+ };
94
+
95
+ // DPT subtypes info hash
96
+ exports.subtypes = {
97
+ '001': {
98
+ name: 'Shutter state',
99
+ desc: 'Status object for Hager TXA223/225',
100
+ },
101
+ };
@@ -39,6 +39,8 @@ class KNXConnectResponse extends KNXPacket.KNXPacket {
39
39
  return 'Invalid Connection Option'
40
40
  case KNXConstants.KNX_CONSTANTS.E_NO_MORE_CONNECTIONS:
41
41
  return 'No More Connections'
42
+ case KNXConstants.KNX_CONSTANTS.E_NO_MORE_UNIQUE_CONNECTIONS:
43
+ return 'No More Unique Connections';
42
44
  case KNXConstants.KNX_CONSTANTS.E_DATA_CONNECTION:
43
45
  return 'Invalid Data Connection'
44
46
  case KNXConstants.KNX_CONSTANTS.E_KNX_CONNECTION:
@@ -34,6 +34,7 @@ exports.KNX_CONSTANTS = {
34
34
  E_CONNECTION_TYPE: 0x22,
35
35
  E_CONNECTION_OPTION: 0x23,
36
36
  E_NO_MORE_CONNECTIONS: 0x24,
37
+ E_NO_MORE_UNIQUE_CONNECTIONS: 0x25,
37
38
  E_DATA_CONNECTION: 0x26,
38
39
  E_KNX_CONNECTION: 0x27,
39
40
  E_TUNNELING_LAYER: 0x29,
@@ -5,7 +5,7 @@ const fs = require("fs");
5
5
  const path = require("path");
6
6
  const yaml = require('js-yaml');
7
7
  const loggerEngine = require("./utils/sysLogger.js");
8
- const dptlib = require("../KNXEngine/src/dptlib");
8
+ const dptlib = require('knxultimate').dptlib;
9
9
 
10
10
 
11
11
 
@@ -376,7 +376,7 @@ module.exports = (RED) => {
376
376
 
377
377
  RED.httpAdmin.get("/knxUltimateDpts", (req, res) => {
378
378
  try {
379
- const dpts = Object.entries(dptlib).filter(onlyDptKeys).map(extractBaseNo).sort(sortBy("base"))
379
+ const dpts = Object.entries(dptlib.dpts).filter(onlyDptKeys).map(extractBaseNo).sort(sortBy("base"))
380
380
  .reduce(toConcattedSubtypes, []);
381
381
  res.json(dpts);
382
382
  } catch (error) { }
@@ -408,7 +408,7 @@ module.exports = (RED) => {
408
408
  help: "NO",
409
409
  helplink: "https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/-SamplesHome",
410
410
  };
411
- const dpts = Object.entries(dptlib).filter(onlyDptKeys);
411
+ const dpts = Object.entries(dptlib.dpts).filter(onlyDptKeys);
412
412
  for (let index = 0; index < dpts.length; index++) {
413
413
  if (dpts[index][0].toUpperCase() === `DPT${sDPT}`) {
414
414
  jRet = {
@@ -1,3 +1,5 @@
1
+ <script type="text/javascript" src="resources/node-red-contrib-knx-ultimate/htmlUtils.js"></script>
2
+
1
3
  <script type="text/javascript">
2
4
  RED.nodes.registerType('hue-config', {
3
5
  category: 'config',
@@ -344,6 +344,14 @@ module.exports = (RED) => {
344
344
  id: resource.id,
345
345
  });
346
346
  }
347
+ if (_rtype === 'device_software_update') {
348
+ const Room = node.hueAllRooms.find((room) => room.children.find((child) => child.rid === resource.owner.rid))
349
+ const linkedDevName = node.hueAllResources.find((dev) => dev.type === 'device' && dev.services.find((serv) => serv.rid === resource.id)).metadata.name || ''
350
+ retArray.push({
351
+ name: `Software status: ${linkedDevName}${Room !== undefined ? `, room ${Room.metadata.name}` : ''}`,
352
+ id: resource.id,
353
+ });
354
+ }
347
355
  } catch (error) {
348
356
  retArray.push({
349
357
  name: `${_rtype}: ERROR ${error.message}`,
@@ -1,3 +1,5 @@
1
+ <script type="text/javascript" src="resources/node-red-contrib-knx-ultimate/htmlUtils.js"></script>
2
+
1
3
  <script type="text/javascript">
2
4
  RED.nodes.registerType('knxUltimate-config', {
3
5
  category: 'config',