node-red-contrib-ccu 4.2.0 → 4.4.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.
Files changed (49) hide show
  1. package/.prettierignore +3 -0
  2. package/CHANGELOG.md +140 -0
  3. package/HANDOFF.md +46 -10
  4. package/README.md +71 -0
  5. package/ROADMAP.md +130 -47
  6. package/nodes/ccu-alexa.html +3 -1
  7. package/nodes/ccu-connection.html +51 -0
  8. package/nodes/ccu-connection.js +323 -16
  9. package/nodes/ccu-display.js +29 -13
  10. package/nodes/ccu-get-value.html +3 -1
  11. package/nodes/ccu-mqtt.html +21 -4
  12. package/nodes/ccu-mqtt.js +126 -102
  13. package/nodes/ccu-poll.js +6 -0
  14. package/nodes/ccu-rpc-event.html +6 -0
  15. package/nodes/ccu-rpc-event.js +31 -12
  16. package/nodes/ccu-set-value.html +38 -0
  17. package/nodes/ccu-set-value.js +59 -235
  18. package/nodes/ccu-signal.html +55 -1
  19. package/nodes/ccu-signal.js +52 -9
  20. package/nodes/ccu-switch.html +17 -4
  21. package/nodes/ccu-switch.js +28 -4
  22. package/nodes/ccu-sysvar.html +40 -1
  23. package/nodes/ccu-sysvar.js +78 -8
  24. package/nodes/ccu-value.html +27 -1
  25. package/nodes/ccu-value.js +69 -19
  26. package/nodes/lib/cast.js +59 -14
  27. package/nodes/lib/channelfilter.js +136 -0
  28. package/nodes/lib/dynconfig.js +81 -0
  29. package/nodes/lib/localccu.js +81 -0
  30. package/nodes/lib/message.js +6 -2
  31. package/nodes/lib/metaprovider.js +716 -0
  32. package/nodes/lib/valuestatus.js +145 -0
  33. package/nodes/locales/de/ccu-display.html +17 -0
  34. package/nodes/locales/de/ccu-rpc-event.json +1 -0
  35. package/nodes/locales/de/ccu-sysvar.json +3 -2
  36. package/nodes/locales/de/ccu-value.json +2 -1
  37. package/nodes/locales/en-US/ccu-display.html +17 -0
  38. package/nodes/locales/en-US/ccu-rpc-event.json +3 -2
  39. package/nodes/locales/en-US/ccu-switch.html +12 -0
  40. package/nodes/locales/en-US/ccu-sysvar.json +3 -2
  41. package/nodes/locales/en-US/ccu-value.json +2 -1
  42. package/package.json +1 -1
  43. package/patch-certainonly.py +51 -0
  44. package/roadmap-archive/B-17.md +106 -0
  45. package/roadmap-archive/B-2.md +69 -0
  46. package/roadmap-archive/B-3.md +57 -0
  47. package/roadmap-archive/B-4.md +44 -0
  48. package/roadmap-archive/B-5.md +57 -0
  49. package/roadmap-archive/README.md +14 -0
package/.prettierignore CHANGED
@@ -7,3 +7,6 @@ nodes/locales
7
7
  nodes/ccu-switch.js
8
8
  test/simulator-data
9
9
  docs
