node-red-contrib-knx-ultimate 2.4.21 → 2.4.22
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 +4 -0
- package/nodes/knxUltimateHueButton.html +47 -11
- package/nodes/knxUltimateHueButton.js +18 -7
- package/package.json +1 -1
- package/.vscode/launch.json +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
# CHANGELOG
|
|
8
8
|
|
|
9
|
+
**Version 2.4.22** - April 2024<br/>
|
|
10
|
+
- Warning: this version uses the Node-Red plugin system; the Node-Red version must be **equals or major than 3.1.1**<br/>
|
|
11
|
+
- HUE button node: NEW: now you can select the value and the dim direction to be transmitted, when Toggle Status is set to unchecked. Thanks @cybersmart-eu for the suggestion.<br/>
|
|
12
|
+
|
|
9
13
|
**Version 2.4.21** - April 2024<br/>
|
|
10
14
|
- Warning: this version uses the Node-Red plugin system; the Node-Red version must be **equals or major than 3.1.1**<br/>
|
|
11
15
|
- Home Assistant translator node: fixed an issue where user added translations does not work.<br/>
|
|
@@ -23,7 +23,10 @@
|
|
|
23
23
|
dptshort_releaseStatus: { value: "1.001" },
|
|
24
24
|
|
|
25
25
|
toggleValues: { value: true },
|
|
26
|
-
hueDevice: { value: "" }
|
|
26
|
+
hueDevice: { value: "" },
|
|
27
|
+
|
|
28
|
+
switchSend: { value: true },
|
|
29
|
+
dimSend: { value: "up" },
|
|
27
30
|
},
|
|
28
31
|
inputs: 0,
|
|
29
32
|
outputs: 1,
|
|
@@ -64,6 +67,33 @@
|
|
|
64
67
|
} catch (error) { }
|
|
65
68
|
});
|
|
66
69
|
|
|
70
|
+
$("#node-input-toggleValues").change(function () {
|
|
71
|
+
if ($("#node-input-toggleValues").is(":checked")) {
|
|
72
|
+
|
|
73
|
+
$("#divFixedValue").hide();
|
|
74
|
+
$("#divStatus").show();
|
|
75
|
+
} else {
|
|
76
|
+
$("#divFixedValue").show();
|
|
77
|
+
$("#divStatus").hide();
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// Testing typedInput how it works
|
|
82
|
+
$("#node-input-switchSend").typedInput({
|
|
83
|
+
type: 'bool',
|
|
84
|
+
types: ['bool']
|
|
85
|
+
})
|
|
86
|
+
$("#node-input-dimSend").typedInput({
|
|
87
|
+
type: "direction", types: [{
|
|
88
|
+
value: "direction",
|
|
89
|
+
options: [
|
|
90
|
+
{ value: "up", label: "Up" },
|
|
91
|
+
{ value: "down", label: "Down" },
|
|
92
|
+
{ value: "stop", label: "Stop" },
|
|
93
|
+
]
|
|
94
|
+
}]
|
|
95
|
+
})
|
|
96
|
+
|
|
67
97
|
// 31/03/2020 Search Helper
|
|
68
98
|
function fullSearch(sourceText, searchString) {
|
|
69
99
|
// This searches for all words in a string
|
|
@@ -360,7 +390,7 @@
|
|
|
360
390
|
<label for="node-input-nameshort_release" style="width:50px; margin-left: 0px; text-align: right;">Name</label>
|
|
361
391
|
<input type="text" id="node-input-nameshort_release" style="width:200px;margin-left: 5px; text-align: left;">
|
|
362
392
|
</div>
|
|
363
|
-
<div class="form-row">
|
|
393
|
+
<div class="form-row" id="divStatus">
|
|
364
394
|
<label style="width:100px;"><i class="fa fa-question-circle"></i> Switch Status</label>
|
|
365
395
|
|
|
366
396
|
<label for="node-input-GAshort_releaseStatus" style="width:20px;">GA</label>
|
|
@@ -371,10 +401,8 @@
|
|
|
371
401
|
|
|
372
402
|
<label for="node-input-nameshort_releaseStatus" style="width:50px; margin-left: 0px; text-align: right;">Name</label>
|
|
373
403
|
<input type="text" id="node-input-nameshort_releaseStatus" style="width:200px;margin-left: 5px; text-align: left;">
|
|
404
|
+
<br/>
|
|
374
405
|
</div>
|
|
375
|
-
<br/>
|
|
376
|
-
<br/>
|
|
377
|
-
|
|
378
406
|
<div class="form-row">
|
|
379
407
|
<label style="width:100px;"><i class="fa fa-play-circle-o"></i> Dim</span></label>
|
|
380
408
|
|
|
@@ -388,8 +416,6 @@
|
|
|
388
416
|
<input type="text" id="node-input-nameDim" style="width:200px;margin-left: 5px; text-align: left;">
|
|
389
417
|
</div>
|
|
390
418
|
<br/>
|
|
391
|
-
<br/>
|
|
392
|
-
|
|
393
419
|
<div class="form-row">
|
|
394
420
|
<input type="checkbox" id="node-input-toggleValues" style="display:inline-block; width:auto; vertical-align:top;" />
|
|
395
421
|
<label style="width:auto" for="node-input-toggleValues">
|
|
@@ -398,13 +424,21 @@
|
|
|
398
424
|
Toggle values
|
|
399
425
|
</label>
|
|
400
426
|
</div>
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
<
|
|
427
|
+
<div id="divFixedValue" hidden>
|
|
428
|
+
<div class="form-row" >
|
|
429
|
+
<label for="node-input-switchSend" style="width:100px;"><i class="fa fa-play-circle-o"></i> Switch send</span></label>
|
|
430
|
+
<input type="text" id="node-input-switchSend">
|
|
431
|
+
</div>
|
|
432
|
+
<div class="form-row" >
|
|
433
|
+
<label for="node-input-dimSend" style="width:100px;"><i class="fa fa-play-circle-o"></i> Dim send</span></label>
|
|
434
|
+
<input type="text" id="node-input-dimSend">
|
|
435
|
+
</div>
|
|
436
|
+
</div>
|
|
404
437
|
<br/>
|
|
405
438
|
<br/>
|
|
406
439
|
|
|
407
440
|
|
|
441
|
+
|
|
408
442
|
</script>
|
|
409
443
|
|
|
410
444
|
<script type="text/markdown" data-help-name="knxUltimateHueButton">
|
|
@@ -431,7 +465,9 @@ This allows the internal logic to be aware of external devices, like wall switch
|
|
|
431
465
|
| Switch | As soon as you quickly press and release your HUE button, this event fires |
|
|
432
466
|
| Switch Status | To allow internal logic to take care of the external KNX devices, for example an external wall switch, you should set this group address |
|
|
433
467
|
| Dim | This event is used either to send DIM (increase/decrease) or true/false commands to the KNX group address |
|
|
434
|
-
| Toggle values | Enable or disable toggling values. If enabled, all values toggles, otherwise, all values are sent as *true* or *increase dim*, to the selected KNX group address |
|
|
468
|
+
| Toggle values | Enable or disable toggling values. If enabled, all values toggles, otherwise, all values are sent as *true* or *increase dim*, to the selected KNX group address. If unchecked, you'll able to select the payload to be sent to KNX bus every time you press the button. |
|
|
469
|
+
| Switch send | Only visible when *Toggle values* is *false*. Set the value to be sent when pushing the button. |
|
|
470
|
+
| Dim send | Only visible when *Toggle values* is *false*. Set the dimming direction to be sent when dimming. |
|
|
435
471
|
|
|
436
472
|
### Outputs
|
|
437
473
|
|
|
@@ -29,6 +29,14 @@ module.exports = function (RED) {
|
|
|
29
29
|
node.hueDevice = config.hueDevice;
|
|
30
30
|
node.initializingAtStart = false;
|
|
31
31
|
|
|
32
|
+
// When toggle status is disabled, uses these values
|
|
33
|
+
node.switchSend = config.switchSend === undefined ? 'true' : config.switchSend;
|
|
34
|
+
node.switchSend = node.switchSend === 'true'; // The typedvalue in the html returns a string, so i convert it to bool
|
|
35
|
+
node.dimSend = config.dimSend === undefined ? 'up' : config.dimSend;
|
|
36
|
+
if (node.dimSend === 'up') node.dimSend = { decr_incr: 1, data: 3 };
|
|
37
|
+
if (node.dimSend === 'down') node.dimSend = { decr_incr: 0, data: 3 };
|
|
38
|
+
if (node.dimSend === 'stop') node.dimSend = { decr_incr: 0, data: 0 };
|
|
39
|
+
|
|
32
40
|
// Used to call the status update from the config node.
|
|
33
41
|
node.setNodeStatus = ({
|
|
34
42
|
fill, shape, text, payload,
|
|
@@ -47,7 +55,6 @@ module.exports = function (RED) {
|
|
|
47
55
|
|
|
48
56
|
// This function is called by the knx-ultimate config node, to output a msg.payload.
|
|
49
57
|
node.handleSend = (msg) => {
|
|
50
|
-
const state = {};
|
|
51
58
|
try {
|
|
52
59
|
switch (msg.knx.destination) {
|
|
53
60
|
case config.GAshort_releaseStatus:
|
|
@@ -90,7 +97,7 @@ module.exports = function (RED) {
|
|
|
90
97
|
switch (_event.button.last_event) {
|
|
91
98
|
case 'initial_press':
|
|
92
99
|
if (node.initial_pressValue === undefined) node.initial_pressValue = false;
|
|
93
|
-
node.initial_pressValue = config.toggleValues ? !node.initial_pressValue :
|
|
100
|
+
node.initial_pressValue = config.toggleValues ? !node.initial_pressValue : node.switchSend;
|
|
94
101
|
flowMsgPayload = node.initial_pressValue;
|
|
95
102
|
break;
|
|
96
103
|
case 'long_release':
|
|
@@ -104,16 +111,16 @@ module.exports = function (RED) {
|
|
|
104
111
|
break;
|
|
105
112
|
case 'double_short_release':
|
|
106
113
|
if (node.double_short_releaseValue === undefined) node.double_short_releaseValue = false;
|
|
107
|
-
node.double_short_releaseValue = config.toggleValues ? !node.double_short_releaseValue :
|
|
114
|
+
node.double_short_releaseValue = config.toggleValues ? !node.double_short_releaseValue : node.switchSend;
|
|
108
115
|
flowMsgPayload = node.double_short_releaseValue;
|
|
109
116
|
break;
|
|
110
117
|
case 'long_press':
|
|
111
118
|
if (node.long_pressValue === undefined) node.long_pressValue = false;
|
|
112
|
-
node.long_pressValue = config.toggleValues ? !node.long_pressValue :
|
|
119
|
+
node.long_pressValue = config.toggleValues ? !node.long_pressValue : node.dimSend;
|
|
113
120
|
flowMsgPayload = node.long_pressValue;
|
|
114
121
|
break;
|
|
115
122
|
case 'short_release':
|
|
116
|
-
node.short_releaseValue = config.toggleValues ? !node.short_releaseValue :
|
|
123
|
+
node.short_releaseValue = config.toggleValues ? !node.short_releaseValue : node.switchSend;
|
|
117
124
|
flowMsgPayload = node.short_releaseValue;
|
|
118
125
|
if (config.GAshort_release !== undefined && config.GAshort_release !== '') {
|
|
119
126
|
knxMsgPayload.topic = config.GAshort_release;
|
|
@@ -133,13 +140,17 @@ module.exports = function (RED) {
|
|
|
133
140
|
}
|
|
134
141
|
break;
|
|
135
142
|
case 'repeat':
|
|
136
|
-
flowMsgPayload =
|
|
143
|
+
flowMsgPayload = node.long_pressValue;
|
|
137
144
|
if (config.GArepeat !== undefined && config.GArepeat !== '') {
|
|
138
145
|
if (node.isTimerDimStopRunning === false) {
|
|
139
146
|
// Set KNX Dim up/down start
|
|
140
147
|
knxMsgPayload.topic = config.GArepeat;
|
|
141
148
|
knxMsgPayload.dpt = config.dptrepeat;
|
|
142
|
-
|
|
149
|
+
if (typeof (node.long_pressValue) === 'object') {
|
|
150
|
+
knxMsgPayload.payload = node.long_pressValue; // Send fixed value when toggleValues is false
|
|
151
|
+
} else {
|
|
152
|
+
knxMsgPayload.payload = node.long_pressValue ? { decr_incr: 0, data: 3 } : { decr_incr: 1, data: 3 }; // If the light is turned on, the initial DIM direction must be down, otherwise, up
|
|
153
|
+
}
|
|
143
154
|
// Send to KNX bus
|
|
144
155
|
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) {
|
|
145
156
|
node.server.writeQueueAdd({
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"engines": {
|
|
4
4
|
"node": ">=16.0.0"
|
|
5
5
|
},
|
|
6
|
-
"version": "2.4.
|
|
6
|
+
"version": "2.4.22",
|
|
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",
|
package/.vscode/launch.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Usare IntelliSense per informazioni sui possibili attributi.
|
|
3
|
-
// Al passaggio del mouse vengono visualizzate le descrizioni degli attributi esistenti.
|
|
4
|
-
// Per altre informazioni, visitare: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
-
"version": "0.2.0",
|
|
6
|
-
"configurations": [
|
|
7
|
-
{
|
|
8
|
-
"type": "node",
|
|
9
|
-
"request": "launch",
|
|
10
|
-
"name": "Avvia programma",
|
|
11
|
-
"skipFiles": [
|
|
12
|
-
"<node_internals>/**"
|
|
13
|
-
],
|
|
14
|
-
"program": "${workspaceFolder}/nodes/knxUltimateWatchDog.js"
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|