node-red-contrib-ccu 4.11.0 → 4.12.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,39 @@ 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.12.0 (2026-11-21)
9
+
10
+ ### Added
11
+
12
+ - **Setting "Include internal system variables"** in the connection node.
13
+ The CCU keeps system variables of its own that its WebUI hides - the ones
14
+ it creates for devices, such as `svHmIPRainCounterToday_…` of an HmIP
15
+ weather station, and the watchdog variables. They were never listed: the
16
+ script that reads the variables (homematic-rega) skipped every internal
17
+ variable. homematic-rega 2.1.0 lists them and marks them; with the new
18
+ setting on they appear in the sysvar node's list and its messages like any
19
+ other variable. Off by default, as a CCU with many HmIP devices has several
20
+ per device. The alarm and service messages (`Alarmmeldungen`,
21
+ `Servicemeldungen`) are listed either way, as before, and now carry their
22
+ real timestamp. (#184, @drMaxxi)
23
+
24
+ ## 4.11.1 (2026-11-21)
25
+
26
+ ### Fixed
27
+
28
+ - **openccu-lite: the interfaces stayed disconnected after the system was
29
+ unreachable for more than about 40 seconds, until Node-RED was restarted
30
+ or the flow deployed again.** During a firmware update, a longer reboot or
31
+ a network outage the connection took three unanswered probes as "this
32
+ system is no longer openccu-lite" and closed lite-rpc; when the system
33
+ answered again, the names came back but the interfaces did not. A system
34
+ that does not answer is now waited for: lite-rpc and the names keep
35
+ reconnecting and pick up where they were once the system is back (the log
36
+ says `the system does not answer … - waiting for it` once). lite-rpc is
37
+ closed only when the system answers as something other than openccu-lite,
38
+ and if it is detected as openccu-lite again later, lite-rpc starts again
39
+ with the same interfaces, without a deploy. (#190, @reini12345)
40
+
8
41
  ## 4.11.0 (2026-11-20)
9
42
 
10
43
  ### Changed
package/README.md CHANGED
@@ -24,13 +24,9 @@ for installation on a Homematic CCU3 or RaspberryMatic.
24
24
 
25
25
  Some example flows can be found in the [RedMatic Wiki](https://github.com/rdmtc/RedMatic/wiki) (German language).
26
26
 
27
- **A modern Browser is required, Internet Explorer won't work.**
28
-
29
- **Starting with Version 3.x these Nodes need Node-RED >= 1.0 to work correctly**
30
-
31
27
  ## openccu-lite
32
28
 
33
- [openccu-lite](https://github.com/hobbyquaker/openccu-lite) is a Homematic CCU firmware based on OpenCCU **without
29
+ [openccu-lite](https://github.com/openccu-lite/openccu-lite) is a Homematic CCU firmware based on OpenCCU **without
34
30
  ReGaHSS**. The interface processes (`rfd`, `hs485d`, `hmipserver`) are the same, so everything these nodes do over
35
31
  BINRPC/XMLRPC works unchanged. Device, channel, room and function names come from the system's metadata API instead of
36
32
  ReGaHSS; the connection node detects this at start (`GET /api/meta/v1/version`), nothing has to be configured, and
@@ -21,6 +21,7 @@
21
21
  host: {value: '', required: true},
22
22
 
23
23
  regaEnabled: {value: true},
24
+ regaInternal: {value: false},
24
25
  bcrfEnabled: {value: true},
25
26
  iprfEnabled: {value: true},
26
27
  virtEnabled: {value: true},
@@ -424,6 +425,13 @@
424
425
  <label for="node-config-input-regaInterval"><i class="icon-tag"></i> Rega poll interval (s)</label>
425
426
  <input type="text" id="node-config-input-regaInterval">
426
427
  </div>
428
+ <div class="form-row">
429
+ <label for="node-config-input-regaInternal"><i class="icon-tag"></i> Internal variables</label>
430
+ <div style="width: 70%; display: inline-block; vertical-align: text-top;">
431
+ <label class="ccu-checkbox"><input type="checkbox" id="node-config-input-regaInternal"> Include internal system variables</label><br>
432
+ <small>The ones the CCU creates for itself and for devices (e.g. the rain counters of a weather station). Off by default: on a CCU with many HmIP devices they are several per device.</small>
433
+ </div>
434
+ </div>
427
435
  <div class="form-row">
428
436
  <label for="node-config-input-regaMetaInterval"><i class="icon-tag"></i> Names/rooms refresh (min)</label>
429
437
  <input type="text" id="node-config-input-regaMetaInterval">
@@ -753,6 +753,8 @@ module.exports = function (RED) {
753
753
  this.liteConfig = config;
754
754
  this.lite = null;
755
755
  this.liteIfaces = [];
756
+ // B-48: the interfaces lite-rpc carried when onGone closed it, for resumeLite()
757
+ this.liteResume = null;
756
758
  // B-44: the scopes the system lists for the lite-rpc credential (undefined: not known)
757
759
  // and, per interface, why it cannot be reached (the nodes show it)
758
760
  this.liteScopes = undefined;
@@ -764,6 +766,8 @@ module.exports = function (RED) {
764
766
  this.regaMetaInterval =
765
767
  config.regaMetaInterval === undefined ? 15 : Number.parseInt(config.regaMetaInterval, 10) || 0;
766
768
  this.regaInterval = Number.parseInt(config.regaInterval, 10);
769
+ // #184: the internal system variables (homematic-rega >= 2.1.0 lists them, marked), off by default
770
+ this.regaInternal = Boolean(config.regaInternal);
767
771
  // the values cache file is written at stop, and while running at most every this many
768
772
  // minutes (after the start's read of all values, a resync, a prune); 0 = only at stop.
769
773
  // A write is the whole file - megabytes on a big system, on the SD card.
@@ -1886,7 +1890,24 @@ module.exports = function (RED) {
1886
1890
  );
1887
1891
  }
1888
1892
 
1889
- return this.checkLiteScopes().then(() => this.startMetaProvider());
1893
+ return this.checkLiteScopes()
1894
+ .then(() => this.startMetaProvider())
1895
+ .then(() => this.resumeLite());
1896
+ }
1897
+
1898
+ /**
1899
+ * B-48: openccu-lite detected again after onGone closed lite-rpc - the interfaces it
1900
+ * carried go through it again, without a deploy. A no-op at the first detection.
1901
+ */
1902
+ resumeLite() {
1903
+ const ifaces = this.liteResume;
1904
+ this.liteResume = null;
1905
+ if (!ifaces || ifaces.length === 0 || this.closing || this.lite) {
1906
+ return;
1907
+ }
1908
+
1909
+ this.logger.info('openccu-lite detected again: lite-rpc starts again for ' + ifaces.join(', '));
1910
+ this.startLite(ifaces);
1890
1911
  }
1891
1912
 
1892
1913
  /**
@@ -1956,11 +1977,15 @@ module.exports = function (RED) {
1956
1977
  this.meta = null;
1957
1978
  this.lastMetaProbe = 0;
1958
1979
  if (this.lite) {
1959
- // task 14: lite-rpc went with the system's answer; the CCU way needs a deploy
1980
+ // task 14: lite-rpc went with the system's answer; the CCU way needs a deploy.
1981
+ // B-48: the provider calls this only for a system that answers as something
1982
+ // else (never for one that does not answer); should it be openccu-lite again
1983
+ // at the next detection, lite-rpc starts again with the same interfaces
1984
+ this.liteResume = this.liteIfaces.slice();
1960
1985
  this.stopLite();
1961
1986
  this.liteIfaces.forEach((iface) => this.setIfaceStatus(iface, false));
1962
1987
  this.logger.warn(
1963
- 'lite-rpc closed: the system no longer answers as openccu-lite - deploy again to reach the interfaces the CCU way',
1988
+ 'lite-rpc closed: the system no longer answers as openccu-lite - deploy again to reach the interfaces the CCU way (lite-rpc starts again by itself if the system answers as openccu-lite again)',
1964
1989
  );
1965
1990
  }
1966
1991
 
@@ -2564,6 +2589,17 @@ module.exports = function (RED) {
2564
2589
  }
2565
2590
  }
2566
2591
 
2592
+ /**
2593
+ * #184: a variable the CCU keeps for itself (`internal`, homematic-rega >= 2.1.0) only with
2594
+ * the connection node's "Include internal system variables"; the alarm and service
2595
+ * messages (40, 41) always, as before.
2596
+ * @param {{id: number, internal?: boolean}} sysvar
2597
+ * @returns {boolean}
2598
+ */
2599
+ regaVariableWanted(sysvar) {
2600
+ return this.regaInternal || !sysvar.internal || sysvar.id === 40 || sysvar.id === 41;
2601
+ }
2602
+
2567
2603
  getRegaVariables() {
2568
2604
  return new Promise((resolve, reject) => {
2569
2605
  this.logger.debug('getRegaVariables');
@@ -2573,7 +2609,7 @@ module.exports = function (RED) {
2573
2609
  this.hadTimeout.add('ReGaHSS');
2574
2610
  this.setIfaceStatus('ReGaHSS', false);
2575
2611
  } else {
2576
- res.forEach((sysvar) => {
2612
+ res.filter((sysvar) => this.regaVariableWanted(sysvar)).forEach((sysvar) => {
2577
2613
  //this.logger.trace(JSON.stringify(sysvar));
2578
2614
  // sysvar.ts is epoch ms since homematic-rega 2.x (0 = never)
2579
2615
  sysvar.ts = sysvar.ts || Date.now();
@@ -487,13 +487,13 @@ class MetaProvider {
487
487
  this.logger = options.logger || SILENT;
488
488
  this.onNames = options.onNames || NOOP;
489
489
  this.onStatus = options.onStatus || NOOP;
490
- // called when the box stopped answering the version probe altogether -
491
- // it is not an openccu-lite any more (restored backup, firmware swap)
490
+ // called when the box answers the version probe, but no longer as openccu-lite (a restored
491
+ // backup, a firmware swap) - B-48: a box that does not answer at all is waited for
492
492
  this.onGone = options.onGone || NOOP;
493
- this.goneAfter = options.goneAfter === undefined ? 3 : options.goneAfter;
493
+ this.goneAfter = options.goneAfter === undefined ? MetaProvider.defaults.goneAfter : options.goneAfter;
494
494
  this.requestTimeout = options.requestTimeout || 10000;
495
- this.retryMin = options.retryMin === undefined ? 5000 : options.retryMin;
496
- this.retryMax = options.retryMax === undefined ? 60000 : options.retryMax;
495
+ this.retryMin = options.retryMin === undefined ? MetaProvider.defaults.retryMin : options.retryMin;
496
+ this.retryMax = options.retryMax === undefined ? MetaProvider.defaults.retryMax : options.retryMax;
497
497
  this.emitDelay = options.emitDelay === undefined ? 100 : options.emitDelay;
498
498
  this.attachTimeout = options.attachTimeout === undefined ? 15000 : options.attachTimeout;
499
499
  this.createClient = options.createClient;
@@ -506,6 +506,7 @@ class MetaProvider {
506
506
  this.streamRefused = false;
507
507
  this.refusedLogged = false;
508
508
  this.missedProbes = 0;
509
+ this.unanswered = false;
509
510
  this.probeRetry = 0;
510
511
  this.probeTimeout = null;
511
512
  this.emitTimeout = null;
@@ -685,6 +686,7 @@ class MetaProvider {
685
686
  _status(state) {
686
687
  if (state === 'ready') {
687
688
  this.missedProbes = 0;
689
+ this.unanswered = false;
688
690
  this.probeRetry = 0;
689
691
  clearTimeout(this.probeTimeout);
690
692
  this.probeTimeout = null;
@@ -726,10 +728,14 @@ class MetaProvider {
726
728
  * The version probe while the copy is not connected: needs no credential, and it is how a box
727
729
  * that is no longer an openccu-lite is noticed without a Node-RED restart. A client of its own
728
730
  * whose first connect failed is opened again once the system answers.
731
+ *
732
+ * B-48: only an answer counts towards `goneAfter` - a CCU's 404 or HTML. A box that does not
733
+ * answer (a timeout, a refused connection, 502/503/504 while it starts: an update, a reboot)
734
+ * has not become something else; the copy and lite-rpc keep reconnecting until it is back.
729
735
  * @returns {Promise<void>}
730
736
  */
731
737
  async _probe() {
732
- const info = await detect({
738
+ const outcome = await detectOutcome({
733
739
  host: this.host,
734
740
  port: this.port,
735
741
  tls: this.tls,
@@ -741,11 +747,19 @@ class MetaProvider {
741
747
  return;
742
748
  }
743
749
 
744
- if (!info) {
750
+ const {info} = outcome;
751
+ if (!info && outcome.inconclusive) {
752
+ this.logger[this.unanswered ? 'debug' : 'info'](
753
+ 'the system does not answer (' + outcome.reason + ') - waiting for it, the connection is kept',
754
+ );
755
+ this.unanswered = true;
756
+ } else if (!info) {
745
757
  this.missedProbes += 1;
746
758
  if (this.missedProbes >= this.goneAfter) {
747
759
  this.logger.warn(
748
- 'the box stopped answering the openccu-lite metadata api (' +
760
+ 'the system answers, but not as openccu-lite (' +
761
+ outcome.reason +
762
+ ', ' +
749
763
  this.missedProbes +
750
764
  ' probes) - falling back to detection from scratch',
751
765
  );
@@ -755,6 +769,7 @@ class MetaProvider {
755
769
  }
756
770
  } else {
757
771
  this.missedProbes = 0;
772
+ this.unanswered = false;
758
773
  if (this.owned && (this.connectFailed || this.streamRefused)) {
759
774
  this.logger.debug('meta api: the system answers - connecting the names client again');
760
775
  this._own();
@@ -786,6 +801,9 @@ class MetaProvider {
786
801
  }
787
802
  }
788
803
 
804
+ /** the probe's schedule and how many answers that are not openccu-lite end the copy (tests shorten them) */
805
+ MetaProvider.defaults = {retryMin: 5000, retryMax: 60000, goneAfter: 3};
806
+
789
807
  module.exports = {
790
808
  API_PATH,
791
809
  LOCAL_TOKEN_FILE,
@@ -48,6 +48,9 @@
48
48
  <li><b>ReGaHSS Poll-Interval</b>:
49
49
  Das Zeitintervall in Sekunden in dem Systemvariablen von der CCU abgefragt werden.</li>
50
50
  </ul>
51
+ <ul>
52
+ <li><b>Internal variables</b>: Die CCU führt eigene, in ihrer WebUI versteckte interne Systemvariablen - die, die sie für Geräte anlegt (zum Beispiel <code>svHmIPRainCounterToday_…</code> einer Wetterstation), und die Watchdog-Variablen. Mit <i>Include internal system variables</i> erscheinen sie in der Liste des Sysvar-Nodes und in seinen Nachrichten; aus in der Voreinstellung, weil eine CCU mit vielen HmIP-Geräten mehrere pro Gerät hat. Alarm- und Servicemeldungen (<i>Alarmmeldungen</i>, <i>Servicemeldungen</i>) sind immer dabei.</li>
53
+ </ul>
51
54
  <ul>
52
55
  <li><b>Names/rooms refresh (min)</b>: Wie oft Kanalnamen, Räume und Gewerke neu gelesen werden; 0 nie. Die Datei mit den Namen wird nur geschrieben, wenn sich etwas geändert hat.</li>
53
56
  </ul>
@@ -23,6 +23,7 @@
23
23
  </li>
24
24
  <li><b>RPC ping</b> and <b>RPC ping timeout (s)</b>: How often the connection to the interface processes is checked with a ping, and after how many seconds without an answer it subscribes again. Off means no pings and no timeout-triggered re-init for this connection.</li>
25
25
  <li><b>Rega poll</b>: Changes of system variables are not pushed by the CCU. With polling on, the variables and their values are read every <i>Rega poll interval</i> seconds.</li>
26
+ <li><b>Internal variables</b>: The CCU keeps internal system variables of its own, hidden in its WebUI - the ones it creates for devices (for example <code>svHmIPRainCounterToday_…</code> of a weather station) and the watchdog variables. With <i>Include internal system variables</i> they appear in the sysvar node's list and its messages; off by default, as a CCU with many HmIP devices has several per device. The alarm and service messages (<i>Alarmmeldungen</i>, <i>Servicemeldungen</i>) are always there.</li>
26
27
  <li><b>Names/rooms refresh (min)</b>: How often channel names, rooms and functions are re-read; 0 never. The names file is only written when something changed.</li>
27
28
  <li><b>Value cache write (min)</b>: The last value of every datapoint is kept in a file in Node-RED's directory, so nodes with <i>cache</i> have a value right after the next start. The file is written when Node-RED stops or the connection is redeployed, and while it runs at most this often (after reading all values at the start, after a resync); 60 by default. 0 writes it only when stopping - the fewest writes to the SD card, but after a power cut or a crash the file holds the values of the last stop. Either way the live values come from the CCU again after a start. On a big system the file has several megabytes, and each write is the whole file.</li>
28
29
  <li><b>Queue timeout (ms)</b>, <b>Queue pause (ms)</b>: The write queue's timeout per write and the pause between two writes.</li>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-ccu",
3
- "version": "4.11.0",
3
+ "version": "4.12.0",
4
4
  "license": "MIT",
5
5
  "main": "none",
6
6
  "keywords": [
@@ -51,7 +51,7 @@
51
51
  ],
52
52
  "dependencies": {
53
53
  "binrpc": "^4.3.0",
54
- "homematic-rega": "^2.0.1",
54
+ "homematic-rega": "^2.1.0",
55
55
  "homematic-xmlrpc": "^2.0.0",
56
56
  "mqtt-wildcard": "^3.0.9",
57
57
  "occulite-client": "^0.4.0"