10
+
11
+ # verbatim copy of openccu-lite's conformance corpus (fixtures/store) - do not reformat
12
+ test/fixtures/openccu-lite
package/CHANGELOG.md CHANGED
@@ -5,6 +5,146 @@ 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.4.0 (2026-09-06)
9
+
10
+ ### Added
11
+
12
+ - **openccu-lite support** (roadmap B-17). [openccu-lite](https://github.com/hobbyquaker/openccu-lite)
13
+ is a Homematic CCU firmware without ReGaHSS: the interface processes
14
+ are unchanged, but nothing listens on 8181/8183, HM-Script is never
15
+ interpreted and there are no ReGa ids. The connection node now asks
16
+ the box `GET /api/meta/v1/version` when it starts and on every
17
+ reconnect of its name sync; a CCU3/RaspberryMatic/OpenCCU answers 404
18
+ and everything runs exactly as before, an openccu-lite answers with
19
+ its API version and device, channel, room and function names come
20
+ from its metadata API instead — a snapshot at start, then the box's
21
+ Server-Sent-Events change stream, so a rename in the box's UI reaches
22
+ running flows within a second without a redeploy. `msg.channelName`,
23
+ `msg.rooms`, `msg.functions` and the room/function filters keep the
24
+ shape they have on a CCU (rooms and functions are a tree there and
25
+ are flattened to the usual arrays of names, most specific first).
26
+ Nothing has to be configured: the same connection node works on both
27
+ kinds of box, which is what makes moving a backup between them
28
+ harmless.
29
+ - connection node: **openccu-lite token** and **openccu-lite port**
30
+ fields. The token is only needed when Node-RED does _not_ run on the
31
+ box — on the box the read-only token in
32
+ `/usr/local/etc/occulite/local-token` is picked up automatically, off
33
+ the box the administrator creates one on the box's _Users_ page. A
34
+ rejected or missing token is not fatal: the nodes work with addresses
35
+ instead of names, the connection logs it once and takes the names as
36
+ soon as a valid token is there. The port field is only for boxes
37
+ whose web server is not on 80/443. Both are ignored on a CCU.
38
+ - connection node: the cached `ccu_rega_<host>.json` now also holds the
39
+ room and function name lists, so the editor's room and function
40
+ pickers are filled right after a restart instead of only after the
41
+ first successful sync.
42
+
43
+ ### Changed
44
+
45
+ - `ccu-sysvar`, `ccu-program`, `ccu-script` and `ccu-poll` stay in the
46
+ palette and in flows on openccu-lite, and stay accepted in the
47
+ editor. There is no ReGa DOM on such a box, so instead of failing the
48
+ connection they log one line when the connection starts and answer
49
+ every message with a clear error (`… are not available on this box
50
+ (openccu-lite has no ReGaHSS)`). On a CCU nothing about them changes.
51
+
52
+ ## 4.3.0 (2026-09-04)
53
+
54
+ ### Added
55
+
56
+ - **Dynamic node configuration through `msg.config`** (roadmap B-2). Put
57
+ an object in `msg.config` and its properties override that node's own
58
+ configuration for that one message; the stored configuration is never
59
+ modified, so the next message starts from the dialog settings again.
60
+ Supported by the value, set-value, switch, sysvar, signal and display
61
+ nodes; each node's help panel lists the keys it accepts, and anything
62
+ else is ignored. `msg.ccu` could not be used for this because it
63
+ already carries the CCU host name. (#172, #71, #103, #80, #56, #148,
64
+ #185)
65
+ - signal node: every command field is reachable that way, including
66
+ `soundList` and `dimmerList`, which now also accept a plain array of
67
+ values (`msg.config.soundList = [1, 2]`) instead of the editor's
68
+ list-of-objects shape. (#148, #80)
69
+ - sysvar node: a typed input selects where the value to write comes from
70
+ (msg/flow/global/env). Computing a value and storing it in a variable
71
+ no longer needs a change node to move it into `msg.payload` first.
72
+ (#56)
73
+ - sysvar and rpc-event nodes show the last value and how long ago it
74
+ arrived under the node — the sysvar node also when "emit value on
75
+ start" is off, since the connection knows the value either way. (#54,
76
+ #52)
77
+ - value and rpc-event nodes: new option **discard uncertain values**,
78
+ which drops values the ReGa could not timestamp (`msg.uncertain`).
79
+ Off by default, so existing flows are unaffected. (#96)
80
+ - ccu-mqtt: new **get** topic (`hm/get/<channel>/<datapoint>` by
81
+ default) republishes the last known value on its status topic, so a
82
+ refresh can be triggered over MQTT. An empty datapoint republishes the
83
+ whole channel. (#115)
84
+ - ccu-mqtt: the **RPC** topics are implemented and visible in the editor.
85
+ The dispatcher recognised the RPC topic before but the node had no
86
+ handler for it, so such messages were silently dropped and the
87
+ response topic was never used — which is why both fields were
88
+ commented out. The result (or the error) is published on the response
89
+ topic. (#22)
90
+ - switch node: rule values accept the **bool** type, as core Node-RED's
91
+ switch node does. Without it `true` had to be entered as a string, and
92
+ `true == "true"` is false in JavaScript, so boolean datapoints could
93
+ only be compared by writing 0/1. (#51)
94
+ - connection node: **RPC ping** can be switched off, which disables the
95
+ periodic ping and the timeout-triggered re-init for that connection.
96
+ Setting the ping timeout to 0 never did this — it fell back to 60
97
+ seconds. (#44)
98
+ - connection node: **names/rooms refresh** interval (default 15 minutes,
99
+ 0 = off). Channel names, rooms and functions used to be read once when
100
+ the connection started, so anything added in the CCU WebUI stayed
101
+ invisible until the flow was redeployed. (#167)
102
+
103
+ ### Fixed
104
+
105
+ - set-value node: only the _first_ message ever configured the node.
106
+ Message properties were written into the node's own configuration, so
107
+ every later message hit the "already configured" guard and was
108
+ ignored, and the node kept acting on the first message's rooms,
109
+ functions or channel. Each message is now evaluated on its own. (#133)
110
+ - set-value node: the device-name filter tested whether the _channel_
111
+ had a ReGa name while comparing the _device_ name, so channels without
112
+ a name of their own were dropped even when their device matched.
113
+ - Enum names never worked: the CCU sends them in `VALUE_LIST`, but the
114
+ code read `ENUM`, which no interface process sends. `msg.datapointEnum`
115
+ and `msg.valueEnum` were always `undefined`, and writing an enum
116
+ datapoint by name (`AUTO-MODE` rather than `0`) fell back to `0`.
117
+ - ccu-mqtt: the "is this parameter writeable" check was
118
+ `!(desc.OPERATIONS) && 2`, which is always false — it never fired, and
119
+ read-only parameters were written anyway.
120
+ - ccu-mqtt: `putParamset` cast every value against the description of a
121
+ parameter that does not exist in that call, so the whole paramset went
122
+ out uncast. Its private copy of the cast logic is gone; the shared one
123
+ gained the MIN/MAX clamping that copy did. Unparseable numbers become
124
+ 0 instead of NaN, which XML-RPC cannot encode.
125
+ - Running on the CCU itself was not detected any more, so local installs
126
+ (RedMatic) silently talked to the interface processes through the
127
+ CCU's lighttpd proxy instead of their direct ports. The check grepped
128
+ `/etc/lighttpd/conf.d/proxy.conf` for a port number; on current
129
+ firmware that file is a one-line include and the port markers live two
130
+ levels down. It now looks for a listener on the direct port instead.
131
+ (Roadmap B-4)
132
+ - Writing several system variables at once left all but the first
133
+ invisible until the next scheduled ReGa poll (30 s by default): the
134
+ immediate re-poll each write triggers was dropped while another poll
135
+ was still running. It is remembered and run once afterwards. (#166)
136
+ - RSSI values from the ReGa poll were converted from the unsigned byte
137
+ unconditionally, so a value that was already negative, or the 0 that
138
+ means "never received", became -318 or -256. (#183)
139
+ - Editor: the Channel and Datapoint fields were cleared whenever their
140
+ content was not a known channel address, which also wiped
141
+ `${PARAMETER}` placeholders every time the dialog was opened — so a
142
+ node inside a subflow lost its subflow parameter. Placeholders are
143
+ left alone now. (#158)
144
+ - The German help texts of the rpc-event node never loaded:
145
+ `locales/de/ccu-rpc-event.json` had a trailing comma and was not valid
146
+ JSON.
147
+
8
148
  ## 4.2.0 (2026-09-04)
9
149
 
10
150
  ### Added
package/HANDOFF.md CHANGED
@@ -14,9 +14,37 @@ Lab addresses and credentials are intentionally **not** in this file
14
14
  (+605 keys from the production CCU and two lab CCUs). Phase 3:
15
15
  cast/topic/message/castSysvar extracted, 43 unit tests
16
16
  (`npm run test:pure`, 71 on the B-16 branch).
17
- - Branch `b-16-homeassistant` (4.2.0) is pushed and **CI green** on all
18
- legs including the mocha integration suite.
19
- - Issue tracker fully triaged; B-6/B-14 archived; roadmap is current.
17
+ - **4.2.0 released 2026-09-04** (tag v4.2.0, npm latest = 4.2.0): the
18
+ ccu-homeassistant node (B-16, archived). Branch `b-16-homeassistant`
19
+ merged with `--no-ff` and deleted. The lab CCUs run the equivalent
20
+ `4.2.0-dev.1` build with the "B-16 Home Assistant" flow tabs; reporters
21
+ of #136/#154/#175 were asked (2026-09-04) to confirm the LEVEL_2 fix
22
+ on their hardware.
23
+ - **4.3.0 released 2026-09-04** (tag v4.3.0, npm latest = 4.3.0):
24
+ B-2 (dynamic configuration via `msg.config`), B-3 (ccu-mqtt fixes plus
25
+ the `get` and `rpc` commands and the VALUE_LIST enum names), B-4
26
+ (local-CCU detection via a /proc/net/tcp listener probe) and B-5
27
+ (ping toggle, value+age status lines, uncertain filter, trailing sysvar
28
+ re-poll, RSSI guard). All four archived. Branch `b-2-b-5` merged with
29
+ `--no-ff`; 145 pure tests, 23 integration specs green on all four CI
30
+ legs.
31
+ - Issue tracker: 36 → **19 open**. The 17 issues 4.3.0 fixes were
32
+ commented and closed after the release (#172 #71 #103 #80 #56 #148
33
+ #133 #115 #22 #167 #44 #54 #52 #96 #166 #183 #51, plus comments on the
34
+ already-closed #185 and #158). B-6/B-7/B-14/B-16 archived; roadmap is
35
+ current.
36
+ - **Not done for 4.3.0: the editor smoke test in a browser.** The inline
37
+ editor scripts are syntax-checked by a new unit test and the runtime
38
+ was verified on a lab CCU, but the dialogs themselves have not been
39
+ clicked through — and 4.3.0 adds fields to ccu-connection (RPC ping,
40
+ names/rooms refresh), ccu-sysvar (Value from), ccu-mqtt (get + the two
41
+ RPC topics) and ccu-value/ccu-rpc-event (discard uncertain values).
42
+ - Lab CCU `ccu-charly` runs 4.3.0-dev.1 (identical to the release) with a
43
+ flow tab **"B-2..B-5 test"**: three inject nodes driving one
44
+ ccu-set-value through different `msg.config` filters, an rpc-event
45
+ debug, and an mqtt rig on the `hm2test/` prefix (mqtt in → ccu-mqtt →
46
+ mqtt out) used to verify the new `get` and `rpc` commands. The relays
47
+ were left switched off.
20
48
 
21
49
  ## Decisions (2026-09-04)
22
50
 
@@ -139,13 +167,21 @@ application/json"`.
139
167
  #112, #117 (retest comments posted).
140
168
  - Hardware confirmation for B-14 from reporters (#136/#154/#175).
141
169
 
142
- ## After 4.1.0 (queue)
170
+ ## After 4.3.0 (queue)
143
171
 
144
- 1. Editor loader consolidation (Phase 3 §6.4 + §8.1 defect 3, shared
172
+ 1. Browser smoke test of the config dialogs changed in 4.3.0 (see above).
173
+ 2. Editor loader consolidation (Phase 3 §6.4 + §8.1 defect 3, shared
145
174
  `resources/` script for the 9 dialogs) — needs a user smoke test on
146
175
  the Node-RED test box afterwards.
147
- 2. Remaining Phase 3: split rpc/rega/queue out of ccu-connection.js,
148
- async/await as touched, i18n/help consolidation (#58).
149
- 3. 4.3.0 headline (moved from 4.2.0, which is B-16): B-2 dynamic config
150
- via msg (7 issues; #133 has the confirmed setValues config-mutation
151
- bug as the sharpest target).
176
+ 3. Remaining Phase 3: split rpc/rega/queue out of ccu-connection.js,
177
+ async/await as touched, i18n/help consolidation (#58). `lib/` grew
178
+ `dynconfig`, `channelfilter`, `valuestatus` and `localccu` in 4.3.0;
179
+ `ccu-connection.js` is still ~3100 lines.
180
+ 4. Remaining Phase 4: B-11 (re-init robustness — the `rpcCheckInit`
181
+ early return for device-less interfaces is still there, deliberately
182
+ left alone in 4.3.0 to keep its scope), B-12 (auth/TLS, #27), B-13
183
+ (party mode, #161/#156), B-15 (new HmIP channel types, #177/#144),
184
+ B-8/B-9/B-10.
185
+ 5. Still open from §8.3: the stale device-table cache (#181 — 4.3.0's
186
+ refresh covers names/rooms/functions only) and the internal system
187
+ variables (#184, needs a `homematic-rega` release).
package/README.md CHANGED
@@ -28,6 +28,48 @@ Some example flows can be found in the [RedMatic Wiki](https://github.com/rdmtc/
28
28
 
29
29
  **Starting with Version 3.x these Nodes need Node-RED >= 1.0 to work correctly**
30
30
 
31
+ ## openccu-lite
32
+
33
+ [openccu-lite](https://github.com/hobbyquaker/openccu-lite) is a Homematic CCU firmware **without ReGaHSS**. The
34
+ interface processes (`rfd`, `hs485d`, `hmipserver`) are the same, so everything these nodes do over BINRPC/XMLRPC works
35
+ unchanged — but there is no logic layer: nothing listens on 8181/8183, HM-Script is never interpreted, and there are no
36
+ ReGa ids. Device, channel, room and function names come from the box's metadata API instead.
37
+
38
+ Nothing has to be configured for this. When the connection node starts (and on every reconnect of its name sync) it
39
+ asks the box `GET /api/meta/v1/version`; a CCU3, RaspberryMatic or OpenCCU answers 404 and the ReGaHSS path runs exactly
40
+ as before, an openccu-lite answers with its API version and the node takes names, rooms and functions from there —
41
+ loaded once as a snapshot and then kept current from the box's event stream, so a rename in the box's UI shows up in
42
+ your flows within a second, without a redeploy. `msg.channelName`, `msg.rooms`, `msg.functions` and the room/function
43
+ filters keep exactly the shape they have on a CCU. The same connection node configuration works on both, which is what
44
+ makes moving a backup between the two harmless.
45
+
46
+ **Credential.** Every metadata endpoint except the version probe needs a token:
47
+
48
+ - Node-RED **on the box** (RedMatic): nothing to do — the box's own read-only token is read from
49
+ `/usr/local/etc/occulite/local-token`.
50
+ - Node-RED **elsewhere** (a PC, a container): create a token on the box's _Users_ page and paste it into the
51
+ **openccu-lite token** field of the connection node. The **openccu-lite port** field next to it is only needed when
52
+ the box's web server is not on port 80 (443 with TLS).
53
+
54
+ Without a token the nodes still work, with addresses instead of names: the connection logs the rejected credential once
55
+ and picks the names up on the next retry, as soon as a valid token is there.
56
+
57
+ **What has no replacement on openccu-lite** (from openccu-lite's own porting guide):
58
+
59
+ - **System variables** and **programs**: there is no ReGa DOM. The `ccu-sysvar`, `ccu-program` and `ccu-poll` nodes stay
60
+ in the palette and in your flows — they are accepted, they never break the connection, and every message they get is
61
+ answered with a clear error instead.
62
+ - **`exec()` of HM-Script** — `dom.GetObject`, `system.GetSessionVarStr` and everything else the `ccu-script` node
63
+ sends: gone, same handling as above.
64
+ - **ReGa ids** (`dom.GetObject(1234)`): there are none. The metadata API identifies objects by
65
+ `<interface>.<address>`; these nodes have always keyed on the address, so nothing changes for flows.
66
+ - **Service messages / alarms** (system variables 40 and 41): interface-level state only.
67
+ - **The CCU WebUI's JSON-RPC API** (`/api/homematic.cgi`, `Session.login`, `Device.listAll`): not present.
68
+
69
+ Rooms and functions are a **tree** on openccu-lite (`room/eg/wohnzimmer`), not a flat list. They are flattened to the
70
+ arrays these nodes have always published, most specific first: a channel in _Wohnzimmer_ below _Erdgeschoss_ gets
71
+ `msg.rooms = ["Wohnzimmer", "Erdgeschoss"]` and `msg.room = "Wohnzimmer"`, so a room filter on either name matches.
72
+
31
73
  ## Home Assistant
32
74
 
33
75
  The `ccu-homeassistant` node publishes
@@ -41,6 +83,35 @@ device with switch, light, cover, climate, binary_sensor, event, lock and sensor
41
83
  optionally be included as a disabled-by-default entity. Unticking a device removes it from Home Assistant on the
42
84
  next deploy.
43
85
 
86
+ ## Dynamic configuration
87
+
88
+ Most nodes can be reconfigured per message: put an object in `msg.config` and its
89
+ properties override that node's own configuration **for that one message**. The stored
90
+ configuration is never modified, so the next message starts from the dialog settings
91
+ again — sending a different room, channel or brightness each time works as you would
92
+ expect.
93
+
94
+ ```javascript
95
+ // one signal node, a different colour and duration per message
96
+ msg.config = {dimmerColor: 4, durationValue: 10};
97
+
98
+ // one set-value node, a different room per message
99
+ msg.config = {rooms: 'Kitchen'};
100
+ return msg;
101
+ ```
102
+
103
+ Which keys a node accepts is listed in its help panel in the editor. Anything not on
104
+ that list is ignored, so an unrelated property in `msg.config` cannot reach node
105
+ internals. `msg.ccu` is not used for this because it already carries the CCU host name.
106
+
107
+ The `value`, `get value` and `set value` nodes additionally read plain top-level
108
+ properties (`msg.channel`, `msg.datapoint`, `msg.rooms`, …) to fill in fields left empty
109
+ in the dialog. That is the older mechanism and is unchanged; `msg.config` wins over it.
110
+
111
+ Inside a **subflow**, Node-RED substitutes `${PARAMETER}` placeholders in a node's text
112
+ fields before the node is created, so a subflow parameter can be typed straight into the
113
+ Channel or Datapoint field and each instance reads its own device.
114
+
44
115
  ## Configuration Examples
45
116
 
46
117
  The communication with the Homematic CCU needs independent connections in two directions. Node-red-contrib-ccu connects to the CCU's interface listeners (e.g. 2001/TCP for BidCos-RF) while the CCU connects to node-red-contrib-ccu's BINRPC/XMLRPC listeners (2048/tcp and 2049/tcp in examples below).