node-red-contrib-knx-ultimate 1.3.28 → 1.3.29

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,6 +6,11 @@
6
6
 
7
7
  # CHANGELOG
8
8
 
9
+ <p>
10
+ <b>Version 1.3.29</b> - February 2022<br/>
11
+ - Load Control: the timer for shedding won't everytime obey to what you've set. Fixed. <br/>
12
+ - Load Control: Added pre-shedding yellow warning message in the node status.<br/>
13
+ </p>
9
14
  <p>
10
15
  <b>Version 1.3.28</b> - February 2022<br/>
11
16
  - NEW: KNX Viewer: this node allow you to see all datapints and values in a dashboard wirget. https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/knxUltimateViewer<br/>
package/README.md CHANGED
@@ -7,13 +7,13 @@
7
7
  [![NPM downloads total][npm-downloads-total-image]][npm-url]
8
8
  [![MIT License][license-image]][license-url]
9
9
  [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
10
- [![Facebook][facebook-image]][facebook-url]
10
+ [![Youtube][youtube-image]][youtube-url]
11
11
  [![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square)](https://www.paypal.me/techtoday)
12
12
 
13
13
 
14
14
  ![Sample Node](img/readmemain.png)
15
15
 
16
- Control your KNX intallation via Node-Red! Single Node KNX IN/OUT with optional ETS group address importer and gateway simulation. Easy to use and highly configurable.
16
+ Control your KNX intallation via Node-Red!
17
17
 
18
18
  **You can use it immediately!**
19
19
  ```javascript
@@ -29,7 +29,8 @@ payload = {red:255, green:200, blue:30} // Put some colors in our life
29
29
  * **LOGGER node** [here](https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/Logger-Configuration), creates an XML diagnostic file, compatible with ETS. You can open it with ETS for diagnostic pourposes. Node: the Logger currently doesn't record the telegrams coming from KNX-Ultimate if you use a **KNX/IP Interface**.
30
30
  * **GLOBAL CONTEXT node** [here](https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/GlobalVariable), exposes the group addresses to a Global Context variable, to be used in function nodes.
31
31
  * **ALERTER node** [here](https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/Alerter-Configuration). With the Alerter node you can signal to a display or to the node-red-contrib-tts-ultimate node (audio feedback), whenever the selected devices are alerted, i.e. they have payload **true**.
32
-
32
+ * **LOAD CONTROL node** [here](https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/LoadControl-Configuration). Control your loads (Oven, Washing machine, etc..) and avoit shutting down the main voltage due to too high power consumption.
33
+ * **VIEWER node** [here](https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/knxUltimateViewer). View all Group Addresses and values of your KNX BUS, in the Node-Red Dashboard.
33
34
 
34
35
  ## CHANGELOG
35
36
 
@@ -67,8 +68,7 @@ Click your language to go to the documentation.<br/>
67
68
  ## STARTER PACK
68
69
 
69
70
  * [Wiki and Help](https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki)
70
- * [Youtube video](https://www.youtube.com/playlist?list=PL9Yh1bjbLAYpfy1Auz6CKDfXUusgMwOQr)
71
- * [Facebook page](https://www.facebook.com/supergiovaneDev)
71
+ * [Youtube channel](https://www.youtube.com/playlist?list=PL9Yh1bjbLAYpfy1Auz6CKDfXUusgMwOQr)
72
72
  * [FAQ + Troubleshoot](https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/5.-FAQ-Troubleshoot)
73
73
  * [Security best practices](https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/SECURITY)
74
74
 
@@ -297,11 +297,11 @@ List of commercial companies, which have given us permission to be mentioned on
297
297
  ## FRIENDLY COMMUNITIES AROUND THE WORLD
298
298
 
299
299
  **Italy**
300
- * [VivereSmart](https://www.facebook.com/groups/viveresmart)
300
+ * [![](https://raw.githubusercontent.com/Supergiovane/node-red-contrib-knx-ultimate/master/img/c/viveresmart.png)](https://www.facebook.com/groups/viveresmart)
301
301
  * [VivereSmart TV](https://www.youtube.com/channel/UC6GlFhcbNuoSEejZ_HlCynA)
302
302
 
303
303
  **Germany**
304
- * [knx-user-forum](https://knx-user-forum.de/forum/öffentlicher-bereich/knx-eib-forum/1389088-knx-node-for-node-red)
304
+ * [![](https://raw.githubusercontent.com/Supergiovane/node-red-contrib-knx-ultimate/master/img/c/knxuserforum.png)](https://knx-user-forum.de/forum/öffentlicher-bereich/knx-eib-forum/1389088-knx-node-for-node-red)
305
305
 
306
306
  **China**
307
307
  * [QQ group: 837579219 (加群需要备注 “来自github”](tencent://groupwpa/?subcmd=all&param=7b2267726f757055696e223a3833373537393231392c2274696d655374616d70223a313633303934363639312c22617574684b6579223a22762b72482b466f4a496a75613033794e4a30744a6970756c55753639424f4d55724f464c4a6c474b77346a30326b7a4f7a3338535536517844684d7756414d62222c2261757468223a22227d&jump_from=)
@@ -319,5 +319,5 @@ List of commercial companies, which have given us permission to be mentioned on
319
319
  [npm-version-image]: https://img.shields.io/npm/v/node-red-contrib-knx-ultimate.svg
320
320
  [npm-downloads-month-image]: https://img.shields.io/npm/dm/node-red-contrib-knx-ultimate.svg
321
321
  [npm-downloads-total-image]: https://img.shields.io/npm/dt/node-red-contrib-knx-ultimate.svg
322
- [facebook-image]: https://img.shields.io/badge/Visit%20me-Facebook-blue
323
- [facebook-url]: https://www.facebook.com/supergiovaneDev
322
+ [youtube-image]: https://img.shields.io/badge/Visit%20me-Youtube-red
323
+ [youtube-url]: https://www.youtube.com/channel/UCA9RsLps1IthT7fDSeUbRZw/playlists
package/img/c/agata.png CHANGED
Binary file
Binary file
Binary file
@@ -81,7 +81,6 @@ module.exports = function (RED) {
81
81
  node.status({ fill: fill, shape: shape, text: text + " Shed:" + node.sheddingStage + " Power:" + node.totalWatt + "W" + " Limit:" + node.wattLimit + "W (" + dDate.getDate() + ", " + dDate.toLocaleTimeString() + ")" });
82
82
  } catch (error) {
83
83
  }
84
-
85
84
  }
86
85
 
87
86
  // This function is called by the knx-ultimate config node.
@@ -90,8 +89,13 @@ module.exports = function (RED) {
90
89
  // Update the Total Watt?
91
90
  if (msg.topic === node.topic && msg.payload !== "" && msg.payload !== null && msg.payload !== undefined) {
92
91
  node.totalWatt = msg.payload;
93
- // Update current consumption
94
- node.setLocalStatus({ fill: "blue" });
92
+ // Update current consumption only if the node is in idle state
93
+ if (node.timerIncreaseShedding === null && node.timerDecreaseShedding === null) {
94
+ if (node.setLocalStatusTotalWattTimer === null) clearInterval(node.setLocalStatusTotalWattTimer);
95
+ node.setLocalStatusTotalWattTimer = setTimeout(() => {
96
+ node.setLocalStatus({ fill: "grey" });
97
+ }, 2000);
98
+ }
95
99
  return;
96
100
  }
97
101
 
@@ -123,7 +127,7 @@ module.exports = function (RED) {
123
127
  node.initialReadAllDevicesInRules = () => {
124
128
  if (node.server) {
125
129
  // Read status of the Total Power GA
126
- node.server.writeQueueAdd({ grpaddr: node.topic, payload: "", dpt: "", outputtype: "read", nodecallerid: node.id });
130
+ if (node.topic !== undefined && node.topic !== null && node.topic !== "") node.server.writeQueueAdd({ grpaddr: node.topic, payload: "", dpt: "", outputtype: "read", nodecallerid: node.id });
127
131
 
128
132
  for (var i = 0; i < node.deviceList.length; i++) {
129
133
  let grpaddr = node.deviceList[i].monitorGA;
@@ -143,27 +147,55 @@ module.exports = function (RED) {
143
147
  }
144
148
  }
145
149
 
150
+ node.startMainTimer = () => {
151
+ if (node.mainTimer !== null) clearInterval(node.mainTimer);// Clear the timer
152
+ node.mainTimer = setInterval(() => {
153
+ // Issue a READ on all GA's
154
+ node.initialReadAllDevicesInRules();
155
+
156
+ // Check consumption
157
+ if (node.totalWatt > node.wattLimit) {
158
+ // Start increasing shedding!
159
+ if (node.sheddingStage < node.deviceList.length) {
160
+ if (node.timerIncreaseShedding === null) {
161
+ setTimeout(() => {
162
+ node.setLocalStatus({ fill: "yellow", shape: "dot", text: "I'm about to shed the load " + node.sheddingStage, payload: "", GA: "", dpt: "", devicename: "" });
163
+ }, 2000);
164
+ if (node.timerDecreaseShedding !== null) clearTimeout(node.timerDecreaseShedding);// Clear the decreasing timer
165
+ node.startTimerIncreaseShedding();
166
+ }
167
+ }
168
+ } else if (node.totalWatt <= node.wattLimit) {
169
+ // Start decreasing shedding!
170
+ if (node.sheddingStage > 0) {
171
+ if (node.timerDecreaseShedding === null) {
172
+ setTimeout(() => {
173
+ node.setLocalStatus({ fill: "yellow", shape: "dot", text: "I'm about to unshed the load " + node.sheddingStage, payload: "", GA: "", dpt: "", devicename: "" });
174
+ }, 2000);
175
+ if (node.timerIncreaseShedding !== null) clearTimeout(node.timerIncreaseShedding);// Clear the increasing timer
176
+ node.startTimerDecreaseShedding();
177
+ }
178
+ }
179
+ }
180
+ }, 10000);
181
+ }
146
182
 
147
183
  // Start the timer
148
184
  node.startTimerIncreaseShedding = () => {
149
185
 
150
186
  // Increase shedding timer (Switch off devices)
151
- if (node.timerIncreaseShedding !== null) clearInterval(node.timerIncreaseShedding);
152
- node.timerIncreaseShedding = setInterval(() => {
187
+ if (node.timerIncreaseShedding !== null) clearTimeout(node.timerIncreaseShedding);
188
+ node.timerIncreaseShedding = setTimeout(() => {
153
189
  if (node.server) {
154
- // Issue a READ request to the main Watt GA
155
- // The devices should automatically send a value on change, but... you know....
156
- if (node.topic !== undefined && node.topic !== null && node.topic !== "") node.server.writeQueueAdd({ grpaddr: node.topic, payload: "", dpt: "", outputtype: "read", nodecallerid: node.id });
157
-
158
190
  // Check consumption
159
191
  if (node.totalWatt > node.wattLimit) {
160
192
  // Start increasing shedding!
161
193
  if (node.sheddingStage < node.deviceList.length) {
162
194
  node.increaseShedding();
163
- node.startTimerDecreaseShedding(); // Reset the decreasing timer from beginning
164
195
  }
165
196
  }
166
197
  }
198
+ node.timerIncreaseShedding = null; // Nullify the timer.
167
199
  }, node.sheddingCheckInterval);
168
200
  }
169
201
 
@@ -171,18 +203,18 @@ module.exports = function (RED) {
171
203
  node.startTimerDecreaseShedding = () => {
172
204
 
173
205
  // Decrease shedding timer (Switch devices on again)
174
- if (node.timerDecreaseShedding !== null) clearInterval(node.timerDecreaseShedding);
175
- node.timerDecreaseShedding = setInterval(() => {
176
-
177
- // Check consumption
178
- if (node.totalWatt <= node.wattLimit) {
179
- // Start decreasing shedding!
180
- if (node.sheddingStage > 0) {
181
- node.decreaseShedding();
182
- node.startTimerIncreaseShedding(); // Reset the increasing timer from beginning
206
+ if (node.timerDecreaseShedding !== null) clearTimeout(node.timerDecreaseShedding);
207
+ node.timerDecreaseShedding = setTimeout(() => {
208
+ if (node.server) {
209
+ // Check consumption
210
+ if (node.totalWatt <= node.wattLimit) {
211
+ // Start decreasing shedding!
212
+ if (node.sheddingStage > 0) {
213
+ node.decreaseShedding();
214
+ }
183
215
  }
184
216
  }
185
-
217
+ node.timerDecreaseShedding = null; // Nullify timer
186
218
  }, node.sheddingRestoreDelay);
187
219
  }
188
220
 
@@ -266,20 +298,18 @@ module.exports = function (RED) {
266
298
  node.setLocalStatus({ fill: "green", shape: "dot", text: "All loads have been restored" });
267
299
  }, 1000);
268
300
  }
269
-
270
-
271
301
  }
272
302
 
273
303
  // Start
274
- node.startTimerIncreaseShedding();
304
+ node.startMainTimer();
275
305
 
276
306
  node.on("input", function (msg) {
277
307
  if (typeof msg === "undefined") return;
278
308
 
279
309
  // Reset the shedding and activate all loads
280
310
  if (msg.hasOwnProperty("reset")) {
281
- if (node.timerDecreaseShedding !== null) clearInterval(node.timerDecreaseShedding);
282
- if (node.timerIncreaseShedding !== null) clearInterval(node.timerIncreaseShedding);
311
+ if (node.timerDecreaseShedding !== null) clearTimeout(node.timerDecreaseShedding);
312
+ if (node.timerIncreaseShedding !== null) clearTimeout(node.timerIncreaseShedding);
283
313
  node.sheddingStage = 0;
284
314
  for (let index = 0; index < node.deviceList.length; index++) {
285
315
  const oRow = node.deviceList[index];
@@ -287,16 +317,15 @@ module.exports = function (RED) {
287
317
  }
288
318
  setTimeout(() => {
289
319
  node.setLocalStatus({ fill: "green", shape: "dot", text: "All loads have been restored" });
290
- // Restart shedding timer
291
- node.startTimerIncreaseShedding();
292
320
  }, 1000);
293
321
  node.send({ topic: node.name || node.topic, operation: "Reset", payload: node.sheddingStage });
294
322
  }
295
323
 
296
324
  // Disable the shedding node
297
325
  if (msg.hasOwnProperty("disable")) {
298
- if (node.timerDecreaseShedding !== null) clearInterval(node.timerDecreaseShedding);
299
- if (node.timerIncreaseShedding !== null) clearInterval(node.timerIncreaseShedding);
326
+ if (node.timerDecreaseShedding !== null) clearTimeout(node.timerDecreaseShedding);
327
+ if (node.timerIncreaseShedding !== null) clearTimeout(node.timerIncreaseShedding);
328
+ if (node.mainTimer !== null) clearInterval(node.mainTimer);
300
329
  setTimeout(() => {
301
330
  node.setLocalStatus({ fill: "grey", shape: "dot", text: "Disabled" });
302
331
  }, 1000);
@@ -305,12 +334,12 @@ module.exports = function (RED) {
305
334
 
306
335
  // Disable the shedding node
307
336
  if (msg.hasOwnProperty("enable")) {
308
- if (node.timerDecreaseShedding !== null) clearInterval(node.timerDecreaseShedding);
309
- if (node.timerIncreaseShedding !== null) clearInterval(node.timerIncreaseShedding);
337
+ if (node.timerDecreaseShedding !== null) clearTimeout(node.timerDecreaseShedding);
338
+ if (node.timerIncreaseShedding !== null) clearTimeout(node.timerIncreaseShedding);
310
339
  setTimeout(() => {
311
340
  node.setLocalStatus({ fill: "green", shape: "dot", text: "Enabled" });
312
- // Restart shedding timer
313
- node.startTimerIncreaseShedding();
341
+ // Restart timer
342
+ node.startMainTimer();
314
343
  }, 1000);
315
344
  node.send({ topic: node.name || node.topic, operation: "Enabled", payload: node.sheddingStage });
316
345
  }
@@ -323,8 +352,9 @@ module.exports = function (RED) {
323
352
  })
324
353
 
325
354
  node.on("close", function (done) {
326
- if (node.timerDecreaseShedding !== null) clearInterval(node.timerDecreaseShedding);
327
- if (node.timerIncreaseShedding !== null) clearInterval(node.timerIncreaseShedding);
355
+ if (node.mainTimer !== null) clearInterval(node.mainTimer);
356
+ if (node.timerDecreaseShedding !== null) clearTimeout(node.timerDecreaseShedding);
357
+ if (node.timerIncreaseShedding !== null) clearTimeout(node.timerIncreaseShedding);
328
358
  if (node.server) {
329
359
  node.server.removeClient(node)
330
360
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-knx-ultimate",
3
- "version": "1.3.28",
3
+ "version": "1.3.29",
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",
package/img/covidfree.png DELETED
Binary file