node-red-contrib-knx-ultimate 2.0.14 → 2.0.15
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 +7 -1
- package/nodes/hue-config.js +4 -4
- package/nodes/knxUltimateHueButton.html +1 -1
- package/nodes/knxUltimateHueLight.html +39 -50
- package/nodes/knxUltimateHueLight.js +19 -3
- package/nodes/knxUltimateHueLightSensor.html +1 -1
- package/nodes/knxUltimateHueMotion.html +1 -1
- package/nodes/knxUltimateHueTapDial.html +1 -1
- package/nodes/knxUltimateHueTemperatureSensor.html +5 -5
- package/nodes/knxUltimateHueTemperatureSensor.js +7 -7
- package/nodes/utils/hueUtils.js +4 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,9 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
# CHANGELOG
|
|
8
8
|
|
|
9
|
+
<p>
|
|
10
|
+
<b>Version 2.0.15</b> - June 2023<br/>
|
|
11
|
+
- HUE: CAUTION POSSIBLE BREAKING CHANGES TO THE HUE NODES. PLEASE BE AWARE THAT HUE NODES ARE STILL IN BETA<br/>
|
|
12
|
+
- NEW: Temperature sensor.<br/>
|
|
13
|
+
- Changes to HUE Light node, to mime the ISE KNX CONNECT HUE beavior.<br/>
|
|
14
|
+
</p>
|
|
9
15
|
<p>
|
|
10
16
|
<b>Version 2.0.13</b> - June 2023<br/>
|
|
11
|
-
- HUE: CAUTION BREAKING CHANGES TO THE HUE NODES. PLEASE BE AWARE THAT HUE NODES ARE STILL IN BETA<br/>
|
|
17
|
+
- HUE: CAUTION POSSIBLE BREAKING CHANGES TO THE HUE NODES. PLEASE BE AWARE THAT HUE NODES ARE STILL IN BETA<br/>
|
|
12
18
|
- Hue Button node: fixed missing events in output msg.<br/>
|
|
13
19
|
</p>
|
|
14
20
|
<p>
|
package/nodes/hue-config.js
CHANGED
|
@@ -91,22 +91,22 @@ module.exports = (RED) => {
|
|
|
91
91
|
})
|
|
92
92
|
|
|
93
93
|
|
|
94
|
-
RED.httpAdmin.get('/
|
|
94
|
+
RED.httpAdmin.get('/KNXUltimateGetResourcesHUE', RED.auth.needsPermission('hue-config.read'), function (req, res) {
|
|
95
95
|
try {
|
|
96
96
|
(async () => {
|
|
97
97
|
try {
|
|
98
98
|
// °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
|
|
99
99
|
const _node = RED.nodes.getNode(req.query.nodeID)// Retrieve node.id of the config node.
|
|
100
|
-
const jRet = await node.hueManager.
|
|
100
|
+
const jRet = await node.hueManager.getResources(req.query.rtype, _node.host, _node.credentials.username)
|
|
101
101
|
res.json(jRet)
|
|
102
102
|
// °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
|
|
103
103
|
} catch (err) {
|
|
104
|
-
RED.log.error('Errore
|
|
104
|
+
RED.log.error('Errore KNXUltimateGetResourcesHUE non gestito ' + err.message)
|
|
105
105
|
res.json({ error: err.message })
|
|
106
106
|
}
|
|
107
107
|
})()
|
|
108
108
|
} catch (err) {
|
|
109
|
-
RED.log.error('Errore
|
|
109
|
+
RED.log.error('Errore KNXUltimateGetResourcesHUE bsonto ' + err.message)
|
|
110
110
|
res.json({ error: err.message })
|
|
111
111
|
}
|
|
112
112
|
})
|
|
@@ -265,7 +265,7 @@
|
|
|
265
265
|
$("#node-input-name").autocomplete({
|
|
266
266
|
minLength: 1,
|
|
267
267
|
source: function (request, response) {
|
|
268
|
-
$.getJSON("
|
|
268
|
+
$.getJSON("KNXUltimateGetResourcesHUE?rtype=button&nodeID=" + oNodeServerHue.id, (data) => {
|
|
269
269
|
response($.map(data.devices, function (value, key) {
|
|
270
270
|
//alert(JSON.stringify(value) + " "+ key)
|
|
271
271
|
var sSearch = (value.name);
|
|
@@ -401,7 +401,7 @@
|
|
|
401
401
|
$("#node-input-name").autocomplete({
|
|
402
402
|
minLength: 1,
|
|
403
403
|
source: function (request, response) {
|
|
404
|
-
$.getJSON("
|
|
404
|
+
$.getJSON("KNXUltimateGetResourcesHUE?rtype=light&nodeID=" + oNodeServerHue.id, (data) => {
|
|
405
405
|
response($.map(data.devices, function (value, key) {
|
|
406
406
|
//alert(JSON.stringify(value) + " "+ key)
|
|
407
407
|
var sSearch = (value.name);
|
|
@@ -480,7 +480,7 @@
|
|
|
480
480
|
<!-- <p> <img src='https://raw.githubusercontent.com/Supergiovane/node-red-contrib-knx-ultimate/master/img/knx.png' width='32px'> -> <img src='https://raw.githubusercontent.com/Supergiovane/node-red-contrib-knx-ultimate/master/img/hue.png' width='32px'></p> -->
|
|
481
481
|
|
|
482
482
|
<p>
|
|
483
|
-
<b>KNX
|
|
483
|
+
<b>KNX LINK</b>
|
|
484
484
|
</p>
|
|
485
485
|
<div class="form-row">
|
|
486
486
|
<label for="node-input-nameLightSwitch" style="width:100px;"><i class="fa fa-play-circle-o"></i> <span data-i18n="knxUltimateHueLight.node-input-nameLightSwitch"></span></label>
|
|
@@ -494,6 +494,19 @@
|
|
|
494
494
|
<label for="node-input-nameLightSwitch" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
|
|
495
495
|
<input type="text" id="node-input-nameLightSwitch" style="width:200px;margin-left: 5px; text-align: left;">
|
|
496
496
|
</div>
|
|
497
|
+
<div class="form-row">
|
|
498
|
+
<label for="node-input-nameLightState" style="width:100px;"><i class="fa fa-play-circle-o"></i> Switch Status</label>
|
|
499
|
+
|
|
500
|
+
<label for="node-input-GALightState" style="width:20px;">GA</label>
|
|
501
|
+
<input type="text" id="node-input-GALightState" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
|
|
502
|
+
|
|
503
|
+
<label for="node-input-dptLightState" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
|
|
504
|
+
<select id="node-input-dptLightState" style="width:140px;"></select>
|
|
505
|
+
|
|
506
|
+
<label for="node-input-nameLightState" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
|
|
507
|
+
<input type="text" id="node-input-nameLightState" style="width:200px;margin-left: 5px; text-align: left;">
|
|
508
|
+
</div>
|
|
509
|
+
<br/>
|
|
497
510
|
</div>
|
|
498
511
|
<div class="form-row">
|
|
499
512
|
<label for="node-input-nameLightDIM" style="width:100px;"><i class="fa fa-play-circle-o"></i> Dimming</label>
|
|
@@ -507,6 +520,7 @@
|
|
|
507
520
|
<label for="node-input-nameLightDIM" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
|
|
508
521
|
<input type="text" id="node-input-nameLightDIM" style="width:200px;margin-left: 5px; text-align: left;">
|
|
509
522
|
</div>
|
|
523
|
+
<br/>
|
|
510
524
|
</div>
|
|
511
525
|
<div class="form-row">
|
|
512
526
|
<label for="node-input-nameLightColor" style="width:100px;"><i class="fa fa-play-circle-o"></i> Color</label>
|
|
@@ -520,6 +534,19 @@
|
|
|
520
534
|
<label for="node-input-nameLightColor" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
|
|
521
535
|
<input type="text" id="node-input-nameLightColor" style="width:200px;margin-left: 5px; text-align: left;">
|
|
522
536
|
</div>
|
|
537
|
+
<div class="form-row">
|
|
538
|
+
<label for="node-input-nameLightColorState" style="width:100px;"><i class="fa fa-play-circle-o"></i> Color Status</label>
|
|
539
|
+
|
|
540
|
+
<label for="node-input-GALightColorState" style="width:20px;"><span data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
|
|
541
|
+
<input type="text" id="node-input-GALightColorState" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
|
|
542
|
+
|
|
543
|
+
<label for="node-input-dptLightColorState" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
|
|
544
|
+
<select id="node-input-dptLightColorState" style="width:140px;"></select>
|
|
545
|
+
|
|
546
|
+
<label for="node-input-nameLightColorState" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
|
|
547
|
+
<input type="text" id="node-input-nameLightColorState" style="width:200px;margin-left: 5px; text-align: left;">
|
|
548
|
+
</div>
|
|
549
|
+
<br/>
|
|
523
550
|
</div>
|
|
524
551
|
</div>
|
|
525
552
|
<div class="form-row">
|
|
@@ -534,37 +561,7 @@
|
|
|
534
561
|
<label for="node-input-nameLightBrightness" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
|
|
535
562
|
<input type="text" id="node-input-nameLightBrightness" style="width:200px;margin-left: 5px; text-align: left;">
|
|
536
563
|
</div>
|
|
537
|
-
|
|
538
|
-
<br/>
|
|
539
|
-
<p>
|
|
540
|
-
<b>PHILIPS HUE LIGHT STATE -> TO KNX</b>
|
|
541
|
-
</p>
|
|
542
|
-
|
|
543
|
-
<div class="form-row">
|
|
544
|
-
<label for="node-input-nameLightState" style="width:100px;"><i class="fa fa-play-circle-o"></i> Switch Status</label>
|
|
545
|
-
|
|
546
|
-
<label for="node-input-GALightState" style="width:20px;">GA</label>
|
|
547
|
-
<input type="text" id="node-input-GALightState" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
|
|
548
|
-
|
|
549
|
-
<label for="node-input-dptLightState" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
|
|
550
|
-
<select id="node-input-dptLightState" style="width:140px;"></select>
|
|
551
|
-
|
|
552
|
-
<label for="node-input-nameLightState" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
|
|
553
|
-
<input type="text" id="node-input-nameLightState" style="width:200px;margin-left: 5px; text-align: left;">
|
|
554
|
-
</div>
|
|
555
|
-
<div class="form-row">
|
|
556
|
-
<label for="node-input-nameLightColorState" style="width:100px;"><i class="fa fa-play-circle-o"></i> Color Status</label>
|
|
557
|
-
|
|
558
|
-
<label for="node-input-GALightColorState" style="width:20px;"><span data-i18n="knxUltimateHueLight.node-input-GALightState"></span></label>
|
|
559
|
-
<input type="text" id="node-input-GALightColorState" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
|
|
560
|
-
|
|
561
|
-
<label for="node-input-dptLightColorState" style="width:40px; margin-left: 0px; text-align: right;">DPT</label>
|
|
562
|
-
<select id="node-input-dptLightColorState" style="width:140px;"></select>
|
|
563
|
-
|
|
564
|
-
<label for="node-input-nameLightColorState" style="width:50px; margin-left: 0px; text-align: right;"><span data-i18n="knxUltimateHueLight.node-input-name"></span></label>
|
|
565
|
-
<input type="text" id="node-input-nameLightColorState" style="width:200px;margin-left: 5px; text-align: left;">
|
|
566
|
-
</div>
|
|
567
|
-
</div>
|
|
564
|
+
</div>
|
|
568
565
|
<div class="form-row">
|
|
569
566
|
<label for="node-input-nameLightBrightnessState" style="width:100px;"><i class="fa fa-play-circle-o"></i>Brightness Status</label>
|
|
570
567
|
|
|
@@ -585,7 +582,7 @@
|
|
|
585
582
|
|
|
586
583
|
|
|
587
584
|
<script type="text/markdown" data-help-name="knxUltimateHueLight">
|
|
588
|
-
<p>This node lets you control your Philips HUE light and also get the states of this lights.
|
|
585
|
+
<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.
|
|
589
586
|
|
|
590
587
|
**General**
|
|
591
588
|
|Property|Description|
|
|
@@ -596,28 +593,20 @@
|
|
|
596
593
|
|
|
597
594
|
<br/>
|
|
598
595
|
|
|
599
|
-
**KNX
|
|
600
|
-
|
|
596
|
+
**KNX LINK**
|
|
597
|
+
|
|
598
|
+
Here you can choose the KNX addresses to be linked to the avaiable HUE light commands/states.<br/>
|
|
601
599
|
Start typing in the GA field, the name or group address of your KNX device, the avaiable devices start showing up while you're typing.
|
|
602
600
|
|
|
603
601
|
|Property|Description|
|
|
604
602
|
|--|--|
|
|
605
|
-
| Switch | This
|
|
606
|
-
|
|
|
603
|
+
| Switch | This GA is used to turn on/off the HUE light via a boolean KNX value true/false|
|
|
604
|
+
| Switch Status| Link this to the light's switch status group address|
|
|
605
|
+
| Dimming | Relative DIM the HUE light |
|
|
607
606
|
| Color | This command is used to change the HUE light's color. Accepted datapoint is RGB triplet (r,g,b). The node handles the gamut color correction. As soon as you send a color KNX telegran, the light turns on and sets color and brightness, derived from the brightness human perception. As soon as you send a KNX telegram with r,g,b set to zero, the light turns off |
|
|
607
|
+
| Color Status | Link this to the light's color status group address. Accepted datapoint is RGB triplet (r,g,b)|
|
|
608
608
|
| Brightness | This command is used to change the absolute HUE light's brightness |
|
|
609
|
-
|
|
610
|
-
<br/>
|
|
611
|
-
|
|
612
|
-
**PHILIPS HUE LIGHT STATE -> TO KNX**
|
|
613
|
-
Here you can link the state changes of your HUE light, to any KNX group address you want.<br/>
|
|
614
|
-
Start typing in the GA field, the name or group address of your KNX device, the avaiable devices start showing up while you're typing.
|
|
615
|
-
|
|
616
|
-
|Property|Description|
|
|
617
|
-
|--|--|
|
|
618
|
-
| Switch Status| This state is used to send on/off value to the selected KNX group address |
|
|
619
|
-
| Color Status | This state is used to send changes of the HUE light's color. Accepted datapoint is RGB triplet (r,g,b)|
|
|
620
|
-
| Brightness Status| This state is used to send changes of your absolute HUE light's brightness, to a KNX group address |
|
|
609
|
+
| Brightness Status| Link this to the light's brightness status group address |
|
|
621
610
|
|
|
622
611
|
<br/>
|
|
623
612
|
|
|
@@ -103,21 +103,37 @@ module.exports = function (RED) {
|
|
|
103
103
|
knxMsgPayload.topic = config.GALightState
|
|
104
104
|
knxMsgPayload.dpt = config.dptLightState
|
|
105
105
|
knxMsgPayload.payload = _event.on.on
|
|
106
|
+
// Send to KNX bus
|
|
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
|
+
// ISE Connect Hue emulation, send brightness
|
|
109
|
+
knxMsgPayload.topic = config.GALightBrightnessState
|
|
110
|
+
knxMsgPayload.dpt = config.dptLightBrightnessState
|
|
111
|
+
_event.on.on === true ? knxMsgPayload.payload = 100 : 0
|
|
112
|
+
// Send to KNX bus
|
|
113
|
+
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.server.writeQueueAdd({ grpaddr: knxMsgPayload.topic, payload: knxMsgPayload.payload, dpt: knxMsgPayload.dpt, outputtype: 'write', nodecallerid: node.id })
|
|
106
114
|
}
|
|
107
115
|
if (_event.hasOwnProperty('color')) {
|
|
108
116
|
knxMsgPayload.topic = config.GALightColorState
|
|
109
117
|
knxMsgPayload.dpt = config.dptLightColorState
|
|
110
118
|
knxMsgPayload.payload = hueColorConverter.ColorConverter.xyBriToRgb(_event.color.xy.x, _event.color.xy.y, node.currentHUEDevice.dimming.brightness)
|
|
119
|
+
// Send to KNX bus
|
|
120
|
+
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.server.writeQueueAdd({ grpaddr: knxMsgPayload.topic, payload: knxMsgPayload.payload, dpt: knxMsgPayload.dpt, outputtype: 'write', nodecallerid: node.id })
|
|
111
121
|
}
|
|
112
122
|
if (_event.hasOwnProperty('dimming')) {
|
|
113
123
|
knxMsgPayload.topic = config.GALightBrightnessState
|
|
114
124
|
knxMsgPayload.dpt = config.dptLightBrightnessState
|
|
115
125
|
knxMsgPayload.payload = _event.dimming.brightness
|
|
126
|
+
// Send to KNX bus
|
|
127
|
+
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.server.writeQueueAdd({ grpaddr: knxMsgPayload.topic, payload: knxMsgPayload.payload, dpt: knxMsgPayload.dpt, outputtype: 'write', nodecallerid: node.id })
|
|
128
|
+
// ISE Connect Hue emulation, send true/false to switch state
|
|
129
|
+
knxMsgPayload.topic = config.GALightState
|
|
130
|
+
knxMsgPayload.dpt = config.dptLightState
|
|
131
|
+
_event.dimming.brightness > 0 ? knxMsgPayload.payload = true : false
|
|
132
|
+
// Send to KNX bus
|
|
133
|
+
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.server.writeQueueAdd({ grpaddr: knxMsgPayload.topic, payload: knxMsgPayload.payload, dpt: knxMsgPayload.dpt, outputtype: 'write', nodecallerid: node.id })
|
|
134
|
+
|
|
116
135
|
}
|
|
117
|
-
// Send to KNX bus
|
|
118
|
-
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.server.writeQueueAdd({ grpaddr: knxMsgPayload.topic, payload: knxMsgPayload.payload, dpt: knxMsgPayload.dpt, outputtype: 'write', nodecallerid: node.id })
|
|
119
136
|
node.status({ fill: 'green', shape: 'dot', text: 'HUE->KNX State ' + JSON.stringify(knxMsgPayload.payload) + ' (' + new Date().getDate() + ', ' + new Date().toLocaleTimeString() + ')' })
|
|
120
|
-
|
|
121
137
|
}
|
|
122
138
|
} catch (error) {
|
|
123
139
|
node.status({ fill: 'red', shape: 'dot', text: 'HUE->KNX error ' + error.message + ' (' + new Date().getDate() + ', ' + new Date().toLocaleTimeString() + ')' })
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
$("#node-input-name").autocomplete({
|
|
118
118
|
minLength: 1,
|
|
119
119
|
source: function (request, response) {
|
|
120
|
-
$.getJSON("
|
|
120
|
+
$.getJSON("KNXUltimateGetResourcesHUE?rtype=light_level&nodeID=" + oNodeServerHue.id, (data) => {
|
|
121
121
|
response($.map(data.devices, function (value, key) {
|
|
122
122
|
//alert(JSON.stringify(value) + " "+ key)
|
|
123
123
|
var sSearch = (value.name);
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
$("#node-input-name").autocomplete({
|
|
118
118
|
minLength: 1,
|
|
119
119
|
source: function (request, response) {
|
|
120
|
-
$.getJSON("
|
|
120
|
+
$.getJSON("KNXUltimateGetResourcesHUE?rtype=motion&nodeID=" + oNodeServerHue.id, (data) => {
|
|
121
121
|
response($.map(data.devices, function (value, key) {
|
|
122
122
|
//alert(JSON.stringify(value) + " "+ key)
|
|
123
123
|
var sSearch = (value.name);
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
$("#node-input-name").autocomplete({
|
|
120
120
|
minLength: 1,
|
|
121
121
|
source: function (request, response) {
|
|
122
|
-
$.getJSON("
|
|
122
|
+
$.getJSON("KNXUltimateGetResourcesHUE?rtype=relative_rotary&nodeID=" + oNodeServerHue.id, (data) => {
|
|
123
123
|
response($.map(data.devices, function (value, key) {
|
|
124
124
|
//alert(JSON.stringify(value) + " "+ key)
|
|
125
125
|
var sSearch = (value.name);
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
$("#node-input-name").autocomplete({
|
|
118
118
|
minLength: 1,
|
|
119
119
|
source: function (request, response) {
|
|
120
|
-
$.getJSON("
|
|
120
|
+
$.getJSON("KNXUltimateGetResourcesHUE?rtype=temperature&nodeID=" + oNodeServerHue.id, (data) => {
|
|
121
121
|
response($.map(data.devices, function (value, key) {
|
|
122
122
|
//alert(JSON.stringify(value) + " "+ key)
|
|
123
123
|
var sSearch = (value.name);
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
</p>
|
|
198
198
|
|
|
199
199
|
<div class="form-row">
|
|
200
|
-
<label for="node-input-nametemperaturesensor" style="width:100px;"><i class="fa fa-play-circle-o"></i>
|
|
200
|
+
<label for="node-input-nametemperaturesensor" style="width:100px;"><i class="fa fa-play-circle-o"></i> Temp °C</span></label>
|
|
201
201
|
|
|
202
202
|
<label for="node-input-GAtemperaturesensor" style="width:20px;">GA</label>
|
|
203
203
|
<input type="text" id="node-input-GAtemperaturesensor" placeholder="Ex: 1/1/1" style="width:70px;margin-left: 5px; text-align: left;">
|
|
@@ -220,9 +220,9 @@
|
|
|
220
220
|
</script>
|
|
221
221
|
|
|
222
222
|
<script type="text/markdown" data-help-name="knxUltimateHueTemperatureSensor">
|
|
223
|
-
<p> This node lets you get the events from your HUE
|
|
223
|
+
<p> This node lets you get the events from your HUE temperature device.<br/>
|
|
224
224
|
|
|
225
|
-
Here you can get the HUE
|
|
225
|
+
Here you can get the HUE temperature events, that represents a celsius value, evetytime the ambient temp changes.<br/>
|
|
226
226
|
Start typing in the GA field, the name or group address of your KNX device, the avaiable devices start showing up while you're typing.
|
|
227
227
|
|
|
228
228
|
**General**
|
|
@@ -235,7 +235,7 @@ Start typing in the GA field, the name or group address of your KNX device, the
|
|
|
235
235
|
**PHILIPS HUE LIGHT EVENTS -> TO KNX**
|
|
236
236
|
|Property|Description|
|
|
237
237
|
|--|--|
|
|
238
|
-
|
|
|
238
|
+
| Temp | temperature value, in Celsius degrees |
|
|
239
239
|
|
|
240
240
|
### Outputs
|
|
241
241
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module.exports = function (RED) {
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
function
|
|
4
|
+
function knxUltimateHueTemperatureSensor(config) {
|
|
5
5
|
RED.nodes.createNode(this, config)
|
|
6
6
|
const node = this
|
|
7
7
|
node.server = RED.nodes.getNode(config.server)
|
|
@@ -40,18 +40,18 @@ module.exports = function (RED) {
|
|
|
40
40
|
try {
|
|
41
41
|
if (_event.id === config.hueDevice) {
|
|
42
42
|
const knxMsgPayload = {}
|
|
43
|
-
knxMsgPayload.topic = config.
|
|
44
|
-
knxMsgPayload.dpt = config.
|
|
43
|
+
knxMsgPayload.topic = config.GAtemperaturesensor
|
|
44
|
+
knxMsgPayload.dpt = config.dpttemperaturesensor
|
|
45
45
|
|
|
46
|
-
if (_event.hasOwnProperty('
|
|
47
|
-
knxMsgPayload.payload =
|
|
46
|
+
if (_event.hasOwnProperty('temperature') && _event.temperature.hasOwnProperty('temperature')) {
|
|
47
|
+
knxMsgPayload.payload = _event.temperature.temperature
|
|
48
48
|
// Send to KNX bus
|
|
49
49
|
if (knxMsgPayload.topic !== '' && knxMsgPayload.topic !== undefined) node.server.writeQueueAdd({ grpaddr: knxMsgPayload.topic, payload: knxMsgPayload.payload, dpt: knxMsgPayload.dpt, outputtype: 'write', nodecallerid: node.id })
|
|
50
50
|
node.status({ fill: 'green', shape: 'dot', text: 'HUE->KNX ' + JSON.stringify(knxMsgPayload.payload) + ' (' + new Date().getDate() + ', ' + new Date().toLocaleTimeString() + ')' })
|
|
51
51
|
|
|
52
52
|
// Setup the output msg
|
|
53
53
|
knxMsgPayload.name = node.name
|
|
54
|
-
knxMsgPayload.event = '
|
|
54
|
+
knxMsgPayload.event = 'temperature'
|
|
55
55
|
|
|
56
56
|
// Send payload
|
|
57
57
|
knxMsgPayload.rawEvent = _event
|
|
@@ -84,5 +84,5 @@ module.exports = function (RED) {
|
|
|
84
84
|
done()
|
|
85
85
|
})
|
|
86
86
|
}
|
|
87
|
-
RED.nodes.registerType('
|
|
87
|
+
RED.nodes.registerType('knxUltimateHueTemperatureSensor', knxUltimateHueTemperatureSensor)
|
|
88
88
|
}
|
package/nodes/utils/hueUtils.js
CHANGED
|
@@ -17,7 +17,7 @@ class classHUE extends EventEmitter {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// Get all devices and join it with relative rooms, by adding the room name to the device name
|
|
20
|
-
|
|
20
|
+
getResources = async (_rtype, _host, _username) => {
|
|
21
21
|
try {
|
|
22
22
|
// V2
|
|
23
23
|
const hue = hueApiV2.connect({ host: _host, key: _username })
|
|
@@ -51,6 +51,9 @@ class classHUE extends EventEmitter {
|
|
|
51
51
|
if (_rtype === 'temperature') {
|
|
52
52
|
retArray.push({ name: 'Temp: ' + linkedDevName + (Room !== undefined ? ', room ' + Room.metadata.name : ''), id: device.id })
|
|
53
53
|
}
|
|
54
|
+
if (_rtype === 'scene') {
|
|
55
|
+
retArray.push({ name: 'Temp: ' + linkedDevName + (Room !== undefined ? ', room ' + Room.metadata.name : ''), id: device.id })
|
|
56
|
+
}
|
|
54
57
|
|
|
55
58
|
})
|
|
56
59
|
return { devices: retArray }
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"engines": {
|
|
4
4
|
"node": ">=14.0.0"
|
|
5
5
|
},
|
|
6
|
-
"version": "2.0.
|
|
6
|
+
"version": "2.0.15",
|
|
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": "1.0.4",
|