node-red-contrib-knx-ultimate 2.0.6 → 2.0.7

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 2.0.7</b> - June 2023<br/>
11
+ - HUE Button node: added an output PIN<br/>
12
+ - HUE Button node: added an option to emit a simplified msg
13
+ </p>
9
14
  <p>
10
15
  <b>Version 2.0.6</b> - June 2023<br/>
11
16
  - NEW: HUE Button node. All HUE integrations are in BETA.<br/>
@@ -115,7 +115,8 @@ module.exports = (RED) => {
115
115
  (async () => {
116
116
  try {
117
117
  // °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
118
- const jRet = await node.hueManager.getDevices(req.query.rtype)
118
+ const _node = RED.nodes.getNode(req.query.nodeID)// Retrieve node.id of the config node.
119
+ const jRet = await node.hueManager.getDevices(req.query.rtype, _node.host, _node.credentials.username)
119
120
  res.json(jRet)
120
121
  // °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
121
122
  } catch (err) {
@@ -32,11 +32,12 @@
32
32
  GAlong_press: { value: "" },
33
33
  dptlong_press: { value: "" },
34
34
 
35
+ outputSimpleMode: { value: true },
35
36
  toggleValues: { value: true },
36
37
  hueDevice: { value: "" }
37
38
  },
38
39
  inputs: 0,
39
- outputs: 0,
40
+ outputs: 1,
40
41
  icon: "node-hue-icon.svg",
41
42
  label: function () {
42
43
  return (this.name);
@@ -533,7 +534,11 @@
533
534
  Toggle values
534
535
  </label>
535
536
  </div>
536
-
537
+ <div class="form-row">
538
+ <input type="checkbox" id="node-input-outputSimpleMode" style="display:inline-block; width:auto; vertical-align:top;" />
539
+ <label style="width:auto" for="node-input-outputSimpleMode"><i class="fa fa-filter">Simple output mode</i></label>
540
+ </div>
541
+
537
542
  </div>
538
543
 
539
544
 
@@ -579,7 +584,8 @@ Start typing in the GA field, the name or group address of your KNX device, the
579
584
  | Short release | Rapid push of the button, fired as soon as you release your finger from the button. Usually used to toggle a KNX light true/false |
580
585
  | Long release | Long press of the button, fired as soon as you release your finger from the button |
581
586
  | Long press | Long press of the button, fired as soon as you long press the button |
582
- | 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. |
587
+ | 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 |
588
+ | Simple output mode | Enables an RBE output on the payload *true/false*, independently from the HUE Button events type. *Repeat* messages are always repeated. When disabled, the node outputs a msg for every different HUE Button events |
583
589
 
584
590
 
585
591
  <br/>
@@ -25,7 +25,6 @@ module.exports = function (RED) {
25
25
  node.serverHue = RED.nodes.getNode(config.serverHue)
26
26
  node.topic = node.name
27
27
  node.name = config.name === undefined ? 'Hue' : config.name
28
- node.outputtopic = node.name
29
28
  node.dpt = ''
30
29
  node.notifyreadrequest = false
31
30
  node.notifyreadrequestalsorespondtobus = 'false'
@@ -49,7 +48,7 @@ module.exports = function (RED) {
49
48
  node.toggle4 = false
50
49
  node.toggle5 = false
51
50
  node.toggle5 = false
52
-
51
+ node.rbeOutputPayload = undefined
53
52
 
54
53
  // Read the state of the light and store it in the holding object
55
54
  try {
@@ -122,6 +121,18 @@ module.exports = function (RED) {
122
121
  node.status({ fill: 'green', shape: 'dot', text: 'HUE->KNX ' + _event.button.last_event + ' ' + JSON.stringify(knxMsgPayload.payload) + ' (' + new Date().getDate() + ', ' + new Date().toLocaleTimeString() + ')' })
123
122
  if (knxMsgPayload.ga !== '' && knxMsgPayload.ga !== undefined) node.server.writeQueueAdd({ grpaddr: knxMsgPayload.ga, payload: knxMsgPayload.payload, dpt: knxMsgPayload.dpt, outputtype: 'write', nodecallerid: node.id })
124
123
  }
124
+ // Setup the output msg
125
+ knxMsgPayload.topic = knxMsgPayload.ga
126
+ delete knxMsgPayload.ga
127
+ knxMsgPayload.name = node.name
128
+ knxMsgPayload.event = _event.button.last_event
129
+
130
+ // Applying rbe filter
131
+ if (config.outputSimpleMode && knxMsgPayload.payload !== node.rbeOutputPayload) {
132
+ node.rbeOutputPayload = knxMsgPayload.payload
133
+ } else {
134
+ node.send(knxMsgPayload)
135
+ }
125
136
  }
126
137
  } catch (error) {
127
138
  node.status({ fill: 'red', shape: 'dot', text: 'HUE->KNX error ' + error.message + ' (' + new Date().getDate() + ', ' + new Date().toLocaleTimeString() + ')' })
@@ -17,10 +17,10 @@ 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
- getDevices = async (_rtype) => {
20
+ getDevices = async (_rtype, _host, _username) => {
21
21
  try {
22
22
  // V2
23
- const hue = hueApiV2.connect({ host: this.HUEBridgeIP, key: this.username })
23
+ const hue = hueApiV2.connect({ host: _host, key: _username })
24
24
  const retArray = []
25
25
  const allResources = await hue.getResources()
26
26
  const allRooms = await hue.getRooms()
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "engines": {
4
4
  "node": ">=14.0.0"
5
5
  },
6
- "version": "2.0.6",
6
+ "version": "2.0.7",
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",