node-red-contrib-knx-ultimate 2.1.19 → 2.1.21
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,16 @@
|
|
|
6
6
|
|
|
7
7
|
# CHANGELOG
|
|
8
8
|
|
|
9
|
+
<p>
|
|
10
|
+
<b>Version 2.1.21</b> - July 2023<br/>
|
|
11
|
+
- NEW: Hue Light: UI optimization and allow to set the switch on light, even it Night Lighting is unselected.<br/>
|
|
12
|
+
- NEW: Hue Light: you can now choose some options in the new Behaviours configuration tab.<br/>
|
|
13
|
+
</p>
|
|
14
|
+
<p>
|
|
15
|
+
<b>Version 2.1.20</b> - July 2023<br/>
|
|
16
|
+
- NEW: Hue Light: you can choose to enable/disable the day/night behaviour.<br/>
|
|
17
|
+
- NEW: Hue Light: you can now choose some options in the new Behaviours configuration tab.<br/>
|
|
18
|
+
</p>
|
|
9
19
|
<p>
|
|
10
20
|
<b>Version 2.1.19</b> - July 2023<br/>
|
|
11
21
|
- Hue light and Hue button optimization.<br/>
|
|
@@ -47,12 +47,12 @@ module.exports = function (RED) {
|
|
|
47
47
|
case config.GAshort_releaseStatus:
|
|
48
48
|
msg.payload = dptlib.fromBuffer(msg.knx.rawValue, dptlib.resolve(config.dptshort_release))
|
|
49
49
|
node.short_releaseValue = msg.payload
|
|
50
|
-
node.setNodeStatusHue({ fill: '
|
|
50
|
+
node.setNodeStatusHue({ fill: 'green', shape: 'dot', text: 'KNX->HUE Short Release Status', payload: msg.payload })
|
|
51
51
|
break
|
|
52
52
|
case config.GArepeatStatus:
|
|
53
53
|
msg.payload = dptlib.fromBuffer(msg.knx.rawValue, dptlib.resolve(config.dptrepeat))
|
|
54
54
|
node.toggleGArepeat = msg.payload.decr_incr === 1
|
|
55
|
-
node.setNodeStatusHue({ fill: '
|
|
55
|
+
node.setNodeStatusHue({ fill: 'green', shape: 'dot', text: 'KNX->HUE Repeat Status', payload: msg.payload })
|
|
56
56
|
break
|
|
57
57
|
default:
|
|
58
58
|
break
|
|
@@ -105,7 +105,7 @@ module.exports = function (RED) {
|
|
|
105
105
|
knxMsgPayload.payload = node.short_releaseValue
|
|
106
106
|
// Send to KNX bus
|
|
107
107
|
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.server.writeQueueAdd({ grpaddr: knxMsgPayload.topic, payload: knxMsgPayload.payload, dpt: knxMsgPayload.dpt, outputtype: 'write', nodecallerid: node.id })
|
|
108
|
-
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.setNodeStatusHue({ fill: '
|
|
108
|
+
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.setNodeStatusHue({ fill: 'blue', shape: 'dot', text: 'HUE->KNX ' + _event.button.last_event, payload: knxMsgPayload.payload })
|
|
109
109
|
}
|
|
110
110
|
break
|
|
111
111
|
case 'repeat':
|
|
@@ -118,7 +118,7 @@ module.exports = function (RED) {
|
|
|
118
118
|
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
|
|
119
119
|
// Send to KNX bus
|
|
120
120
|
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.server.writeQueueAdd({ grpaddr: knxMsgPayload.topic, payload: knxMsgPayload.payload, dpt: knxMsgPayload.dpt, outputtype: 'write', nodecallerid: node.id })
|
|
121
|
-
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.setNodeStatusHue({ fill: '
|
|
121
|
+
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.setNodeStatusHue({ fill: 'blue', shape: 'dot', text: 'HUE->KNX START DIM', payload: '' })
|
|
122
122
|
}
|
|
123
123
|
node.startDimStopper(knxMsgPayload)
|
|
124
124
|
}
|
|
@@ -134,7 +134,7 @@ module.exports = function (RED) {
|
|
|
134
134
|
flowMsg.rawEvent = _event
|
|
135
135
|
flowMsg.payload = flowMsgPayload
|
|
136
136
|
node.send(flowMsg)
|
|
137
|
-
node.setNodeStatusHue({ fill: 'blue', shape: 'ring', text: 'HUE->KNX', payload: flowMsg.rawEvent + ' ' + flowMsg.payload })
|
|
137
|
+
//node.setNodeStatusHue({ fill: 'blue', shape: 'ring', text: 'HUE->KNX', payload: flowMsg.rawEvent + ' ' + flowMsg.payload })
|
|
138
138
|
}
|
|
139
139
|
} catch (error) {
|
|
140
140
|
node.setNodeStatusHue({ fill: 'red', shape: 'dot', text: 'HUE->KNX error ' + error.message, payload: '' })
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
GALightColorCycle: { value: "" },
|
|
53
53
|
dptLightColorCycle: { value: "" },
|
|
54
54
|
|
|
55
|
+
enableDayNightLighting: { value: false },
|
|
55
56
|
colorAtSwitchOnDayTime: { value: '{"red":255, "green":255, "blue":255}' },
|
|
56
57
|
colorAtSwitchOnNightTime: { value: '{"red":23, "green":4, "blue":0}' },
|
|
57
58
|
invertDayNight: { value: false },
|
|
@@ -60,6 +61,9 @@
|
|
|
60
61
|
GADaylightSensor: { value: "" },
|
|
61
62
|
dptDaylightSensor: { value: "" },
|
|
62
63
|
|
|
64
|
+
updateSwitchStatusOnBrightness: { value: "no" },
|
|
65
|
+
updateBrightnessOnSwitchStatus: { value: "no" },
|
|
66
|
+
|
|
63
67
|
hueDevice: { value: "" }
|
|
64
68
|
},
|
|
65
69
|
inputs: 0,
|
|
@@ -661,7 +665,19 @@
|
|
|
661
665
|
});
|
|
662
666
|
// ########################
|
|
663
667
|
|
|
664
|
-
|
|
668
|
+
// Show/Hide and enable/disable day/night Lighting behaviour
|
|
669
|
+
if (this.enableDayNightLighting === true) {
|
|
670
|
+
$("#DivEnableDayNightLighting").show()
|
|
671
|
+
} else {
|
|
672
|
+
$("#DivEnableDayNightLighting").hide()
|
|
673
|
+
}
|
|
674
|
+
$("#node-input-enableDayNightLighting").on('change', function () {
|
|
675
|
+
if ($("#node-input-enableDayNightLighting").is(":checked")) {
|
|
676
|
+
$("#DivEnableDayNightLighting").show()
|
|
677
|
+
} else {
|
|
678
|
+
$("#DivEnableDayNightLighting").hide()
|
|
679
|
+
}
|
|
680
|
+
})
|
|
665
681
|
|
|
666
682
|
// Autocomplete suggestion with HUE Lights
|
|
667
683
|
$("#node-input-name").autocomplete({
|
|
@@ -750,11 +766,12 @@
|
|
|
750
766
|
|
|
751
767
|
<div id="tabs">
|
|
752
768
|
<ul>
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
769
|
+
<li><a href="#tabs-1">Switching</a></li>
|
|
770
|
+
<li><a href="#tabs-2">Dim/Brightness</a></li>
|
|
771
|
+
<li><a href="#tabs-3">Tunable white</a></li>
|
|
772
|
+
<li><a href="#tabs-4">Colors</a></li>
|
|
773
|
+
<li><a href="#tabs-5">Effects</a></li>
|
|
774
|
+
<li><a href="#tabs-6">Behaviour</a></li>
|
|
758
775
|
</ul>
|
|
759
776
|
<div id="tabs-1">
|
|
760
777
|
<p>
|
|
@@ -782,39 +799,47 @@
|
|
|
782
799
|
<label for="node-input-nameLightState" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
|
|
783
800
|
<input type="text" id="node-input-nameLightState" style="width:200px;margin-left: 5px; text-align: left;">
|
|
784
801
|
</div>
|
|
785
|
-
|
|
786
|
-
<div class="form-row">
|
|
787
|
-
<label for="node-input-nameDaylightSensor" style="width:100px;"><i class="fa fa-clock-o"></i> Day/Night</label>
|
|
788
|
-
|
|
789
|
-
<label for="node-input-GADaylightSensor" style="width:20px;">GA</label>
|
|
790
|
-
<input type="text" id="node-input-GADaylightSensor" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
|
|
791
|
-
|
|
792
|
-
<label for="node-input-dptDaylightSensor" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
|
|
793
|
-
<select id="node-input-dptDaylightSensor" style="width:140px;"></select>
|
|
794
|
-
|
|
795
|
-
<label for="node-input-nameDaylightSensor" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
|
|
796
|
-
<input type="text" id="node-input-nameDaylightSensor" style="width:200px;margin-left: 5px; text-align: left;">
|
|
797
|
-
</div>
|
|
798
|
-
<div class="form-row">
|
|
799
|
-
<label for="node-input-invertDayNight">
|
|
800
|
-
</label>
|
|
801
|
-
<input type="checkbox" id="node-input-invertDayNight" style="display:inline-block; width:auto; vertical-align:top;" />
|
|
802
|
-
<i class="fa fa-moon-o"></i> Invert day/night
|
|
803
|
-
</div>
|
|
804
|
-
|
|
805
802
|
<div class="form-row">
|
|
806
|
-
<label for="node-input-colorAtSwitchOnDayTime" style="width:
|
|
807
|
-
<i class="fa fa-sun-o"></i> Switch on color
|
|
803
|
+
<label for="node-input-colorAtSwitchOnDayTime" style="width:250px">
|
|
804
|
+
<i class="fa fa-sun-o"></i> Switch on color/brightness
|
|
808
805
|
</label>
|
|
809
|
-
<input type="text" id="node-input-colorAtSwitchOnDayTime" placeholder='{"red":255, "green":255, "blue":255}'
|
|
806
|
+
<input type="text" id="node-input-colorAtSwitchOnDayTime" placeholder='Leave blank or, for example, {"red":255, "green":255, "blue":255}'
|
|
807
|
+
style="width:260px">
|
|
810
808
|
</div>
|
|
811
809
|
<div class="form-row">
|
|
812
|
-
<label for="node-input-
|
|
813
|
-
<i class="fa fa-
|
|
810
|
+
<label style="width:170px" for="node-input-enableDayNightLighting">
|
|
811
|
+
<i class="fa fa-clone"></i> Night Lighting
|
|
814
812
|
</label>
|
|
815
|
-
<input type="
|
|
813
|
+
<input type="checkbox" id="node-input-enableDayNightLighting" style="display:inline-block; width:auto; vertical-align:top;" />
|
|
814
|
+
</div>
|
|
815
|
+
<div id="DivEnableDayNightLighting">
|
|
816
|
+
<div class="form-row">
|
|
817
|
+
<label for="node-input-colorAtSwitchOnNightTime" style="width:250px">
|
|
818
|
+
<i class="fa fa-moon-o"></i> Switch on color/brightness at Night
|
|
819
|
+
</label>
|
|
820
|
+
<input type="text" id="node-input-colorAtSwitchOnNightTime" placeholder='Example {"red":100, "green":0, "blue":50}'
|
|
821
|
+
style="width:260px">
|
|
822
|
+
</div>
|
|
823
|
+
<div class="form-row">
|
|
824
|
+
<label for="node-input-nameDaylightSensor" style="width:100px;"><i class="fa fa-clock-o"></i> Day/Night</label>
|
|
825
|
+
|
|
826
|
+
<label for="node-input-GADaylightSensor" style="width:20px;">GA</label>
|
|
827
|
+
<input type="text" id="node-input-GADaylightSensor" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
|
|
828
|
+
|
|
829
|
+
<label for="node-input-dptDaylightSensor" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
|
|
830
|
+
<select id="node-input-dptDaylightSensor" style="width:140px;"></select>
|
|
831
|
+
|
|
832
|
+
<label for="node-input-nameDaylightSensor" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
|
|
833
|
+
<input type="text" id="node-input-nameDaylightSensor" style="width:200px;margin-left: 5px; text-align: left;">
|
|
834
|
+
</div>
|
|
835
|
+
<div class="form-row">
|
|
836
|
+
<label style="width:170px" for="node-input-invertDayNight">
|
|
837
|
+
<i class="fa fa-shuffle"></i> Invert day/night values
|
|
838
|
+
</label>
|
|
839
|
+
<input type="checkbox" id="node-input-invertDayNight" style="display:inline-block; width:auto; vertical-align:top;" />
|
|
840
|
+
|
|
841
|
+
</div>
|
|
816
842
|
</div>
|
|
817
|
-
|
|
818
843
|
</p>
|
|
819
844
|
</div>
|
|
820
845
|
<div id="tabs-2">
|
|
@@ -928,7 +953,7 @@
|
|
|
928
953
|
|
|
929
954
|
<label for="node-input-nameLightBlink" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
|
|
930
955
|
<input type="text" id="node-input-nameLightBlink" style="width:200px;margin-left: 5px; text-align: left;">
|
|
931
|
-
|
|
956
|
+
</div>
|
|
932
957
|
|
|
933
958
|
<div class="form-row">
|
|
934
959
|
<label for="node-input-nameLightColorCycle" style="width:100px;"><i class="fa fa-play-circle-o"></i> Color Cycle</label>
|
|
@@ -944,11 +969,24 @@
|
|
|
944
969
|
</div>
|
|
945
970
|
</p>
|
|
946
971
|
</div>
|
|
947
|
-
|
|
972
|
+
<div id="tabs-6">
|
|
973
|
+
<p>
|
|
974
|
+
<br/>
|
|
975
|
+
<b> HUE to KNX</b>
|
|
976
|
+
<div class="form-row">
|
|
977
|
+
<label for="node-input-updateSwitchStatusOnBrightness" style="width:50%;">
|
|
978
|
+
<i class="fa fa-tag"></i> Update Switch Status on brightness change
|
|
979
|
+
</label>
|
|
980
|
+
<select id="node-input-updateSwitchStatusOnBrightness">
|
|
981
|
+
<option value="no">No</option>
|
|
982
|
+
<option value="yes">Yes</option>
|
|
983
|
+
</select>
|
|
984
|
+
</div>
|
|
985
|
+
</p>
|
|
986
|
+
</div>
|
|
948
987
|
<br/>
|
|
949
988
|
</script>
|
|
950
989
|
|
|
951
|
-
|
|
952
990
|
<script type="text/markdown" data-help-name="knxUltimateHueLight">
|
|
953
991
|
<p>This node lets you control your Philips HUE light and also get the states of this lights, to be sent to the KNX bus.</p>
|
|
954
992
|
|
|
@@ -970,15 +1008,16 @@ Start typing in the GA field, the name or group address of your KNX device, the
|
|
|
970
1008
|
|Property|Description|
|
|
971
1009
|
|--|--|
|
|
972
1010
|
| Switch | This GA is used to turn on/off the HUE light via a boolean KNX value true/false|
|
|
973
|
-
| Switch Status| Link this to the light's switch status group address|
|
|
974
|
-
|
|
|
975
|
-
|
|
|
976
|
-
| Switch on color at
|
|
977
|
-
|
|
|
1011
|
+
| Switch Status | Link this to the light's switch status group address|
|
|
1012
|
+
| Switch on color/brightness | You can choose the color/brightness of your light, at switch on. Set it as JSON object, for example **{ "red": 255, "green": 255, "blue": 255 }**. Leave blank to disable. |
|
|
1013
|
+
| Night Lighting | It allows to set a particular light color/brightness at nighttime. If **checked**, a further set of option shows up and the light changes the behaviour based on these options, everytime you switch the light *on*. |
|
|
1014
|
+
| Switch on color/brightness at Nighttime | You can choose the color/brightness of your light, at switch on, on night time. Set it as JSON object. Default value if you leave blank is **{ "red": 100, "green": 0, "blue": 0 }** |
|
|
1015
|
+
| Day/Night | Select the group address used to set the day/night behaviour. The group address value is *true* if daytime, *false* if nighttime. |
|
|
1016
|
+
| Invert day/night values | Invert the values of *Day/Night* group address. Default value is **unchecked**.|
|
|
978
1017
|
|
|
979
1018
|
<br/>
|
|
980
1019
|
|
|
981
|
-
**
|
|
1020
|
+
**Dim/Brightness**
|
|
982
1021
|
|Property|Description|
|
|
983
1022
|
|--|--|
|
|
984
1023
|
| Dimming | Relative DIM the HUE light |
|
|
@@ -1006,8 +1045,18 @@ Start typing in the GA field, the name or group address of your KNX device, the
|
|
|
1006
1045
|
**Effects**
|
|
1007
1046
|
|Property|Description|
|
|
1008
1047
|
|--|--|
|
|
1009
|
-
| Blink| *true* Blink the light, *false* Stop blinking. Blinks the light on and off. Useful for signalling. Works with all HUE lights. |
|
|
1010
|
-
| Color Cycle| *true* start cycle, *false* Stop cycle. Randomly changes the HUE light's color at regular interval. Works with all HUE lights having color capabilities. |
|
|
1048
|
+
| Blink | *true* Blink the light, *false* Stop blinking. Blinks the light on and off. Useful for signalling. Works with all HUE lights. |
|
|
1049
|
+
| Color Cycle | *true* start cycle, *false* Stop cycle. Randomly changes the HUE light's color at regular interval. Works with all HUE lights having color capabilities. |
|
|
1050
|
+
|
|
1051
|
+
<br/>
|
|
1052
|
+
|
|
1053
|
+
**Behaviour**
|
|
1054
|
+
|
|
1055
|
+
HUE to KNX
|
|
1056
|
+
|
|
1057
|
+
|Property|Description|
|
|
1058
|
+
|--|--|
|
|
1059
|
+
| Update Switch Status on brightness change | It updates the *Switch Status* group address on every brightness change. If the brighness is > 0, it sends *true*, otherwise, *false*. Default value is **No**. |
|
|
1011
1060
|
|
|
1012
1061
|
<br/>
|
|
1013
1062
|
|
|
@@ -41,24 +41,33 @@ module.exports = function (RED) {
|
|
|
41
41
|
node.status({ fill, shape, text: text + ' ' + payload + ' (' + dDate.getDate() + ', ' + dDate.toLocaleTimeString() + ')' })
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
// This function is called by the
|
|
44
|
+
// This function is called by the hue-config.js
|
|
45
45
|
node.handleSend = msg => {
|
|
46
46
|
let state = {}
|
|
47
47
|
try {
|
|
48
48
|
switch (msg.knx.destination) {
|
|
49
49
|
case config.GALightSwitch:
|
|
50
50
|
msg.payload = dptlib.fromBuffer(msg.knx.rawValue, dptlib.resolve(config.dptLightSwitch))
|
|
51
|
-
if (msg.payload) {
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
if (msg.payload === true) {
|
|
52
|
+
if (config.colorAtSwitchOnDayTime !== undefined && config.colorAtSwitchOnDayTime.toString().trim() !== '') {
|
|
53
|
+
// The user selected specific color/brightness at switch on.
|
|
54
|
+
let jColorChoosen = { red: 255, green: 255, blue: 255 }
|
|
54
55
|
jColorChoosen = JSON.parse(config.colorAtSwitchOnDayTime || '{ "red": 255, "green": 255, "blue": 255 }')
|
|
56
|
+
let dgamut = node.currentHUEDevice !== undefined ? node.currentHUEDevice.color.gamut_type : null
|
|
57
|
+
let dretXY = hueColorConverter.ColorConverter.rgbToXy(jColorChoosen.red, jColorChoosen.green, jColorChoosen.blue, dgamut)
|
|
58
|
+
let dbright = hueColorConverter.ColorConverter.getBrightnessFromRGB(jColorChoosen.red, jColorChoosen.green, jColorChoosen.blue)
|
|
59
|
+
state = dbright > 0 ? { on: { on: true }, dimming: { brightness: dbright }, color: { xy: dretXY } } : { on: { on: false } }
|
|
55
60
|
} else {
|
|
56
|
-
|
|
61
|
+
state = { on: { on: true } }
|
|
62
|
+
}
|
|
63
|
+
if (config.enableDayNightLighting === true && !node.DayTime) {
|
|
64
|
+
let jColorChoosen = { red: 23, green: 4, blue: 0 }
|
|
65
|
+
jColorChoosen = JSON.parse(config.colorAtSwitchOnNightTime || '{ "red": 23, "green": 4, "blue": 0 }')
|
|
66
|
+
let dgamut = node.currentHUEDevice !== undefined ? node.currentHUEDevice.color.gamut_type : null
|
|
67
|
+
let dretXY = hueColorConverter.ColorConverter.rgbToXy(jColorChoosen.red, jColorChoosen.green, jColorChoosen.blue, dgamut)
|
|
68
|
+
let dbright = hueColorConverter.ColorConverter.getBrightnessFromRGB(jColorChoosen.red, jColorChoosen.green, jColorChoosen.blue)
|
|
69
|
+
state = dbright > 0 ? { on: { on: true }, dimming: { brightness: dbright }, color: { xy: dretXY } } : { on: { on: false } }
|
|
57
70
|
}
|
|
58
|
-
let dgamut = node.currentHUEDevice !== undefined ? node.currentHUEDevice.color.gamut_type : null
|
|
59
|
-
let dretXY = hueColorConverter.ColorConverter.rgbToXy(jColorChoosen.red, jColorChoosen.green, jColorChoosen.blue, dgamut)
|
|
60
|
-
let dbright = hueColorConverter.ColorConverter.getBrightnessFromRGB(jColorChoosen.red, jColorChoosen.green, jColorChoosen.blue)
|
|
61
|
-
state = dbright > 0 ? { on: { on: true }, dimming: { brightness: dbright }, color: { xy: dretXY } } : { on: { on: false } }
|
|
62
71
|
} else {
|
|
63
72
|
state = { on: { on: false } }
|
|
64
73
|
}
|
|
@@ -104,12 +113,12 @@ module.exports = function (RED) {
|
|
|
104
113
|
node.setNodeStatusHue({ fill: 'green', shape: 'dot', text: 'KNX->HUE', payload: state })
|
|
105
114
|
break
|
|
106
115
|
case config.GALightColor:
|
|
107
|
-
// Behavior like ISE HUE CONNECT, by setting the brightness and on/off as well
|
|
108
116
|
msg.payload = dptlib.fromBuffer(msg.knx.rawValue, dptlib.resolve(config.dptLightColor))
|
|
109
117
|
const gamut = node.currentHUEDevice !== undefined ? node.currentHUEDevice.color.gamut_type : null
|
|
110
118
|
const retXY = hueColorConverter.ColorConverter.rgbToXy(msg.payload.red, msg.payload.green, msg.payload.blue, gamut)
|
|
111
119
|
const bright = hueColorConverter.ColorConverter.getBrightnessFromRGB(msg.payload.red, msg.payload.green, msg.payload.blue)
|
|
112
|
-
state = bright > 0 ? { on: { on: true }, dimming: { brightness: bright }, color: { xy: retXY } } : { on: { on: false } }
|
|
120
|
+
//state = bright > 0 ? { on: { on: true }, dimming: { brightness: bright }, color: { xy: retXY } } : { on: { on: false } }
|
|
121
|
+
state = { dimming: { brightness: bright }, color: { xy: retXY } }
|
|
113
122
|
node.serverHue.hueManager.writeHueQueueAdd(config.hueDevice, state, 'setLight')
|
|
114
123
|
node.setNodeStatusHue({ fill: 'green', shape: 'dot', text: 'KNX->HUE', payload: state })
|
|
115
124
|
break
|
|
@@ -231,12 +240,6 @@ module.exports = function (RED) {
|
|
|
231
240
|
knxMsgPayload.payload = _event.on.on
|
|
232
241
|
// Send to KNX bus
|
|
233
242
|
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.server.writeQueueAdd({ grpaddr: knxMsgPayload.topic, payload: knxMsgPayload.payload, dpt: knxMsgPayload.dpt, outputtype: 'write', nodecallerid: node.id })
|
|
234
|
-
// ISE Connect Hue emulation, send brightness
|
|
235
|
-
knxMsgPayload.topic = config.GALightBrightnessState
|
|
236
|
-
knxMsgPayload.dpt = config.dptLightBrightnessState
|
|
237
|
-
knxMsgPayload.payload = _event.on.on === true ? 100 : 0
|
|
238
|
-
// Send to KNX bus
|
|
239
|
-
//if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.server.writeQueueAdd({ grpaddr: knxMsgPayload.topic, payload: knxMsgPayload.payload, dpt: knxMsgPayload.dpt, outputtype: 'write', nodecallerid: node.id })
|
|
240
243
|
}
|
|
241
244
|
}
|
|
242
245
|
if (_event.hasOwnProperty('color')) {
|
|
@@ -255,12 +258,16 @@ module.exports = function (RED) {
|
|
|
255
258
|
knxMsgPayload.payload = _event.dimming.brightness
|
|
256
259
|
// Send to KNX bus
|
|
257
260
|
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.server.writeQueueAdd({ grpaddr: knxMsgPayload.topic, payload: knxMsgPayload.payload, dpt: knxMsgPayload.dpt, outputtype: 'write', nodecallerid: node.id })
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
|
|
262
|
+
if (config.updateSwitchStatusOnBrightness === 'yes') {
|
|
263
|
+
// ISE Connect Hue emulation, send true/false to switch state
|
|
264
|
+
knxMsgPayload.topic = config.GALightState
|
|
265
|
+
knxMsgPayload.dpt = config.dptLightState
|
|
266
|
+
knxMsgPayload.payload = _event.dimming.brightness > 0
|
|
267
|
+
// Send to KNX bus
|
|
268
|
+
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.server.writeQueueAdd({ grpaddr: knxMsgPayload.topic, payload: knxMsgPayload.payload, dpt: knxMsgPayload.dpt, outputtype: 'write', nodecallerid: node.id })
|
|
269
|
+
}
|
|
270
|
+
|
|
264
271
|
}
|
|
265
272
|
}
|
|
266
273
|
if (_event.hasOwnProperty('color_temperature')) {
|
|
@@ -52,7 +52,7 @@ module.exports = function (RED) {
|
|
|
52
52
|
if (knxMsgPayload.dpt.startsWith('3.007')) {
|
|
53
53
|
if (node.isTimerDimStopRunning === false) {
|
|
54
54
|
// Set KNX Dim up/down start
|
|
55
|
-
knxMsgPayload.payload = { decr_incr: 1, data:
|
|
55
|
+
knxMsgPayload.payload = { decr_incr: 1, data: 5 } // Send to KNX bus
|
|
56
56
|
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.server.writeQueueAdd({ grpaddr: knxMsgPayload.topic, payload: knxMsgPayload.payload, dpt: knxMsgPayload.dpt, outputtype: 'write', nodecallerid: node.id })
|
|
57
57
|
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.status({ fill: 'green', shape: 'dot', text: 'HUE->KNX start Dim' + ' (' + new Date().getDate() + ', ' + new Date().toLocaleTimeString() + ')' })
|
|
58
58
|
}
|
|
@@ -79,7 +79,7 @@ module.exports = function (RED) {
|
|
|
79
79
|
if (knxMsgPayload.dpt.startsWith('3.007')) {
|
|
80
80
|
if (node.isTimerDimStopRunning === false) {
|
|
81
81
|
// Set KNX Dim up/down start
|
|
82
|
-
knxMsgPayload.payload = { decr_incr: 0, data:
|
|
82
|
+
knxMsgPayload.payload = { decr_incr: 0, data: 5 } // Send to KNX bus
|
|
83
83
|
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.server.writeQueueAdd({ grpaddr: knxMsgPayload.topic, payload: knxMsgPayload.payload, dpt: knxMsgPayload.dpt, outputtype: 'write', nodecallerid: node.id })
|
|
84
84
|
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.status({ fill: 'green', shape: 'dot', text: 'HUE->KNX start Dim' + ' (' + new Date().getDate() + ', ' + new Date().toLocaleTimeString() + ')' })
|
|
85
85
|
}
|
|
@@ -112,16 +112,17 @@ module.exports = function (RED) {
|
|
|
112
112
|
|
|
113
113
|
// Timer to stop the dimming sequence
|
|
114
114
|
node.startDimStopper = function (knxMsgPayload) {
|
|
115
|
-
if (node.timerDimStop !== undefined)
|
|
115
|
+
if (node.timerDimStop !== undefined) clearTimeout(node.timerDimStop)
|
|
116
116
|
node.isTimerDimStopRunning = true
|
|
117
117
|
node.timerDimStop = setTimeout(() => {
|
|
118
|
+
console.log("Stop banana")
|
|
118
119
|
// KNX Stop DIM
|
|
119
120
|
knxMsgPayload.payload = { decr_incr: 0, data: 0 } // Payload for the output msg
|
|
120
121
|
// Send to KNX bus
|
|
121
122
|
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.server.writeQueueAdd({ grpaddr: knxMsgPayload.topic, payload: knxMsgPayload.payload, dpt: knxMsgPayload.dpt, outputtype: 'write', nodecallerid: node.id })
|
|
122
123
|
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.status({ fill: 'green', shape: 'dot', text: 'HUE->KNX Stop DIM' + ' (' + new Date().getDate() + ', ' + new Date().toLocaleTimeString() + ')' })
|
|
123
124
|
node.isTimerDimStopRunning = false
|
|
124
|
-
},
|
|
125
|
+
}, 1500)
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
// On each deploy, unsubscribe+resubscribe
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"engines": {
|
|
4
4
|
"node": ">=16.0.0"
|
|
5
5
|
},
|
|
6
|
-
"version": "2.1.
|
|
6
|
+
"version": "2.1.21",
|
|
7
7
|
"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. With integrated Philips HUE devices handling.",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"mkdirp": "3.0.1",
|