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

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 (150) hide show
  1. package/.eslintrc.json +3 -2
  2. package/CHANGELOG.md +9 -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/knxUltimate-config.html +2 -0
  15. package/nodes/knxUltimate-config.js +226 -223
  16. package/nodes/knxUltimate.html +123 -56
  17. package/nodes/knxUltimate.js +100 -60
  18. package/nodes/knxUltimateAlerter.html +7 -12
  19. package/nodes/knxUltimateAlerter.js +2 -2
  20. package/nodes/knxUltimateGarageDoorBarrierOpener.html +7 -12
  21. package/nodes/knxUltimateGarageDoorBarrierOpener.js +2 -2
  22. package/nodes/knxUltimateGlobalContext.html +2 -0
  23. package/nodes/knxUltimateHueBattery.html +11 -14
  24. package/nodes/knxUltimateHueButton.html +27 -22
  25. package/nodes/knxUltimateHueButton.js +1 -1
  26. package/nodes/knxUltimateHueContactSensor.html +12 -8
  27. package/nodes/knxUltimateHueLight.html +17 -24
  28. package/nodes/knxUltimateHueLight.js +1 -2
  29. package/nodes/knxUltimateHueLightSensor.html +11 -14
  30. package/nodes/knxUltimateHueMotion.html +11 -14
  31. package/nodes/knxUltimateHueScene.html +24 -19
  32. package/nodes/knxUltimateHueScene.js +2 -1
  33. package/nodes/knxUltimateHueTapDial.html +11 -14
  34. package/nodes/knxUltimateHueTemperatureSensor.html +11 -14
  35. package/nodes/knxUltimateHueZigbeeConnectivity.html +11 -14
  36. package/nodes/knxUltimateLoadControl.html +4 -11
  37. package/nodes/knxUltimateLoadControl.js +1 -1
  38. package/nodes/knxUltimateLogger.html +3 -1
  39. package/nodes/knxUltimateSceneController.html +14 -15
  40. package/nodes/knxUltimateViewer.html +2 -0
  41. package/nodes/knxUltimateViewer.js +1 -1
  42. package/nodes/knxUltimateWatchDog.html +3 -1
  43. package/nodes/utils/payloadManipulation.js +49 -1
  44. package/nodes/utils/utils.js +4 -0
  45. package/package.json +4 -3
  46. package/resources/htmlUtils.js +27 -0
  47. /package/{KNXEngine → _JS_KNXEngine}/CHANGELOG.md +0 -0
  48. /package/{KNXEngine → _JS_KNXEngine}/LICENSE +0 -0
  49. /package/{KNXEngine → _JS_KNXEngine}/img/dpt 2.png +0 -0
  50. /package/{KNXEngine → _JS_KNXEngine}/img/dpt.png +0 -0
  51. /package/{KNXEngine → _JS_KNXEngine}/img/logo 2.png +0 -0
  52. /package/{KNXEngine → _JS_KNXEngine}/img/logo-big 2.png +0 -0
  53. /package/{KNXEngine → _JS_KNXEngine}/img/logo-big.png +0 -0
  54. /package/{KNXEngine → _JS_KNXEngine}/img/logo.png +0 -0
  55. /package/{KNXEngine → _JS_KNXEngine}/img/nodered 2.png +0 -0
  56. /package/{KNXEngine → _JS_KNXEngine}/img/nodered.png +0 -0
  57. /package/{KNXEngine → _JS_KNXEngine}/package.json +0 -0
  58. /package/{KNXEngine → _JS_KNXEngine}/simpleSample.js +0 -0
  59. /package/{KNXEngine → _JS_KNXEngine}/src/Curve25519.js +0 -0
  60. /package/{KNXEngine → _JS_KNXEngine}/src/KNXSocketOptions.js +0 -0
  61. /package/{KNXEngine → _JS_KNXEngine}/src/KNXsecureKeyring.js +0 -0
  62. /package/{KNXEngine → _JS_KNXEngine}/src/KnxLog.js +0 -0
  63. /package/{KNXEngine → _JS_KNXEngine}/src/cur.js +0 -0
  64. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt1.js +0 -0
  65. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt10.js +0 -0
  66. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt11.js +0 -0
  67. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt12.js +0 -0
  68. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt13.js +0 -0
  69. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt14.js +0 -0
  70. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt15.js +0 -0
  71. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt16.js +0 -0
  72. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt17.js +0 -0
  73. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt18.js +0 -0
  74. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt19.js +0 -0
  75. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt2.js +0 -0
  76. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt20.js +0 -0
  77. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt21.js +0 -0
  78. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt213.js +0 -0
  79. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt22.js +0 -0
  80. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt222.js +0 -0
  81. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt232.js +0 -0
  82. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt235.js +0 -0
  83. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt237.js +0 -0
  84. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt238.js +0 -0
  85. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt242.js +0 -0
  86. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt249.js +0 -0
  87. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt251.js +0 -0
  88. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt275.js +0 -0
  89. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt28.js +0 -0
  90. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt29.js +0 -0
  91. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt3.js +0 -0
  92. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt4.js +0 -0
  93. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt5.js +0 -0
  94. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt6.js +0 -0
  95. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt60001.js +0 -0
  96. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt7.js +0 -0
  97. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt8.js +0 -0
  98. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt9.js +0 -0
  99. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/dpt999.js +0 -0
  100. /package/{KNXEngine → _JS_KNXEngine}/src/dptlib/index.js +0 -0
  101. /package/{KNXEngine → _JS_KNXEngine}/src/errors/BufferLengthError.js +0 -0
  102. /package/{KNXEngine → _JS_KNXEngine}/src/errors/DateFormatError.js +0 -0
  103. /package/{KNXEngine → _JS_KNXEngine}/src/errors/DuplicateRequestError.js +0 -0
  104. /package/{KNXEngine → _JS_KNXEngine}/src/errors/InvalidValueError.js +0 -0
  105. /package/{KNXEngine → _JS_KNXEngine}/src/errors/NotImplementedError.js +0 -0
  106. /package/{KNXEngine → _JS_KNXEngine}/src/errors/RequestTimeoutError.js +0 -0
  107. /package/{KNXEngine → _JS_KNXEngine}/src/errors/index.js +0 -0
  108. /package/{KNXEngine → _JS_KNXEngine}/src/index.js +0 -0
  109. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/CRD.js +0 -0
  110. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/CRI.js +0 -0
  111. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/CRIFactory.js +0 -0
  112. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/DIB.js +0 -0
  113. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/DeviceInfo.js +0 -0
  114. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/HPAI.js +0 -0
  115. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/IPConfig.js +0 -0
  116. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/IPCurrentConfig.js +0 -0
  117. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXAddress.js +0 -0
  118. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXAddresses.js +0 -0
  119. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXConnectRequest.js +0 -0
  120. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXConnectionStateRequest.js +0 -0
  121. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXConnectionStateResponse.js +0 -0
  122. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXDataBuffer.js +0 -0
  123. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXDescriptionRequest.js +0 -0
  124. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXDescriptionResponse.js +0 -0
  125. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXDisconnectRequest.js +0 -0
  126. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXDisconnectResponse.js +0 -0
  127. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXHeader.js +0 -0
  128. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXPacket.js +0 -0
  129. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXProtocol.js +0 -0
  130. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXRoutingIndication.js +0 -0
  131. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXSearchRequest.js +0 -0
  132. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXSearchResponse.js +0 -0
  133. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXSecureSessionRequest.js +0 -0
  134. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXTunnelingAck.js +0 -0
  135. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXTunnelingRequest.js +0 -0
  136. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/KNXUtils.js +0 -0
  137. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/ServiceFamilies.js +0 -0
  138. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/TunnelCRI.js +0 -0
  139. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/AdditionalInfo.js +0 -0
  140. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/CEMIConstants.js +0 -0
  141. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/CEMIFactory.js +0 -0
  142. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/CEMIMessage.js +0 -0
  143. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/ControlField.js +0 -0
  144. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/LDataCon.js +0 -0
  145. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/LDataInd.js +0 -0
  146. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/LDataReq.js +0 -0
  147. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/NPDU.js +0 -0
  148. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/cEMI/TLVInfo.js +0 -0
  149. /package/{KNXEngine → _JS_KNXEngine}/src/protocol/index.js +0 -0
  150. /package/{KNXEngine → _JS_KNXEngine}/src/util/ipAddressHelper.js +0 -0
