node-red-contrib-ccu 4.15.0 → 4.17.0

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
@@ -5,6 +5,59 @@ Notable changes to node-red-contrib-ccu. Format follows
5
5
  user-visible symptom and the cause, not the commit list (the release notes
6
6
  append commits automatically).
7
7
 
8
+ ## 4.17.0 (2026-11-28)
9
+
10
+ ### Changed
11
+
12
+ - **sysvar and program: new default topics** `hm/status/sysvar/${Name}` and
13
+ `hm/status/program/${Name}` (both were `ReGaHSS/${Name}`). They apply to
14
+ newly placed nodes; nodes already in a flow keep the topic they were saved
15
+ with.
16
+
17
+ ### Fixed
18
+
19
+ - **openccu-lite: a system variable or program made in the Logic addon while
20
+ Node-RED runs was missing** from the sysvar and program nodes' lists, and
21
+ their nodes did not find it, until its value was first written (a computed
22
+ value: until its inputs changed) or Node-RED was restarted. The connection
23
+ took a Logic object only from a value event, and Logic announces a new one
24
+ without. Now its values are read as soon as Logic announces it, so it is
25
+ listed at once - first under its key if the name is not there yet, then
26
+ under its name, and after a rename under the new one.
27
+
28
+ ## 4.16.0 (2026-11-28)
29
+
30
+ ### Added
31
+
32
+ - **display: the HmIP-WRCD.** The display node has the new type `HmIP-WRCD`
33
+ for the wall-mount remote with e-paper display: five lines of 16
34
+ characters, per line an icon, the alignment, text colour and background,
35
+ and a sound with repetitions and interval - written in one command to the
36
+ device's channel 3. A line set to _Don't touch_ stays as it is, and
37
+ `msg.lineX`, `msg.iconX`, `msg.colorX`, `msg.backgroundX` and `msg.alignX`
38
+ set a line from the message. Umlauts are translated for the display. Not
39
+ yet tried on a device (#144, @BayerSe).
40
+ - **signal: channels of the type `OPTICAL_SIGNAL_RECEIVER`** (the LEDs of an
41
+ HmIPW-WRC6) take the same command as the HmIP-BSL: colour, brightness,
42
+ behaviour, duration and ramp.
43
+ - **Device data for the HmIP-BSL 2.0.2, HmIP-RGBW, HmIP-DRG-DALI, HmIP-WRCD
44
+ and HmIPW-WRC6.** The shipped `paramsets.json` now describes these devices,
45
+ so their datapoints are in the editor's lists before the system has been
46
+ asked for them. The descriptions come from
47
+ [pydevccu](https://github.com/SukramJ/pydevccu)'s dumps of real devices.
48
+
49
+ ### Fixed
50
+
51
+ - **signal: the LED of an HmIP-BSL with firmware 2.x stayed dark.** From
52
+ firmware 2 on the device has the datapoint `COLOR_BEHAVIOUR` beside colour
53
+ and brightness, and its default is `OFF`; the signal node did not send it.
54
+ The node now sends it to every channel that has it, and has the new
55
+ setting _Behaviour_ (steady light, blinking, flashing or billowing, each
56
+ slow, medium or fast; `msg.config.colorBehaviour` as a number or a name). A
57
+ flow of before sends the steady light. An HmIP-BSL with firmware 1.x gets
58
+ exactly what it got before. Not yet tried on a device
59
+ (#177, @TinkyWonky; the workaround that showed the way is @andesse's).
60
+
8
61
  ## 4.15.0 (2026-11-27)
9
62
 
10
63
  ### Changed
package/README.md CHANGED
@@ -72,20 +72,22 @@ CCU-Jack keep their own connections.
72
72
 
73
73
  Every node that emits messages builds `msg.topic` from the same template, configurable per node, with these defaults:
74
74
 
75
- | Node | Default topic |
76
- | --------------- | ------------------------------------------------- |
77
- | rpc-event | `${CCU}/${Interface}/${channelName}/${datapoint}` |
78
- | value | `${CCU}/${Interface}/${channel}/${datapoint}` |
79
- | get value | _(empty: `msg.topic` stays as it came in)_ |
80
- | sysvar, program | `ReGaHSS/${Name}` |
81
- | rpc | `${CCU}/${Interface}/${Method}` |
82
- | script | `${CCU}/${Interface}` |
75
+ | Node | Default topic |
76
+ | --------- | ------------------------------------------------- |
77
+ | rpc-event | `${CCU}/${Interface}/${channelName}/${datapoint}` |
78
+ | value | `${CCU}/${Interface}/${channel}/${datapoint}` |
79
+ | get value | _(empty: `msg.topic` stays as it came in)_ |
80
+ | sysvar | `hm/status/sysvar/${Name}` |
81
+ | program | `hm/status/program/${Name}` |
82
+ | rpc | `${CCU}/${Interface}/${Method}` |
83
+ | script | `${CCU}/${Interface}` |
83
84
 
84
85
  Placeholders are the message's properties, matched case-insensitively: `${CCU}`, `${Interface}`, `${device}`,
85
86
  `${deviceName}`, `${deviceType}`, `${channel}`, `${channelName}`, `${channelType}`, `${channelIndex}`, `${datapoint}`,
86
87
  `${datapointName}`; `${Name}` for a variable or program, `${Method}` for an RPC call. To get one scheme everywhere -
87
- `hm/<interface>/<channel>/<datapoint>`, say - enter `hm/${Interface}/${channel}/${datapoint}` in each node; the defaults
88
- stay as they are so existing flows and subscriptions keep working. The value node's input accepts a datapoint address in
88
+ `hm/<interface>/<channel>/<datapoint>`, say - enter `hm/${Interface}/${channel}/${datapoint}` in each node. A default
89
+ applies to newly placed nodes only: existing nodes keep the topic they were saved with (the default of the sysvar
90
+ and program nodes was `ReGaHSS/${Name}` until 4.16.0), so existing flows and subscriptions keep working. The value node's input accepts a datapoint address in
89
91
  `msg.topic` either as `iface.channel.datapoint` or in the emitted shape (`ccu3/BidCos-RF/OEQ1868878:1/STATE`,
90
92
  `hm/BidCos-RF/OEQ1868878:1/STATE`: the last three segments count), so an event's topic can be fed straight back. The
91
93
  `ccu-mqtt` node has its own templates for its MQTT topics.
package/docs/paramsets.md CHANGED
@@ -156,6 +156,28 @@ Optional later phase: rftypes→description converter for full BidCos coverage
156
156
  (medium effort, low demand — BidCos is EOL hardware and the runtime
157
157
  self-heals).
158
158
 
159
+ ### 3a. Device types no system at hand has: pydevccu's dumps (2026-11-28)
160
+
161
+ A device type neither the maintainer's systems nor a reporter's dump has can
162
+ come from [pydevccu](https://github.com/SukramJ/pydevccu) (MIT): its
163
+ `device_descriptions/<type>.json` is the `listDevices` result and its
164
+ `paramset_descriptions/<type>.json` the `getParamsetDescription` results of
165
+ a real device. `tools/paramsets-from-pydevccu.js` writes them as a dump with
166
+ the keys of `paramsets.json`, which the join tool merges as any other:
167
+
168
+ ```
169
+ node tools/paramsets-from-pydevccu.js --dir <pydevccu checkout>/pydevccu \
170
+ --out ccu_paramsets_dump.json HmIP-BSL HmIP-RGBW HmIP-DRG-DALI HmIP-WRCD HmIPW-WRC6
171
+ node tools/paramsets-join.js ccu_paramsets_dump.json
172
+ ```
173
+
174
+ Added this way from pydevccu 0.2.6: HmIP-BSL 2.0.2, HmIP-RGBW 1.0.52,
175
+ HmIP-DRG-DALI 1.4.8, HmIP-WRCD 1.4.6 and HmIPW-WRC6 1.0.8 (73 keys). The
176
+ HmIP-BSL 2.0.2 still reports its LED channels as `DIMMER_VIRTUAL_RECEIVER`,
177
+ now with `COLOR_BEHAVIOUR`; `OPTICAL_SIGNAL_RECEIVER` (the same datapoints)
178
+ is the HmIPW-WRC6's channel type. That corrects the #177 row below, which
179
+ was written from the firmware's device files.
180
+
159
181
  ## 4. Per-issue findings
160
182
 
161
183
  | Issue | Device | In paramsets.json? | Firmware/live says | Verdict |
@@ -424,9 +424,12 @@ module.exports = function (RED) {
424
424
  if (devices) {
425
425
  Object.keys(devices).forEach((addr) => {
426
426
  if (
427
- ['SIGNAL_CHIME', 'SIGNAL_LED', 'ALARM_SWITCH_VIRTUAL_RECEIVER'].includes(
428
- devices[addr].TYPE,
429
- )
427
+ [
428
+ 'SIGNAL_CHIME',
429
+ 'SIGNAL_LED',
430
+ 'ALARM_SWITCH_VIRTUAL_RECEIVER',
431
+ 'OPTICAL_SIGNAL_RECEIVER',
432
+ ].includes(devices[addr].TYPE)
430
433
  ) {
431
434
  object[addr] = {
432
435
  name: config.channelNames[addr],
@@ -458,10 +461,16 @@ module.exports = function (RED) {
458
461
  const devices = config.metadata.devices[request.query.iface];
459
462
  if (devices) {
460
463
  Object.keys(devices).forEach((addr) => {
461
- if (
462
- (addr.endsWith(':3') && devices[addr].PARENT_TYPE.match(/HM-Dis-EP-WM55/)) ||
464
+ if (devices[addr].TYPE === 'ACOUSTIC_DISPLAY_RECEIVER') {
465
+ // the HmIP-WRCD's display and sound channel (#144)
466
+ object[addr] = {
467
+ name: config.channelNames[addr],
468
+ type: 'HmIP-WRCD',
469
+ };
470
+ } else if (
471
+ (addr.endsWith(':3') && String(devices[addr].PARENT_TYPE).match(/HM-Dis-EP-WM55/)) ||
463
472
  ((addr.endsWith(':1') || addr.endsWith(':2')) &&
464
- devices[addr].PARENT_TYPE.match(/HM-Dis-WM55/))
473
+ String(devices[addr].PARENT_TYPE).match(/HM-Dis-WM55/))
465
474
  ) {
466
475
  object[addr] = {
467
476
  name: config.channelNames[addr],
@@ -783,6 +792,8 @@ module.exports = function (RED) {
783
792
  this.liteListed = false;
784
793
  this.logicObjects = {};
785
794
  this.logicWaiters = [];
795
+ // B-52: the state store's picture was taken - Logic objects announced after it are read
796
+ this.litePictured = false;
786
797
  this.metaMode = false;
787
798
  this.meta = null;
788
799
  // #167: minutes between re-reads of channel names, rooms and
@@ -3117,6 +3128,7 @@ module.exports = function (RED) {
3117
3128
  }
3118
3129
  });
3119
3130
  this.logicPictureDone();
3131
+ this.litePictured = true;
3120
3132
  this.logger.debug('lite-rpc: ' + count + ' values from the state store');
3121
3133
  this.cachedValuesReceived = true;
3122
3134
  this.saveValues();
@@ -3404,6 +3416,56 @@ module.exports = function (RED) {
3404
3416
  }
3405
3417
  }
3406
3418
 
3419
+ /**
3420
+ * B-52: Logic announced variables or programs (newDevices): one made after the start has no
3421
+ * value event until it is written, so it would be missing from the editor's lists and from
3422
+ * its nodes until then. Its datapoints are read once, as the start's picture would have
3423
+ * given them. The objects of the connect itself come with the picture and are skipped.
3424
+ * @param {Array<object>} devices the descriptions of the newDevices call
3425
+ */
3426
+ logicAnnounced(devices) {
3427
+ if (!this.litePictured || !this.logicIface || !Array.isArray(devices)) {
3428
+ return;
3429
+ }
3430
+
3431
+ const iface = this.logicIface;
3432
+ devices.forEach((device) => {
3433
+ const ref = logic.parseAddress(device && device.ADDRESS);
3434
+ if (!ref || this.logicObjects[ref.channel]) {
3435
+ return;
3436
+ }
3437
+
3438
+ this.methodCall(iface, 'getParamset', [ref.channel, 'VALUES'], {quiet: true})
3439
+ .then((values) => {
3440
+ if (iface !== this.logicIface || this.logicObjects[ref.channel]) {
3441
+ // an event came first, or the addon went
3442
+ return;
3443
+ }
3444
+
3445
+ const paramset = values && typeof values === 'object' ? values : {};
3446
+ const ts = now();
3447
+ if (ref.kind === 'variable') {
3448
+ this.logicValue(iface, ref.channel, 'VALUE', paramset.VALUE, {ts, picture: true});
3449
+ } else {
3450
+ this.updateLogicProgram(ref, {active: Boolean(paramset.ACTIVE)}, ts, true);
3451
+ this.logicPictureDone();
3452
+ }
3453
+
3454
+ this.logger.debug(
3455
+ 'Logic',
3456
+ ref.channel,
3457
+ 'announced:',
3458
+ JSON.stringify(this.logicObjects[ref.channel] && this.logicObjects[ref.channel].name),
3459
+ );
3460
+ })
3461
+ .catch((error) => {
3462
+ this.logger.warn(
3463
+ 'Logic: ' + ref.channel + ' announced but not readable: ' + (error.message || error),
3464
+ );
3465
+ });
3466
+ });
3467
+ }
3468
+
3407
3469
  /**
3408
3470
  * task 32: the entry of a Logic object under its current name in `table` (this.sysvar or
3409
3471
  * this.program): a rename moves it, a name another object holds is not taken over.
@@ -5001,6 +5063,10 @@ module.exports = function (RED) {
5001
5063
  this.saveMetadata();
5002
5064
  }
5003
5065
 
5066
+ if (iface && iface === this.logicIface) {
5067
+ this.logicAnnounced(devices);
5068
+ }
5069
+
5004
5070
  // B-37: a restart that kept the subscription gets a fresh init, no ping
5005
5071
  if (iface && !this.keptSubscription(iface, 'newDevices')) {
5006
5072
  this.deviceCallback(iface);
@@ -1,4 +1,16 @@
1
1
  <script type="text/javascript">
2
+ // the HmIP-WRCD's icons and sounds, as nodes/lib/wrcd.js has them: the number sent is the index
3
+ const ccuWrcdIcons = [
4
+ 'NO_ICON', 'LAMP_OFF', 'LAMP_ON', 'PADLOCK_OPEN', 'PADLOCK_CLOSED', 'ERROR', 'EVERYTHING_OKAY', 'INFORMATION',
5
+ 'NEW_MESSAGE', 'SERVICE_MESSAGE', 'SUN', 'MOON', 'WIND', 'CLOUD', 'THUNDERSTORM', 'DRIZZLE', 'CLOUD_AND_MOOON',
6
+ 'RAIN', 'SNOW', 'CLOUD_AND_SUN', 'CLOUD_SUN_AND_RAIN', 'SNOWFLAKE', 'RAINDROP', 'FLAME', 'WINDOW_OPEN',
7
+ 'SHUTTERS', 'ECO', 'PROTECTION_DEACTIVATED', 'EXTERNAL_PROTECTION', 'INTERNAL_PROTECTION', 'BELL', 'CLOCK'
8
+ ];
9
+ const ccuWrcdSounds = [
10
+ 'LOW_BATTERY', 'DISARMED', 'INTERNALLY_ARMED', 'EXTERNALLY_ARMED', 'DELAYED_INTERNALLY_ARMED',
11
+ 'DELAYED_EXTERNALLY_ARMED', 'EVENT', 'ERROR'
12
+ ];
13
+
2
14
  RED.nodes.registerType('ccu-display', {
3
15
 
4
16
  category: 'ccu',
@@ -35,6 +47,29 @@
35
47
  repeat: {value: '0xD0'},
36
48
  pause: {value: '0xE0'},
37
49
  sound: {value: '0xC0'},
50
+ wrcdIcon1: {value: '0'},
51
+ wrcdAlign1: {value: 'CENTER'},
52
+ wrcdColor1: {value: 'BLACK'},
53
+ wrcdBackground1: {value: 'WHITE'},
54
+ wrcdIcon2: {value: '0'},
55
+ wrcdAlign2: {value: 'CENTER'},
56
+ wrcdColor2: {value: 'BLACK'},
57
+ wrcdBackground2: {value: 'WHITE'},
58
+ wrcdIcon3: {value: '0'},
59
+ wrcdAlign3: {value: 'CENTER'},
60
+ wrcdColor3: {value: 'BLACK'},
61
+ wrcdBackground3: {value: 'WHITE'},
62
+ wrcdIcon4: {value: '0'},
63
+ wrcdAlign4: {value: 'CENTER'},
64
+ wrcdColor4: {value: 'BLACK'},
65
+ wrcdBackground4: {value: 'WHITE'},
66
+ wrcdIcon5: {value: '0'},
67
+ wrcdAlign5: {value: 'CENTER'},
68
+ wrcdColor5: {value: 'BLACK'},
69
+ wrcdBackground5: {value: 'WHITE'},
70
+ wrcdSound: {value: ''},
71
+ wrcdRepeat: {value: '0'},
72
+ wrcdInterval: {value: '5'},
38
73
  ccuConfig: {value: 'localhost', type: 'ccu-connection', required: true}
39
74
  },
40
75
  inputs: 1,
@@ -56,10 +91,43 @@
56
91
  const $nodeIconX = $('#node-icon-X')[0];
57
92
  const $nodeDisableI = $('#node-disable-X')[0];
58
93
 
94
+ const text = key => this._('ccu-display.' + key);
95
+ const options = list => list.map(([value, label]) => '<option value="' + value + '">' + label + '</option>').join('');
96
+
97
+ // the HmIP-WRCD's rows of line i: the icon, then alignment and colours (#144)
98
+ const wrcdRows = i => {
99
+ const width = share => 'width: calc(' + share + '% - 3px);';
100
+ return '<div class="form-row SUBMIT HmIP-WRCD">' +
101
+ '<label for="node-input-wrcdIcon' + i + '"><i class="icon-envelope"></i>' + text('icon') + ' ' + i + '</label>' +
102
+ '<select id="node-input-wrcdIcon' + i + '" class="ccu-dropdown">' +
103
+ options(ccuWrcdIcons.map((name, index) => [index, text('wrcd.icon.' + name)])) +
104
+ '</select></div>' +
105
+ '<div class="form-row SUBMIT HmIP-WRCD">' +
106
+ '<label for="node-input-wrcdAlign' + i + '"><i class="icon-envelope"></i>' + text('wrcd.style') + ' ' + i + '</label>' +
107
+ '<select id="node-input-wrcdAlign' + i + '" style="' + width(19) + '" title="' + text('wrcd.align') + '">' +
108
+ options([['LEFT', text('wrcd.left')], ['CENTER', text('wrcd.center')], ['RIGHT', text('wrcd.right')]]) +
109
+ '</select> ' +
110
+ '<select id="node-input-wrcdColor' + i + '" style="' + width(27) + '" title="' + text('wrcd.textColor') + '">' +
111
+ options([['BLACK', text('wrcd.textBlack')], ['WHITE', text('wrcd.textWhite')]]) +
112
+ '</select> ' +
113
+ '<select id="node-input-wrcdBackground' + i + '" style="' + width(24) + '" title="' + text('wrcd.background') + '">' +
114
+ options([['WHITE', text('wrcd.onWhite')], ['BLACK', text('wrcd.onBlack')]]) +
115
+ '</select></div>';
116
+ };
117
+
59
118
  // replace X -> number and insert templates
60
119
  for (let i = 6; i > 0; i--) {
61
120
  let extraClass = "HM-Dis-EP-WM55";
62
121
  if (i >= 4) extraClass="";
122
+ let wrcdClass = "";
123
+ if (i <= 5) {
124
+ wrcdClass = " HmIP-WRCD";
125
+ $nodeLineX.insertAdjacentHTML('afterend', wrcdRows(i));
126
+ for (const [field, fallback] of [['wrcdIcon', '0'], ['wrcdAlign', 'CENTER'], ['wrcdColor', 'BLACK'], ['wrcdBackground', 'WHITE']]) {
127
+ const value = this[field + i];
128
+ $('#node-input-' + field + i).val(value === undefined || value === '' ? fallback : String(value));
129
+ }
130
+ }
63
131
 
64
132
  let nodeIconI = $nodeIconX.innerHTML.replaceAll('X',i);
65
133
  $nodeLineX.insertAdjacentHTML('afterend','<div class="form-row SUBMIT HM-Dis-WM55 '+extraClass+'">'+nodeIconI+'</div>');
@@ -70,19 +138,32 @@
70
138
  $('#node-input-color'+i)[0].value=this['color'+i];
71
139
 
72
140
  let nodeLineI = $nodeLineX.innerHTML.replaceAll('X',i);
73
- $nodeLineX.insertAdjacentHTML('afterend','<div class="form-row SUBMIT HM-Dis-WM55 '+extraClass+'">'+nodeLineI+'</div>');
74
- $('#node-input-line'+i)[0].value=this['line'+i];
141
+ $nodeLineX.insertAdjacentHTML('afterend','<div class="form-row SUBMIT HM-Dis-WM55 '+extraClass+wrcdClass+'">'+nodeLineI+'</div>');
142
+ $('#node-input-line'+i)[0].value=this['line'+i] === undefined ? '' : this['line'+i];
75
143
 
76
144
  let nodeDisableI = $nodeDisableI.innerHTML.replaceAll('X',i);
77
- $nodeLineX.insertAdjacentHTML('afterend','<div class="form-row SUBMIT HM-Dis-WM55 '+extraClass+'">'+nodeDisableI+'</div>');
145
+ $nodeLineX.insertAdjacentHTML('afterend','<div class="form-row SUBMIT HM-Dis-WM55 '+extraClass+wrcdClass+'">'+nodeDisableI+'</div>');
78
146
  $('#node-input-disable'+i).on("change",function() {
79
147
  let dis = $('#node-input-disable'+i)[0].checked;
80
148
  $('#node-input-icon'+i).prop('disabled', dis);
149
+ $('#node-input-wrcdIcon'+i+', #node-input-wrcdAlign'+i+', #node-input-wrcdColor'+i+', #node-input-wrcdBackground'+i).prop('disabled', dis);
81
150
  $('#node-input-color'+i).prop('disabled',dis);
82
151
  $('#node-input-line'+i).prop('disabled', dis);
83
152
  });
84
153
 
85
154
  $('#node-input-disable'+i)[0].checked=this['disable'+i];
155
+ $('#node-input-disable'+i).trigger('change');
156
+ }
157
+
158
+ $('#node-input-wrcdSound').append(options(ccuWrcdSounds.map((name, index) => [index, text('wrcd.sound.' + name)])));
159
+ $('#node-input-wrcdSound').val(this.wrcdSound === undefined ? '' : String(this.wrcdSound));
160
+ // a node saved before the HmIP-WRCD was known has none of its settings: show the defaults
161
+ if (this.wrcdRepeat === undefined) {
162
+ $('#node-input-wrcdRepeat').val('0');
163
+ }
164
+
165
+ if (this.wrcdInterval === undefined) {
166
+ $('#node-input-wrcdInterval').val('5');
86
167
  }
87
168
 
88
169
  // remove templates
@@ -257,6 +338,7 @@
257
338
  <select id="node-input-channelType" class="ccu-dropdown">
258
339
  <option value="HM-Dis-WM55">HM-Dis-WM55</option>
259
340
  <option value="HM-Dis-EP-WM55">HM-Dis-EP-WM55</option>
341
+ <option value="HmIP-WRCD">HmIP-WRCD</option>
260
342
  </select>
261
343
  </div>
262
344
 
@@ -364,6 +446,55 @@
364
446
  <option value="0xEF">160 <span data-i18n="ccu-display.seconds"></span></option>
365
447
  </select>
366
448
  </div>
449
+ <div class="form-row SUBMIT HmIP-WRCD">
450
+ <label for="node-input-wrcdSound"><i class="icon-envelope"></i><span data-i18n="ccu-display.sound"></span></label>
451
+ <select id="node-input-wrcdSound" class="ccu-dropdown">
452
+ <option value="" data-i18n="ccu-display.off"></option>
453
+ </select>
454
+ </div>
455
+ <div class="form-row SUBMIT HmIP-WRCD">
456
+ <label for="node-input-wrcdRepeat"><span data-i18n="ccu-display.repeat"></span></label>
457
+ <select id="node-input-wrcdRepeat" class="ccu-dropdown">
458
+ <option value="0" data-i18n="ccu-display.wrcd.noRepeat"></option>
459
+ <option value="1">1</option>
460
+ <option value="2">2</option>
461
+ <option value="3">3</option>
462
+ <option value="4">4</option>
463
+ <option value="5">5</option>
464
+ <option value="6">6</option>
465
+ <option value="7">7</option>
466
+ <option value="8">8</option>
467
+ <option value="9">9</option>
468
+ <option value="10">10</option>
469
+ <option value="11">11</option>
470
+ <option value="12">12</option>
471
+ <option value="13">13</option>
472
+ <option value="14">14</option>
473
+ <option value="15" data-i18n="ccu-display.infinity"></option>
474
+ </select>
475
+ </div>
476
+ <div class="form-row SUBMIT HmIP-WRCD">
477
+ <label for="node-input-wrcdInterval"><i class="icon-bookmark"></i><span data-i18n="ccu-display.wrcd.interval"></span></label>
478
+ <select id="node-input-wrcdInterval" class="ccu-dropdown">
479
+ <option value="5">5 s</option>
480
+ <option value="10">10 s</option>
481
+ <option value="15">15 s</option>
482
+ <option value="20">20 s</option>
483
+ <option value="25">25 s</option>
484
+ <option value="30">30 s</option>
485
+ <option value="35">35 s</option>
486
+ <option value="40">40 s</option>
487
+ <option value="45">45 s</option>
488
+ <option value="50">50 s</option>
489
+ <option value="55">55 s</option>
490
+ <option value="60">60 s</option>
491
+ <option value="65">65 s</option>
492
+ <option value="70">70 s</option>
493
+ <option value="75">75 s</option>
494
+ <option value="80">80 s</option>
495
+ </select>
496
+ </div>
497
+ <div class="form-tips SUBMIT HmIP-WRCD" style="margin-bottom: 12px;" data-i18n="ccu-display.wrcd.tip"></div>
367
498
  <div class="form-row">
368
499
  <label for="node-input-name"><i class="icon-bookmark"></i> Name</label>
369
500
  <input type="text" id="node-input-name">
@@ -2,6 +2,7 @@ const path = require('path');
2
2
 
3
3
  const statusHelper = require(path.join(__dirname, '/lib/status.js'));
4
4
  const {effectiveConfig} = require(path.join(__dirname, '/lib/dynconfig.js'));
5
+ const {wrcdCommand, LINES: WRCD_LINES} = require(path.join(__dirname, '/lib/wrcd.js'));
5
6
 
6
7
  /** Everything a message may override through msg.config (B-2, #80 #185). */
7
8
  const DYNAMIC_KEYS = [
@@ -13,8 +14,44 @@ const DYNAMIC_KEYS = [
13
14
  'pause',
14
15
  'signal',
15
16
  ...[1, 2, 3, 4, 5, 6].flatMap((i) => ['line' + i, 'color' + i, 'icon' + i, 'disable' + i]),
17
+ // HmIP-WRCD (#144)
18
+ 'wrcdSound',
19
+ 'wrcdRepeat',
20
+ 'wrcdInterval',
21
+ ...[1, 2, 3, 4, 5].flatMap((i) => ['wrcdIcon' + i, 'wrcdAlign' + i, 'wrcdColor' + i, 'wrcdBackground' + i]),
16
22
  ];
17
23
 
24
+ /**
25
+ * The HmIP-WRCD's command of one message: the lines that are not left as they are, and the sound.
26
+ * `msg.lineX`, `msg.iconX`, `msg.colorX`, `msg.alignX` and `msg.backgroundX` win over the configuration.
27
+ * @param {object} effective the node's effective configuration
28
+ * @param {object} message
29
+ * @returns {string} the COMBINED_PARAMETER text, empty when there is nothing to send
30
+ */
31
+ function wrcdPayload(effective, message) {
32
+ const pick = (name, key) => (message[name] === undefined ? effective[key] : message[name]);
33
+ const lines = {};
34
+ for (let i = 1; i <= WRCD_LINES; i++) {
35
+ if (message['disable' + i] || effective['disable' + i]) {
36
+ continue;
37
+ }
38
+
39
+ lines[i] = {
40
+ text: pick('line' + i, 'line' + i),
41
+ icon: pick('icon' + i, 'wrcdIcon' + i),
42
+ align: pick('align' + i, 'wrcdAlign' + i),
43
+ color: pick('color' + i, 'wrcdColor' + i),
44
+ background: pick('background' + i, 'wrcdBackground' + i),
45
+ };
46
+ }
47
+
48
+ return wrcdCommand(lines, {
49
+ sound: effective.wrcdSound,
50
+ repeat: effective.wrcdRepeat,
51
+ interval: effective.wrcdInterval,
52
+ });
53
+ }
54
+
18
55
  module.exports = function (RED) {
19
56
  class CcuDisplay {
20
57
  constructor(config) {
@@ -159,6 +196,25 @@ module.exports = function (RED) {
159
196
  // msg.line1 & co. keep working as before; msg.config
160
197
  // additionally reaches the channel and the EP-WM55 settings
161
198
  const {config: effective} = effectiveConfig(config, message, DYNAMIC_KEYS);
199
+
200
+ if (effective.channelType === 'HmIP-WRCD') {
201
+ const command = wrcdPayload(effective, message);
202
+ if (!command) {
203
+ done(new Error('nothing to send: every line is left as it is and no sound is chosen'));
204
+ return;
205
+ }
206
+
207
+ this.ccu
208
+ .setValue(effective.iface, effective.channel, 'COMBINED_PARAMETER', command)
209
+ .then(() => {
210
+ done();
211
+ })
212
+ .catch((error) => {
213
+ done(error);
214
+ });
215
+ return;
216
+ }
217
+
162
218
  let payload = '0x02';
163
219
 
164
220
  let countLines = 6; // HM-Dis-WM55
@@ -5,7 +5,7 @@
5
5
  defaults: {
6
6
  name: {value: ''},
7
7
  ccuConfig: {value: 'localhost', type: 'ccu-connection', required: true},
8
- topic: {value: 'ReGaHSS/${Name}'}
8
+ topic: {value: 'hm/status/program/${Name}'}
9
9
  },
10
10
  inputs: 1,
11
11
  outputs: 1,
@@ -90,6 +90,7 @@
90
90
  rampTimeValueType: {value: 'num'},
91
91
  repetitions: {value: 0},
92
92
  dimmerColor: {value: 0},
93
+ colorBehaviour: {value: 1},
93
94
  dimmerLevel: {value: 100},
94
95
  dimmerList: {value: []},
95
96
  soundLevel: {value: 50},
@@ -389,12 +390,17 @@
389
390
  this.dimmerList.forEach(item => {
390
391
  $('#node-input-dimmer-container').editableList('addItem', item);
391
392
  });
392
- } else if (this.channelType === 'BSL_DIMMER_VIRTUAL_RECEIVER') {
393
+ } else if (this.channelType === 'BSL_DIMMER_VIRTUAL_RECEIVER' || this.channelType === 'OPTICAL_SIGNAL_RECEIVER') {
393
394
  // ...
394
395
  } else {
395
396
  console.error('unknown channelType', this.channelType);
396
397
  }
397
398
 
399
+ // a node saved before the option existed has none: show what it sends, the steady light
400
+ if (this.colorBehaviour === undefined || this.colorBehaviour === null || this.colorBehaviour === '') {
401
+ $('#node-input-colorBehaviour').val('1');
402
+ }
403
+
398
404
  $('.SUBMIT').hide();
399
405
  $('.SUBMIT.' + $nodeInputChannelType.val()).show();
400
406
  },
@@ -495,6 +501,7 @@
495
501
  <option value="ACOUSTIC_SIGNAL_VIRTUAL_RECEIVER">ACOUSTIC_SIGNAL (HmIP-MP3P)</option>
496
502
  <option value="DIMMER_VIRTUAL_RECEIVER">DIMMER (HmIP-MP3P)</option>
497
503
  <option value="BSL_DIMMER_VIRTUAL_RECEIVER">DIMMER (HmIP-BSL)</option>
504
+ <option value="OPTICAL_SIGNAL_RECEIVER">OPTICAL_SIGNAL (HmIPW-WRC6)</option>
498
505
  </select>
499
506
  </div>
500
507
 
@@ -597,7 +604,7 @@
597
604
  <input id="node-input-soundLevelType" type="hidden">
598
605
  </div>
599
606
 
600
- <div class="form-row SUBMIT BSL_DIMMER_VIRTUAL_RECEIVER">
607
+ <div class="form-row SUBMIT BSL_DIMMER_VIRTUAL_RECEIVER OPTICAL_SIGNAL_RECEIVER">
601
608
  <label for="node-input-dimmerColor"><i class=""></i> Farbe </label>
602
609
  <select id="node-input-dimmerColor" class="ccu-dropdown">
603
610
  <option value="0">Aus</option>
@@ -611,13 +618,33 @@
611
618
  </select>
612
619
  </div>
613
620
 
614
- <div class="form-row SUBMIT DIMMER_VIRTUAL_RECEIVER BSL_DIMMER_VIRTUAL_RECEIVER">
621
+ <div class="form-row SUBMIT BSL_DIMMER_VIRTUAL_RECEIVER OPTICAL_SIGNAL_RECEIVER">
622
+ <label for="node-input-colorBehaviour"><i class=""></i> <span data-i18n="ccu-signal.behaviour"></span></label>
623
+ <select id="node-input-colorBehaviour" class="ccu-dropdown">
624
+ <option value="1" data-i18n="ccu-signal.behaviourOn"></option>
625
+ <option value="2" data-i18n="ccu-signal.behaviourBlinkingSlow"></option>
626
+ <option value="3" data-i18n="ccu-signal.behaviourBlinkingMiddle"></option>
627
+ <option value="4" data-i18n="ccu-signal.behaviourBlinkingFast"></option>
628
+ <option value="5" data-i18n="ccu-signal.behaviourFlashSlow"></option>
629
+ <option value="6" data-i18n="ccu-signal.behaviourFlashMiddle"></option>
630
+ <option value="7" data-i18n="ccu-signal.behaviourFlashFast"></option>
631
+ <option value="8" data-i18n="ccu-signal.behaviourBillowSlow"></option>
632
+ <option value="9" data-i18n="ccu-signal.behaviourBillowMiddle"></option>
633
+ <option value="10" data-i18n="ccu-signal.behaviourBillowFast"></option>
634
+ <option value="0" data-i18n="ccu-signal.behaviourOff"></option>
635
+ <option value="11" data-i18n="ccu-signal.behaviourOldValue"></option>
636
+ </select>
637
+ </div>
638
+
639
+ <div class="form-tips SUBMIT BSL_DIMMER_VIRTUAL_RECEIVER" style="margin-bottom: 12px;" data-i18n="ccu-signal.behaviourTip"></div>
640
+
641
+ <div class="form-row SUBMIT DIMMER_VIRTUAL_RECEIVER BSL_DIMMER_VIRTUAL_RECEIVER OPTICAL_SIGNAL_RECEIVER">
615
642
  <label for="node-input-dimmerLevel"><i class=""></i> Helligkeit </label>
616
643
  <input id="node-input-dimmerLevel" type="number" min="0" max="100">
617
644
  <input id="node-input-dimmerLevelType" type="hidden">
618
645
  </div>
619
646
 
620
- <div class="form-row SUBMIT ACOUSTIC_SIGNAL_VIRTUAL_RECEIVER DIMMER_VIRTUAL_RECEIVER BSL_DIMMER_VIRTUAL_RECEIVER">
647
+ <div class="form-row SUBMIT ACOUSTIC_SIGNAL_VIRTUAL_RECEIVER DIMMER_VIRTUAL_RECEIVER BSL_DIMMER_VIRTUAL_RECEIVER OPTICAL_SIGNAL_RECEIVER">
621
648
  <label for="node-input-rampTimeUnit"><i class=""></i> Rampenzeit </label>
622
649
  <select id="node-input-rampTimeUnit" style="width: calc(35% - 5px)">
623
650
  <option value="S">Sekunden</option>
@@ -628,7 +655,7 @@
628
655
  <input id="node-input-rampTimeValueType" type="hidden">
629
656
  </div>
630
657
 
631
- <div class="form-row SUBMIT ALARM_SWITCH_VIRTUAL_RECEIVER ACOUSTIC_SIGNAL_VIRTUAL_RECEIVER DIMMER_VIRTUAL_RECEIVER BSL_DIMMER_VIRTUAL_RECEIVER">
658
+ <div class="form-row SUBMIT ALARM_SWITCH_VIRTUAL_RECEIVER ACOUSTIC_SIGNAL_VIRTUAL_RECEIVER DIMMER_VIRTUAL_RECEIVER BSL_DIMMER_VIRTUAL_RECEIVER OPTICAL_SIGNAL_RECEIVER">
632
659
  <label for="node-input-durationUnit"><i class=""></i> Dauer </label>
633
660
  <select id="node-input-durationUnit" style="width: calc(35% - 5px)">
634
661
  <option value="S">Sekunden</option>