node-red-contrib-knx-ultimate 3.3.38 → 3.3.39

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,9 @@
6
6
 
7
7
  # CHANGELOG
8
8
 
9
+ **Version 3.3.39** - Juli 2025<br/>
10
+ - Added other snippets to the KNX Device function tab.<br/>
11
+
9
12
  **Version 3.3.38** - May 2025<br/>
10
13
  - FIX: fixed possible issue having tabulator chars in the group address names.<br/>
11
14
  - KNX Engine: better handling of disconnections telegrams.<br/>
@@ -128,6 +128,15 @@
128
128
  $("#snippetThree").on("click", function (event) {
129
129
  node.receiveMsgFromKNXCodeEditor.session.setValue(KNXFunctionSnippetThree);
130
130
  });
131
+ $("#snippetFour").on("click", function (event) {
132
+ node.sendMsgToKNXCodeEditor.session.setValue(KNXFunctionSnippetFour);
133
+ });
134
+ $("#snippetFive").on("click", function (event) {
135
+ node.sendMsgToKNXCodeEditor.session.setValue(KNXFunctionSnippetFive);
136
+ });
137
+ $("#snippetSix").on("click", function (event) {
138
+ node.sendMsgToKNXCodeEditor.session.setValue(KNXFunctionSnippetSix);
139
+ });
131
140
 
132
141
  function checkUI() {
133
142
 
@@ -746,6 +755,9 @@
746
755
  </div>
747
756
  <i class="fa fa-code"></i> Select a snippet to be inserted<br />
748
757
  <button type="button" id="snippetOne" class="red-ui-button">Status GA check</button>
758
+ <button type="button" id="snippetFour" class="red-ui-button">Toggle value</button>
759
+ <button type="button" id="snippetFive" class="red-ui-button">Send false after 5 secs</button>
760
+ <button type="button" id="snippetSix" class="red-ui-button">Send 20% to another GA</button>
749
761
  <hr>
750
762
  <div class="form-row">
751
763
  <dt>
@@ -839,7 +851,7 @@ If enabled, "f(x)" indication will be added to node's name.
839
851
  | getGAValue (string GA, optional string DPT) | Get the specified GA's value, for example **'1/0/1'**, or also **'1/0/1 Bed table light'** (All text after a blank space will be ignored by the function. This is useful if you want to add the GA name as a reminder. With the ETS file imported, you can also copy and paste the GA and GA Name directly from the **Search GA** field.). **DPT** is optional if you've imported the ETS file, otherwise you must specify it, for example '1.001'. |
840
852
  | setGAValue (string GA, any value, optional string DPT) | Set the specified GA's value. The GA con be wrote for example **'1/0/1'**, or also **'1/0/1 Bed table light'** (All text after a blank space will be ignored by the function. This is useful if you want to add the GA name as a reminder. With the ETS file imported, you can also copy and paste the GA and GA Name directly from the **Search GA** field.). The **value** is mandatory, can be a boolean or number or string, **DPT** is optional if you've imported the ETS file, otherwise you must specify it, for example '1.001'. |
841
853
  | self (any value) | Set the currend node's value and sends the value to the KNX BUS as well. For example, *self(false)*. Caution using **self** function in the *From KNX BUS to node's OUTPUT PIN* code, because the code will be executed everytime a KNX telegram is received, so you coud have recurrency loops. |
842
- | toggle (nothing) | Toggle the currend node's value and sends the value to the KNX BUS as well. For example, *toggle()*. Caution using **toggle** function in the *From KNX BUS to node's OUTPUT PIN* code, because the code will be executed everytime a KNX telegram is received, so you coud have recurrency loops. |
854
+ | toggle () | Toggle the currend node's value and sends the value to the KNX BUS as well. For example, *toggle()*. Caution using **toggle** function in the *From KNX BUS to node's OUTPUT PIN* code, because the code will be executed everytime a KNX telegram is received, so you coud have recurrency loops. |
843
855
  | node (object) | The node object. |
844
856
  | RED (Node-Red object) | The Node-Red's RED object. |
845
857
  | return (msg) | Mandatory `return msg;`, if you want to emit the message. Otherwise, using `return;` will not emit any message. |
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "engines": {
4
4
  "node": ">=20.18.1"
5
5
  },
6
- "version": "3.3.38",
6
+ "version": "3.3.39",
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",
@@ -41,4 +41,25 @@ return msg`;
41
41
  const KNXFunctionSnippetThree = `// @ts-nocheck
42
42
  // The current msg contains the internal temperature in the "msg.payload" property, but we want to emit the external temperature as well.
43
43
  msg.externalTemperature = getGAValue('0/0/10 Garden temperature sensor'); // In case the ETS file is missing, you must specify the dpt as well: getGAValue('0/0/10','9.001')
44
+ return msg;`;
45
+
46
+ const KNXFunctionSnippetFour = `// @ts-nocheck
47
+ // After 5000 milliseconds, toggle.
48
+ setTimeout(function() {
49
+ toggle();
50
+ }, 5000);
51
+ return msg;`;
52
+
53
+ const KNXFunctionSnippetFive = `// @ts-nocheck
54
+ // After 5000 milliseconds, send false.
55
+ setTimeout(function () {
56
+ self(false);
57
+ }, 5000);
58
+ return msg;`;
59
+
60
+ const KNXFunctionSnippetSix = `// @ts-nocheck
61
+ // Send 20% to the GA 1/0/1 having DPT 5.001
62
+ if (msg.payload === true){
63
+ setGAValue('1/0/1',20,'5.001')
64
+ }
44
65
  return msg;`;