node-red-contrib-ccu 4.11.0 → 4.11.1

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,23 @@ 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.11.1 (2026-11-21)
9
+
10
+ ### Fixed
11
+
12
+ - **openccu-lite: the interfaces stayed disconnected after the system was
13
+ unreachable for more than about 40 seconds, until Node-RED was restarted
14
+ or the flow deployed again.** During a firmware update, a longer reboot or
15
+ a network outage the connection took three unanswered probes as "this
16
+ system is no longer openccu-lite" and closed lite-rpc; when the system
17
+ answered again, the names came back but the interfaces did not. A system
18
+ that does not answer is now waited for: lite-rpc and the names keep
19
+ reconnecting and pick up where they were once the system is back (the log
20
+ says `the system does not answer … - waiting for it` once). lite-rpc is
21
+ closed only when the system answers as something other than openccu-lite,
22
+ and if it is detected as openccu-lite again later, lite-rpc starts again
23
+ with the same interfaces, without a deploy. (#190, @reini12345)
24
+
8
25
  ## 4.11.0 (2026-11-20)
9
26
 
10
27
  ### 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
@@ -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;
@@ -1886,7 +1888,24 @@ module.exports = function (RED) {
1886
1888
  );
1887
1889
  }
1888
1890
 
1889
- return this.checkLiteScopes().then(() => this.startMetaProvider());
1891
+ return this.checkLiteScopes()
1892
+ .then(() => this.startMetaProvider())
1893
+ .then(() => this.resumeLite());
1894
+ }
1895
+
1896
+ /**
1897
+ * B-48: openccu-lite detected again after onGone closed lite-rpc - the interfaces it
1898
+ * carried go through it again, without a deploy. A no-op at the first detection.
1899
+ */
1900
+ resumeLite() {
1901
+ const ifaces = this.liteResume;
1902
+ this.liteResume = null;
1903
+ if (!ifaces || ifaces.length === 0 || this.closing || this.lite) {
1904
+ return;
1905
+ }
1906
+
1907
+ this.logger.info('openccu-lite detected again: lite-rpc starts again for ' + ifaces.join(', '));
1908
+ this.startLite(ifaces);
1890
1909
  }
1891
1910
 
1892
1911
  /**
@@ -1956,11 +1975,15 @@ module.exports = function (RED) {
1956
1975
  this.meta = null;
1957
1976
  this.lastMetaProbe = 0;
1958
1977
  if (this.lite) {
1959
- // task 14: lite-rpc went with the system's answer; the CCU way needs a deploy
1978
+ // task 14: lite-rpc went with the system's answer; the CCU way needs a deploy.
1979
+ // B-48: the provider calls this only for a system that answers as something
1980
+ // else (never for one that does not answer); should it be openccu-lite again
1981
+ // at the next detection, lite-rpc starts again with the same interfaces
1982
+ this.liteResume = this.liteIfaces.slice();
1960
1983
  this.stopLite();
1961
1984
  this.liteIfaces.forEach((iface) => this.setIfaceStatus(iface, false));
1962
1985
  this.logger.warn(
1963
- 'lite-rpc closed: the system no longer answers as openccu-lite - deploy again to reach the interfaces the CCU way',
1986
+ '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
1987
  );
1965
1988
  }
1966
1989
 
@@ -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,
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.11.1",
4
4
  "license": "MIT",
5
5
  "main": "none",
6
6
  "keywords": [