@@ -1,5 +1,7 @@
1
1
  <script type="text/javascript" src="resources/node-red-contrib-knx-ultimate/11f26b4500.js"></script>
2
2
 
3
+ <script type="text/javascript" src="resources/node-red-contrib-knx-ultimate/htmlUtils.js"></script>
4
+
3
5
  <script type="text/javascript">
4
6
  RED.nodes.registerType('knxUltimateHueScene', {
5
7
  category: "KNX Ultimate",
@@ -83,16 +85,7 @@
83
85
  } catch (error) { }
84
86
  });
85
87
 
86
- // 31/03/2020 Search Helper
87
- function fullSearch(sourceText, searchString) {
88
- // This searches for all words in a string
89
- var aSearchWords = searchString.toLowerCase().split(" ");
90
- var i = 0;
91
- for (let index = 0; index < aSearchWords.length; index++) {
92
- if (sourceText.toLowerCase().indexOf(aSearchWords[index]) > -1) i += 1;
93
- }
94
- return i == aSearchWords.length;
95
- }
88
+
96
89
 
97
90
  // DPT
98
91
  // ########################
@@ -122,13 +115,13 @@
122
115
 
123
116
  // Autocomplete suggestion with ETS csv File
124
117
  $("#node-input-GAscene").autocomplete({
125
- minLength: 1,
118
+ minLength: 0,
126
119
  source: function (request, response) {
127
120
  //$.getJSON("csv", request, function( data, status, xhr ) {
128
121
  $.getJSON("knxUltimatecsv?nodeID=" + oNodeServer.id, (data) => {
129
122
  response($.map(data, function (value, key) {
130
123
  var sSearch = (value.ga + " (" + value.devicename + ") DPT" + value.dpt);
131
- if (fullSearch(sSearch, request.term)) {
124
+ if (htmlUtilsfullCSVSearch(sSearch, request.term)) {
132
125
  if (value.dpt.startsWith("1.") || value.dpt.startsWith("18.")) {
133
126
  return {
134
127
  label: value.ga + " # " + value.devicename + " # " + value.dpt, // Label for Display
@@ -153,15 +146,18 @@
153
146
  $("#node-input-dptscene").val(optVal);
154
147
  ShowHideValScene();
155
148
  }
149
+ }).focus(function () {
150
+ $(this).autocomplete('search', $(this).val() + 'exactmatch');
156
151
  });
152
+
157
153
  $("#node-input-GAsceneStatus").autocomplete({
158
- minLength: 1,
154
+ minLength: 0,
159
155
  source: function (request, response) {
160
156
  //$.getJSON("csv", request, function( data, status, xhr ) {
161
157
  $.getJSON("knxUltimatecsv?nodeID=" + oNodeServer.id, (data) => {
162
158
  response($.map(data, function (value, key) {
163
159
  var sSearch = (value.ga + " (" + value.devicename + ") DPT" + value.dpt);
164
- if (fullSearch(sSearch, request.term)) {
160
+ if (htmlUtilsfullCSVSearch(sSearch, request.term)) {
165
161
  if (value.dpt.startsWith("1.")) {
166
162
  return {
167
163
  label: value.ga + " # " + value.devicename + " # " + value.dpt, // Label for Display
@@ -186,15 +182,18 @@
186
182
  $("#node-input-dptsceneStatus").val(optVal);
187
183
  ShowHideValScene();
188
184
  }
185
+ }).focus(function () {
186
+ $(this).autocomplete('search', $(this).val() + 'exactmatch');
189
187
  });
188
+
190
189
  $("#node-input-GAsceneMulti").autocomplete({
191
- minLength: 1,
190
+ minLength: 0,
192
191
  source: function (request, response) {
193
192
  //$.getJSON("csv", request, function( data, status, xhr ) {
194
193
  $.getJSON("knxUltimatecsv?nodeID=" + oNodeServer.id, (data) => {
195
194
  response($.map(data, function (value, key) {
196
195
  var sSearch = (value.ga + " (" + value.devicename + ") DPT" + value.dpt);
197
- if (fullSearch(sSearch, request.term)) {
196
+ if (htmlUtilsfullCSVSearch(sSearch, request.term)) {
198
197
  if (value.dpt.startsWith("18.")) {
199
198
  return {
200
199
  label: value.ga + " # " + value.devicename + " # " + value.dpt, // Label for Display
@@ -219,6 +218,8 @@
219
218
  $("#node-input-dptsceneMulti").val(optVal);
220
219
  ShowHideValScene();
221
220
  }
221
+ }).focus(function () {
222
+ $(this).autocomplete('search', $(this).val() + 'exactmatch');
222
223
  });
223
224
  // ########################
224
225
 
@@ -242,13 +243,13 @@
242
243
 
243
244
  // Autocomplete suggestion with HUE
244
245
  $("#node-input-name").autocomplete({
245
- minLength: 1,
246
+ minLength: 0,
246
247
  source: function (request, response) {
247
248
  $.getJSON("KNXUltimateGetResourcesHUE?rtype=scene&serverId=" + oNodeServerHue.id, (data) => {
248
249
  response($.map(data.devices, function (value, key) {
249
250
  //alert(JSON.stringify(value) + " "+ key)
250
251
  var sSearch = (value.name);
251
- if (fullSearch(sSearch, request.term)) {
252
+ if (htmlUtilsfullCSVSearch(sSearch, request.term)) {
252
253
  return {
253
254
  hueDevice: value.id, // Label for Display
254
255
  value: value.name // Value
@@ -262,6 +263,8 @@
262
263
  // Sets the fields
263
264
  $('#node-input-hueDevice').val(ui.item.hueDevice);
264
265
  }
266
+ }).focus(function () {
267
+ $(this).autocomplete('search', $(this).val() + 'exactmatch');
265
268
  });
266
269
  // ########################
267
270
 
@@ -344,7 +347,7 @@
344
347
  response($.map(data.devices, function (value, key) {
345
348
  //alert(JSON.stringify(value) + " "+ key)
346
349
  var sSearch = (value.name);
347
- if (fullSearch(sSearch, request.term)) {
350
+ if (htmlUtilsfullCSVSearch(sSearch, request.term)) {
348
351
  return {
349
352
  hueDevice: value.id, // Label for Display
350
353
  value: value.name // Value
@@ -358,6 +361,8 @@
358
361
  // Sets Datapoint and device name automatically
359
362
  rowRuleHUESceneID.val(ui.item.hueDevice);
360
363
  }
364
+ }).focus(function () {
365
+ $(this).autocomplete('search', $(this).val() + 'exactmatch');
361
366
  });
362
367
  rowRuleRecallAs.val(rule.rowRuleRecallAs)
363
368
  rowRuleHUESceneName.val(rule.rowRuleHUESceneName);
@@ -1,7 +1,8 @@
1
1
  /* eslint-disable max-len */
2
- const dptlib = require('./../KNXEngine/src/dptlib');
2
+ const dptlib = require('knxultimate').dptlib;//require('knxultimate').dptlib;
3
3
 
4
4
  module.exports = function (RED) {
5
+
5
6
  function knxUltimateHueScene(config) {
6
7
  RED.nodes.createNode(this, config);
7
8
  const node = this;
@@ -1,5 +1,7 @@
1
1
  <script type="text/javascript" src="resources/node-red-contrib-knx-ultimate/11f26b4500.js"></script>
2
2
 
3
+ <script type="text/javascript" src="resources/node-red-contrib-knx-ultimate/htmlUtils.js"></script>
4
+
3
5
  <script type="text/javascript">
4
6
  RED.nodes.registerType('knxUltimateHueTapDial', {
5
7
  category: "KNX Ultimate",
@@ -55,16 +57,7 @@
55
57
  } catch (error) { }
56
58
  });
57
59
 
58
- // 31/03/2020 Search Helper
59
- function fullSearch(sourceText, searchString) {
60
- // This searches for all words in a string
61
- var aSearchWords = searchString.toLowerCase().split(" ");
62
- var i = 0;
63
- for (let index = 0; index < aSearchWords.length; index++) {
64
- if (sourceText.toLowerCase().indexOf(aSearchWords[index]) > -1) i += 1;
65
- }
66
- return i == aSearchWords.length;
67
- }
60
+
68
61
 
69
62
 
70
63
  // DPT repeat
@@ -83,12 +76,12 @@
83
76
 
84
77
  // Autocomplete suggestion with ETS csv File
85
78
  $("#node-input-GArepeat").autocomplete({
86
- minLength: 1,
79
+ minLength: 0,
87
80
  source: function (request, response) {
88
81
  $.getJSON("knxUltimatecsv?nodeID=" + oNodeServer.id, (data) => {
89
82
  response($.map(data, function (value, key) {
90
83
  var sSearch = (value.ga + " (" + value.devicename + ") DPT" + value.dpt);
91
- if (fullSearch(sSearch, request.term)) {
84
+ if (htmlUtilsfullCSVSearch(sSearch, request.term)) {
92
85
  if (value.dpt.startsWith('5.001') || value.dpt.startsWith('3.007') || value.dpt.startsWith("232.600")) {
93
86
  return {
94
87
  label: value.ga + " # " + value.devicename + " # " + value.dpt, // Label for Display
@@ -112,6 +105,8 @@
112
105
  // Select the option value
113
106
  $("#node-input-dptrepeat").val(optVal);
114
107
  }
108
+ }).focus(function () {
109
+ $(this).autocomplete('search', $(this).val() + 'exactmatch');
115
110
  });
116
111
 
117
112
 
@@ -119,13 +114,13 @@
119
114
 
120
115
  // Autocomplete suggestion with HUE
121
116
  $("#node-input-name").autocomplete({
122
- minLength: 1,
117
+ minLength: 0,
123
118
  source: function (request, response) {
124
119
  $.getJSON("KNXUltimateGetResourcesHUE?rtype=relative_rotary&serverId=" + oNodeServerHue.id, (data) => {
125
120
  response($.map(data.devices, function (value, key) {
126
121
  //alert(JSON.stringify(value) + " "+ key)
127
122
  var sSearch = (value.name);
128
- if (fullSearch(sSearch, request.term)) {
123
+ if (htmlUtilsfullCSVSearch(sSearch, request.term)) {
129
124
  return {
130
125
  hueDevice: value.id, // Label for Display
131
126
  value: value.name // Value
@@ -139,6 +134,8 @@
139
134
  // Sets the fields
140
135
  $('#node-input-hueDevice').val(ui.item.hueDevice);
141
136
  }
137
+ }).focus(function () {
138
+ $(this).autocomplete('search', $(this).val() + 'exactmatch');
142
139
  });
143
140
 
144
141
 
@@ -1,5 +1,7 @@
1
1
  <script type="text/javascript" src="resources/node-red-contrib-knx-ultimate/11f26b4500.js"></script>
2
2
 
3
+ <script type="text/javascript" src="resources/node-red-contrib-knx-ultimate/htmlUtils.js"></script>
4
+
3
5
  <script type="text/javascript">
4
6
  RED.nodes.registerType('knxUltimateHueTemperatureSensor', {
5
7
  category: "KNX Ultimate",
@@ -56,16 +58,7 @@
56
58
  } catch (error) { }
57
59
  });
58
60
 
59
- // 31/03/2020 Search Helper
60
- function fullSearch(sourceText, searchString) {
61
- // This searches for all words in a string
62
- var aSearchWords = searchString.toLowerCase().split(" ");
63
- var i = 0;
64
- for (let index = 0; index < aSearchWords.length; index++) {
65
- if (sourceText.toLowerCase().indexOf(aSearchWords[index]) > -1) i += 1;
66
- }
67
- return i == aSearchWords.length;
68
- }
61
+
69
62
 
70
63
  // DPT
71
64
  // ########################
@@ -82,13 +75,13 @@
82
75
 
83
76
  // Autocomplete suggestion with ETS csv File
84
77
  $("#node-input-GAtemperaturesensor").autocomplete({
85
- minLength: 1,
78
+ minLength: 0,
86
79
  source: function (request, response) {
87
80
  //$.getJSON("csv", request, function( data, status, xhr ) {
88
81
  $.getJSON("knxUltimatecsv?nodeID=" + oNodeServer.id, (data) => {
89
82
  response($.map(data, function (value, key) {
90
83
  var sSearch = (value.ga + " (" + value.devicename + ") DPT" + value.dpt);
91
- if (fullSearch(sSearch, request.term + " 9.001")) {
84
+ if (htmlUtilsfullCSVSearch(sSearch, request.term + " 9.001")) {
92
85
  return {
93
86
  label: value.ga + " # " + value.devicename + " # " + value.dpt, // Label for Display
94
87
  value: value.ga // Value
@@ -110,6 +103,8 @@
110
103
  // Select the option value
111
104
  $("#node-input-dpttemperaturesensor").val(optVal);
112
105
  }
106
+ }).focus(function () {
107
+ $(this).autocomplete('search', $(this).val() + 'exactmatch');
113
108
  });
114
109
  // ########################
115
110
 
@@ -118,13 +113,13 @@
118
113
 
119
114
  // Autocomplete suggestion with HUE
120
115
  $("#node-input-name").autocomplete({
121
- minLength: 1,
116
+ minLength: 0,
122
117
  source: function (request, response) {
123
118
  $.getJSON("KNXUltimateGetResourcesHUE?rtype=temperature&serverId=" + oNodeServerHue.id, (data) => {
124
119
  response($.map(data.devices, function (value, key) {
125
120
  //alert(JSON.stringify(value) + " "+ key)
126
121
  var sSearch = (value.name);
127
- if (fullSearch(sSearch, request.term)) {
122
+ if (htmlUtilsfullCSVSearch(sSearch, request.term)) {
128
123
  return {
129
124
  hueDevice: value.id, // Label for Display
130
125
  value: value.name // Value
@@ -138,6 +133,8 @@
138
133
  // Sets the fields
139
134
  $('#node-input-hueDevice').val(ui.item.hueDevice);
140
135
  }
136
+ }).focus(function () {
137
+ $(this).autocomplete('search', $(this).val() + 'exactmatch');
141
138
  });
142
139
 
143
140
 
@@ -1,5 +1,7 @@
1
1
  <script type="text/javascript" src="resources/node-red-contrib-knx-ultimate/11f26b4500.js"></script>
2
2
 
3
+ <script type="text/javascript" src="resources/node-red-contrib-knx-ultimate/htmlUtils.js"></script>
4
+
3
5
  <script type="text/javascript">
4
6
  RED.nodes.registerType('knxUltimateHueZigbeeConnectivity', {
5
7
  category: "KNX Ultimate",
@@ -57,16 +59,7 @@
57
59
  } catch (error) { }
58
60
  });
59
61
 
60
- // 31/03/2020 Search Helper
61
- function fullSearch(sourceText, searchString) {
62
- // This searches for all words in a string
63
- var aSearchWords = searchString.toLowerCase().split(" ");
64
- var i = 0;
65
- for (let index = 0; index < aSearchWords.length; index++) {
66
- if (sourceText.toLowerCase().indexOf(aSearchWords[index]) > -1) i += 1;
67
- }
68
- return i == aSearchWords.length;
69
- }
62
+
70
63
 
71
64
  // DPT
72
65
  // ########################
@@ -83,13 +76,13 @@
83
76
 
84
77
  // Autocomplete suggestion with ETS csv File
85
78
  $("#node-input-GAzigbeeconnectivity").autocomplete({
86
- minLength: 1,
79
+ minLength: 0,
87
80
  source: function (request, response) {
88
81
  //$.getJSON("csv", request, function( data, status, xhr ) {
89
82
  $.getJSON("knxUltimatecsv?nodeID=" + oNodeServer.id, (data) => {
90
83
  response($.map(data, function (value, key) {
91
84
  var sSearch = (value.ga + " (" + value.devicename + ") DPT" + value.dpt);
92
- if (fullSearch(sSearch, request.term + " 1.")) {
85
+ if (htmlUtilsfullCSVSearch(sSearch, request.term + " 1.")) {
93
86
  return {
94
87
  label: value.ga + " # " + value.devicename + " # " + value.dpt, // Label for Display
95
88
  value: value.ga // Value
@@ -111,6 +104,8 @@
111
104
  // Select the option value
112
105
  $("#node-input-dptzigbeeconnectivity").val(optVal);
113
106
  }
107
+ }).focus(function () {
108
+ $(this).autocomplete('search', $(this).val() + 'exactmatch');
114
109
  });
115
110
  // ########################
116
111
 
@@ -119,13 +114,13 @@
119
114
 
120
115
  // Autocomplete suggestion with HUE
121
116
  $("#node-input-name").autocomplete({
122
- minLength: 1,
117
+ minLength: 0,
123
118
  source: function (request, response) {
124
119
  $.getJSON("KNXUltimateGetResourcesHUE?rtype=zigbee_connectivity&serverId=" + oNodeServerHue.id, (data) => {
125
120
  response($.map(data.devices, function (value, key) {
126
121
  //alert(JSON.stringify(value) + " "+ key)
127
122
  var sSearch = (value.name);
128
- if (fullSearch(sSearch, request.term)) {
123
+ if (htmlUtilsfullCSVSearch(sSearch, request.term)) {
129
124
  return {
130
125
  hueDevice: value.id, // Label for Display
131
126
  value: value.name // Value
@@ -139,6 +134,8 @@
139
134
  // Sets the fields
140
135
  $('#node-input-hueDevice').val(ui.item.hueDevice);
141
136
  }
137
+ }).focus(function () {
138
+ $(this).autocomplete('search', $(this).val() + 'exactmatch');
142
139
  });
143
140
 
144
141
 
@@ -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('knxUltimateLoadControl', {
3
5
  category: "KNX Ultimate",
@@ -79,16 +81,7 @@
79
81
  } catch (error) { }
80
82
  });
81
83
 
82
- // 31/03/2020 Search Helper
83
- function fullSearch(sourceText, searchString) {
84
- // This searches for all words in a string
85
- var aSearchWords = searchString.toLowerCase().split(" ");
86
- var i = 0;
87
- for (let index = 0; index < aSearchWords.length; index++) {
88
- if (sourceText.toLowerCase().indexOf(aSearchWords[index]) > -1) i += 1;
89
- }
90
- return i == aSearchWords.length;
91
- }
84
+
92
85
 
93
86
  $.getJSON("knxUltimateDpts?serverId=" + $("#node-input-server").val(), (data) => {
94
87
  data.forEach(dpt => {
@@ -119,7 +112,7 @@
119
112
  $.getJSON("knxUltimatecsv?nodeID=" + oNodeServer.id, (data) => {
120
113
  response($.map(data, function (value, key) {
121
114
  var sSearch = (value.ga + " (" + value.devicename + ") DPT" + value.dpt);
122
- if (fullSearch(sSearch, request.term)) {
115
+ if (htmlUtilsfullCSVSearch(sSearch, request.term)) {
123
116
  return {
124
117
  label: value.ga + " # " + value.devicename + " # " + value.dpt, // Label for Display
125
118
  value: value.ga // Value
@@ -1,7 +1,7 @@
1
1
 
2
2
  module.exports = function (RED) {
3
3
  function knxUltimateLoadControl(config) {
4
- // const Address = require('./../KNXEngine/src/protocol/KNXAddress')
4
+ // const Address = require('knxultimate')
5
5
 
6
6
  RED.nodes.createNode(this, config)
7
7
  const node = this
@@ -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('knxUltimateLogger', {
3
5
  category: "KNX Ultimate",
@@ -11,7 +13,7 @@
11
13
  maxRowsInETSXML: { value: 0, required: true, validate: RED.validators.number() },
12
14
  autoStartTimerTelegramCounter: { value: false },
13
15
  intervalTelegramCount: { value: 60, required: false, validate: RED.validators.number() }
14
-
16
+
15
17
  },
16
18
  inputs: 1,
17
19
  outputs: 2,
@@ -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('knxUltimateSceneController', {
3
5
  category: "KNX Ultimate",
@@ -50,16 +52,7 @@
50
52
  } catch (error) { }
51
53
  });
52
54
 
53
- // 31/03/2020 Search Helper
54
- function fullSearch(sourceText, searchString) {
55
- // This searches for all words in a string
56
- var aSearchWords = searchString.toLowerCase().split(" ");
57
- var i = 0;
58
- for (let index = 0; index < aSearchWords.length; index++) {
59
- if (sourceText.toLowerCase().indexOf(aSearchWords[index]) > -1) i += 1;
60
- }
61
- return i == aSearchWords.length;
62
- }
55
+
63
56
 
64
57
  // DPT of Scene Recall
65
58
  // ########################
@@ -74,13 +67,13 @@
74
67
 
75
68
  // Autocomplete suggestion with ETS csv File
76
69
  $("#node-input-topic").autocomplete({
77
- minLength: 1,
70
+ minLength: 0,
78
71
  source: function (request, response) {
79
72
  //$.getJSON("csv", request, function( data, status, xhr ) {
80
73
  $.getJSON("knxUltimatecsv?nodeID=" + oNodeServer.id, (data) => {
81
74
  response($.map(data, function (value, key) {
82
75
  var sSearch = (value.ga + " (" + value.devicename + ") DPT" + value.dpt);
83
- if (fullSearch(sSearch, request.term)) {
76
+ if (htmlUtilsfullCSVSearch(sSearch, request.term)) {
84
77
  return {
85
78
  label: value.ga + " # " + value.devicename + " # " + value.dpt, // Label for Display
86
79
  value: value.ga // Value
@@ -103,6 +96,8 @@
103
96
  $("#node-input-dpt").val(optVal);
104
97
  $("#node-input-dpt").trigger("change");
105
98
  }
99
+ }).focus(function () {
100
+ $(this).autocomplete('search', $(this).val() + 'exactmatch');
106
101
  });
107
102
 
108
103
  // 19/03/2020 Adjust trigger value accordingly
@@ -196,12 +191,12 @@
196
191
 
197
192
  // Autocomplete suggestion with ETS csv File
198
193
  $("#node-input-topicSave").autocomplete({
199
- minLength: 1,
194
+ minLength: 0,
200
195
  source: function (request, response) {
201
196
  $.getJSON("knxUltimatecsv?nodeID=" + oNodeServer.id, (data) => {
202
197
  response($.map(data, function (value, key) {
203
198
  var sSearch = (value.ga + " (" + value.devicename + ") DPT" + value.dpt);
204
- if (fullSearch(sSearch, request.term)) {
199
+ if (htmlUtilsfullCSVSearch(sSearch, request.term)) {
205
200
  return {
206
201
  label: value.ga + " # " + value.devicename + " # " + value.dpt, // Label for Display
207
202
  value: value.ga // Value
@@ -224,6 +219,8 @@
224
219
  $("#node-input-dptSave").val(optVal);
225
220
  $("#node-input-dptSave").trigger("change");
226
221
  }
222
+ }).focus(function () {
223
+ $(this).autocomplete('search', $(this).val() + 'exactmatch');
227
224
  });
228
225
 
229
226
  // 02/04/2020 Adjust trigger value accordingly
@@ -340,7 +337,7 @@
340
337
  $.getJSON("knxUltimatecsv?nodeID=" + oNodeServer.id, (data) => {
341
338
  response($.map(data, function (value, key) {
342
339
  var sSearch = (value.ga + " (" + value.devicename + ") DPT" + value.dpt);
343
- if (fullSearch(sSearch, request.term)) {
340
+ if (htmlUtilsfullCSVSearch(sSearch, request.term)) {
344
341
  return {
345
342
  label: value.ga + " # " + value.devicename + " # " + value.dpt, // Label for Display
346
343
  value: value.ga // Value
@@ -361,6 +358,8 @@
361
358
  var optVal = $(".rowRuleDPT option:contains('" + ui.item.label.split("#")[2].trim() + "')").attr('value');
362
359
  oDPTField.val(optVal);
363
360
  }
361
+ }).focus(function () {
362
+ $(this).autocomplete('search', $(this).val() + 'exactmatch');
364
363
  });
365
364
 
366
365
  oTopicField.val(rule.topic);
@@ -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('knxUltimateViewer', {
3
5
  category: "KNX Ultimate",
@@ -1,4 +1,4 @@
1
- const KNXAddress = require('./../KNXEngine/src/protocol/KNXAddress').KNXAddress;
1
+ const KNXAddress = require('knxultimate').KNXAddress;
2
2
 
3
3
  module.exports = function (RED) {
4
4
  function knxUltimateViewer(config) {
@@ -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('knxUltimateWatchDog', {
3
5
  category: "KNX Ultimate",
@@ -16,7 +18,7 @@
16
18
  outputLabels: ["Output"],
17
19
  icon: "node-watchdog-icon.svg",
18
20
  label: function () {
19
- return ((this.name || "KNX Watchdog") + " " + (this.checkLevel == "Ethernet" ? "Gateway IP": this.topic));
21
+ return ((this.name || "KNX Watchdog") + " " + (this.checkLevel == "Ethernet" ? "Gateway IP" : this.topic));
20
22
  },
21
23
  paletteLabel: "KNX WatchDog",
22
24
  oneditprepare: function () {
@@ -2,7 +2,7 @@
2
2
  * @param {object} [_oNode]
3
3
  * @param {any} [jsValue]
4
4
  */
5
- exports.Manipulate = function roundPayload (_oNode, jsValue) {
5
+ exports.Manipulate = function roundPayload(_oNode, jsValue) {
6
6
  // 19/01/2023 FORMATTING THE OUTPUT PAYLOAD BASED ON SINGLE NODE SETUP
7
7
  //* ********************************************************
8
8
  // Formatting the msg output value
@@ -38,3 +38,51 @@ exports.Manipulate = function roundPayload (_oNode, jsValue) {
38
38
  }
39
39
  //* ********************************************************
40
40
  }
41
+
42
+ // KNXULtimate nodes
43
+ module.exports.KNXULtimateChangeConfigByInputMSG = function KNXULtimateChangeConfigByInputMSG(msg, node, config) {
44
+
45
+ if (!msg.setConfig.hasOwnProperty('setGroupAddress') || !msg.setConfig.hasOwnProperty('setDPT')) {
46
+ node.setNodeStatus({
47
+ fill: 'red', shape: 'ring', text: `setGroupAddress and setDPT are mandatory`, payload: '', GA: '', dpt: '', devicename: '',
48
+ });
49
+ return;
50
+ }
51
+
52
+ // Set DPT
53
+ node.dpt = msg.setConfig.setDPT;
54
+ config.dpt = msg.setConfig.setDPT;
55
+
56
+ // SET GORUP ADDRESS
57
+ node.topic = msg.setConfig.setGroupAddress;
58
+ config.topic = msg.setConfig.setGroupAddress
59
+ node.outputtopic = (config.outputtopic === undefined || config.outputtopic === '') ? msg.setConfig.setGroupAddress : config.outputtopic; // 07/02/2020 Importante, per retrocompatibilità
60
+ config.outputtopic = node.outputtopic;
61
+
62
+ // Read from the ETS file, the missing props
63
+ if (node.server.csv !== undefined && node.server.csv !== null) {
64
+ // Read it from ETS File
65
+ const found = node.server.csv.find(item => item.ga === msg.setConfig.setGroupAddress);
66
+ if (found !== undefined) {
67
+ if (msg.setConfig.setDPT === 'auto') {
68
+ node.dpt = found.dpt; // SET THE DPT
69
+ config.dpt = found.dpt;
70
+ }
71
+ node.name = found.devicename;
72
+ config.name = found.devicename;
73
+ }
74
+ }
75
+ // If DPT is still "auto", something has going wrong
76
+ if (node.dpt === 'auto') {
77
+ // Unable to retrieve the datapoint
78
+ node.setNodeStatus({
79
+ fill: 'red', shape: 'ring', text: `Unable to retrieve the datapoint from the ETS file`, payload: '', GA: '', dpt: '', devicename: '',
80
+ });
81
+ if (node.sysLogger !== undefined && node.sysLogger !== null) node.sysLogger.error(`knxUltimate: setConfig: Node.id: ${node.id} error: Unable to retrieve the datapoint from the ETS file`);
82
+ } else {
83
+ node.setNodeStatus({
84
+ fill: 'blue', shape: 'ring', text: `Config changed. Current GA: ${node.topic} DPT: ${node.dpt}`, payload: '', GA: '', dpt: '', devicename: node.name,
85
+ });
86
+ }
87
+
88
+ };
@@ -53,5 +53,9 @@ module.exports.fetchFromObject = function fetchFromObject(
53
53
  if (typeof _msg[_payloadPropName] === "object") return undefined;
54
54
  return _msg[_payloadPropName];
55
55
  };
56
+
57
+
56
58
  const DEFAULTTRANSLATIONINPUT =
57
59
  "on:true\noff:false\nactive:true\ninactive:false\nopen:true\nclosed:false\nclose:false\n1:true\n0:false\ntrue:true\nfalse:false\nhome:true\nnot_home:false\nnormal:false\nviolated:true";
60
+
61
+
package/package.json CHANGED
@@ -3,13 +3,15 @@
3
3
  "engines": {
4
4
  "node": ">=16.0.0"
5
5
  },
6
- "version": "2.5.1",
6
+ "version": "3.0.0-beta1",
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",
10
10
  "crypto-js": "4.2.0",
11
11
  "dns-sync": "0.2.1",
12
12
  "eventsource": "2.0.2",
13
+ "js-yaml": "4.1.0",
14
+ "knxultimate": ">=2.3.3",
13
15
  "lodash": "4.17.21",
14
16
  "log-driver": "1.2.7",
15
17
  "mkdirp": "3.0.1",
@@ -17,8 +19,7 @@
17
19
  "path": "0.12.7",
18
20
  "ping": "0.4.4",
19
21
  "simple-get": "4.0.1",
20
- "xml2js": "0.6.0",
21
- "js-yaml": "4.1.0"
22
+ "xml2js": "0.6.0"
22
23
  },
23
24
  "node-red": {
24
25
  "version": ">=3.1.1",