node-red-contrib-ccu 4.1.0 → 4.3.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 (51) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/HANDOFF.md +67 -16
  3. package/README.md +42 -0
  4. package/ROADMAP.md +129 -47
  5. package/examples/home-assistant.json +127 -0
  6. package/nodes/ccu-alexa.html +3 -1
  7. package/nodes/ccu-connection.html +26 -0
  8. package/nodes/ccu-connection.js +124 -13
  9. package/nodes/ccu-display.js +29 -13
  10. package/nodes/ccu-get-value.html +3 -1
  11. package/nodes/ccu-homeassistant.html +334 -0
  12. package/nodes/ccu-homeassistant.js +272 -0
  13. package/nodes/ccu-mqtt.html +21 -4
  14. package/nodes/ccu-mqtt.js +188 -105
  15. package/nodes/ccu-rpc-event.html +6 -0
  16. package/nodes/ccu-rpc-event.js +31 -12
  17. package/nodes/ccu-set-value.html +38 -0
  18. package/nodes/ccu-set-value.js +59 -235
  19. package/nodes/ccu-signal.html +55 -1
  20. package/nodes/ccu-signal.js +52 -9
  21. package/nodes/ccu-switch.html +17 -4
  22. package/nodes/ccu-switch.js +28 -4
  23. package/nodes/ccu-sysvar.html +40 -1
  24. package/nodes/ccu-sysvar.js +78 -8
  25. package/nodes/ccu-value.html +27 -1
  26. package/nodes/ccu-value.js +69 -19
  27. package/nodes/lib/cast.js +59 -14
  28. package/nodes/lib/channelfilter.js +136 -0
  29. package/nodes/lib/dynconfig.js +81 -0
  30. package/nodes/lib/hadiscovery.js +846 -0
  31. package/nodes/lib/haroles.js +193 -0
  32. package/nodes/lib/localccu.js +81 -0
  33. package/nodes/lib/message.js +6 -2
  34. package/nodes/lib/valuestatus.js +145 -0
  35. package/nodes/locales/de/ccu-display.html +17 -0
  36. package/nodes/locales/de/ccu-rpc-event.json +1 -0
  37. package/nodes/locales/de/ccu-sysvar.json +3 -2
  38. package/nodes/locales/de/ccu-value.json +2 -1
  39. package/nodes/locales/en-US/ccu-display.html +17 -0
  40. package/nodes/locales/en-US/ccu-rpc-event.json +3 -2
  41. package/nodes/locales/en-US/ccu-switch.html +12 -0
  42. package/nodes/locales/en-US/ccu-sysvar.json +3 -2
  43. package/nodes/locales/en-US/ccu-value.json +2 -1
  44. package/package.json +2 -1
  45. package/patch-certainonly.py +51 -0
  46. package/roadmap-archive/B-16.md +31 -0
  47. package/roadmap-archive/B-2.md +69 -0
  48. package/roadmap-archive/B-3.md +57 -0
  49. package/roadmap-archive/B-4.md +44 -0
  50. package/roadmap-archive/B-5.md +57 -0
  51. package/roadmap-archive/README.md +11 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,131 @@ 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.3.0 (2026-09-04)
9
+
10
+ ### Added
11
+
12
+ - **Dynamic node configuration through `msg.config`** (roadmap B-2). Put
13
+ an object in `msg.config` and its properties override that node's own
14
+ configuration for that one message; the stored configuration is never
15
+ modified, so the next message starts from the dialog settings again.
16
+ Supported by the value, set-value, switch, sysvar, signal and display
17
+ nodes; each node's help panel lists the keys it accepts, and anything
18
+ else is ignored. `msg.ccu` could not be used for this because it
19
+ already carries the CCU host name. (#172, #71, #103, #80, #56, #148,
20
+ #185)
21
+ - signal node: every command field is reachable that way, including
22
+ `soundList` and `dimmerList`, which now also accept a plain array of
23
+ values (`msg.config.soundList = [1, 2]`) instead of the editor's
24
+ list-of-objects shape. (#148, #80)
25
+ - sysvar node: a typed input selects where the value to write comes from
26
+ (msg/flow/global/env). Computing a value and storing it in a variable
27
+ no longer needs a change node to move it into `msg.payload` first.
28
+ (#56)
29
+ - sysvar and rpc-event nodes show the last value and how long ago it
30
+ arrived under the node — the sysvar node also when "emit value on
31
+ start" is off, since the connection knows the value either way. (#54,
32
+ #52)
33
+ - value and rpc-event nodes: new option **discard uncertain values**,
34
+ which drops values the ReGa could not timestamp (`msg.uncertain`).
35
+ Off by default, so existing flows are unaffected. (#96)
36
+ - ccu-mqtt: new **get** topic (`hm/get/<channel>/<datapoint>` by
37
+ default) republishes the last known value on its status topic, so a
38
+ refresh can be triggered over MQTT. An empty datapoint republishes the
39
+ whole channel. (#115)
40
+ - ccu-mqtt: the **RPC** topics are implemented and visible in the editor.
41
+ The dispatcher recognised the RPC topic before but the node had no
42
+ handler for it, so such messages were silently dropped and the
43
+ response topic was never used — which is why both fields were
44
+ commented out. The result (or the error) is published on the response
45
+ topic. (#22)
46
+ - switch node: rule values accept the **bool** type, as core Node-RED's
47
+ switch node does. Without it `true` had to be entered as a string, and
48
+ `true == "true"` is false in JavaScript, so boolean datapoints could
49
+ only be compared by writing 0/1. (#51)
50
+ - connection node: **RPC ping** can be switched off, which disables the
51
+ periodic ping and the timeout-triggered re-init for that connection.
52
+ Setting the ping timeout to 0 never did this — it fell back to 60
53
+ seconds. (#44)
54
+ - connection node: **names/rooms refresh** interval (default 15 minutes,
55
+ 0 = off). Channel names, rooms and functions used to be read once when
56
+ the connection started, so anything added in the CCU WebUI stayed
57
+ invisible until the flow was redeployed. (#167)
58
+
59
+ ### Fixed
60
+
61
+ - set-value node: only the _first_ message ever configured the node.
62
+ Message properties were written into the node's own configuration, so
63
+ every later message hit the "already configured" guard and was
64
+ ignored, and the node kept acting on the first message's rooms,
65
+ functions or channel. Each message is now evaluated on its own. (#133)
66
+ - set-value node: the device-name filter tested whether the _channel_
67
+ had a ReGa name while comparing the _device_ name, so channels without
68
+ a name of their own were dropped even when their device matched.
69
+ - Enum names never worked: the CCU sends them in `VALUE_LIST`, but the
70
+ code read `ENUM`, which no interface process sends. `msg.datapointEnum`
71
+ and `msg.valueEnum` were always `undefined`, and writing an enum
72
+ datapoint by name (`AUTO-MODE` rather than `0`) fell back to `0`.
73
+ - ccu-mqtt: the "is this parameter writeable" check was
74
+ `!(desc.OPERATIONS) && 2`, which is always false — it never fired, and
75
+ read-only parameters were written anyway.
76
+ - ccu-mqtt: `putParamset` cast every value against the description of a
77
+ parameter that does not exist in that call, so the whole paramset went
78
+ out uncast. Its private copy of the cast logic is gone; the shared one
79
+ gained the MIN/MAX clamping that copy did. Unparseable numbers become
80
+ 0 instead of NaN, which XML-RPC cannot encode.
81
+ - Running on the CCU itself was not detected any more, so local installs
82
+ (RedMatic) silently talked to the interface processes through the
83
+ CCU's lighttpd proxy instead of their direct ports. The check grepped
84
+ `/etc/lighttpd/conf.d/proxy.conf` for a port number; on current
85
+ firmware that file is a one-line include and the port markers live two
86
+ levels down. It now looks for a listener on the direct port instead.
87
+ (Roadmap B-4)
88
+ - Writing several system variables at once left all but the first
89
+ invisible until the next scheduled ReGa poll (30 s by default): the
90
+ immediate re-poll each write triggers was dropped while another poll
91
+ was still running. It is remembered and run once afterwards. (#166)
92
+ - RSSI values from the ReGa poll were converted from the unsigned byte
93
+ unconditionally, so a value that was already negative, or the 0 that
94
+ means "never received", became -318 or -256. (#183)
95
+ - Editor: the Channel and Datapoint fields were cleared whenever their
96
+ content was not a known channel address, which also wiped
97
+ `${PARAMETER}` placeholders every time the dialog was opened — so a
98
+ node inside a subflow lost its subflow parameter. Placeholders are
99
+ left alone now. (#158)
100
+ - The German help texts of the rpc-event node never loaded:
101
+ `locales/de/ccu-rpc-event.json` had a trailing comma and was not valid
102
+ JSON.
103
+
104
+ ## 4.2.0 (2026-09-04)
105
+
106
+ ### Added
107
+
108
+ - New node **ccu-homeassistant**: publishes Home Assistant MQTT
109
+ auto-discovery configurations (device-based, HA >= 2024.11) for a
110
+ checkbox-selected set of devices. It is a companion to the ccu-mqtt
111
+ node and reuses its topic templates and payload format, so the
112
+ discovery configs point at the topics ccu-mqtt already publishes and
113
+ consumes; wire its output to the same mqtt-out node. Entities: switch,
114
+ light (dimmers), cover (blinds/shutters incl. tilt), climate (HM and
115
+ HmIP thermostats), binary_sensor (contact, rotary handle, motion,
116
+ presence, smoke, water), event (keys), lock (KeyMatic), sensor (energy,
117
+ weather, maintenance) plus, optionally, disabled-by-default entities for
118
+ every other datapoint. Unchecking a device removes it from Home
119
+ Assistant on the next deploy. (Roadmap B-16)
120
+ - ccu-mqtt: the setValue topic accepts Home Assistant's command words —
121
+ `OPEN`, `CLOSE`, `STOP`, `ON`, `OFF` on LEVEL and `AUTO-MODE`,
122
+ `MANU-MODE`, `BOOST-MODE`, `COMFORT-MODE`, `LOWERING-MODE` on the
123
+ read-only CONTROL_MODE of HM thermostats (translated to the `*_MODE`
124
+ actions).
125
+
126
+ ### Fixed
127
+
128
+ - ccu-mqtt: channels without a ReGa name produced topics with an empty
129
+ segment (`hm/status//STATE`); the channel address is used instead.
130
+ - Closing a ccu-mqtt or ccu-rpc-event node threw inside the connection's
131
+ deregister, so the node was never reported as closed on deploy.
132
+
8
133
  ## 4.1.0 (2026-09-04)
9
134
 
10
135
  ### Fixed
package/HANDOFF.md CHANGED
@@ -7,14 +7,24 @@ Lab addresses and credentials are intentionally **not** in this file
7
7
 
8
8
  ## State
9
9
 
10
- - **4.0.0 released 2026-09-02** (npm latest, OIDC provenance, GitHub
11
- release). Master is at `4.1.0-dev.5`+, **CI fully green** (lint + Node
12
- 22/24 × Node-RED 4/5).
13
- - In the Unreleased (4.1.0) changelog: binrpc 4.2.0, B-14
14
- (LEVEL_2 → COMBINED_PARAMETER, unverified on hardware), paramsets
15
- fetch/join tooling. Phase 3: cast/topic/message/castSysvar extracted,
16
- 43 unit tests (`npm run test:pure`).
17
- - Issue tracker fully triaged; B-6/B-14 archived; roadmap is current.
10
+ - **4.0.0 released 2026-09-02, 4.1.0 released 2026-09-04** (npm latest
11
+ = 4.1.0, OIDC provenance, GitHub releases). 4.1.0 = binrpc 4.2.0, B-14
12
+ (LEVEL_2 → COMBINED_PARAMETER, unverified on hardware by decision),
13
+ paramsets fetch/join tooling and the regenerated `paramsets.json`
14
+ (+605 keys from the production CCU and two lab CCUs). Phase 3:
15
+ cast/topic/message/castSysvar extracted, 43 unit tests
16
+ (`npm run test:pure`, 71 on the B-16 branch).
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
+ - Issue tracker fully triaged (second pass 2026-09-04, B-7 done): 36
24
+ issues open, all annotated with their roadmap item; 5 closed that day;
25
+ 8 newly diagnosed defects recorded in ROADMAP §8.3 — the two cheapest
26
+ are the unguarded RSSI conversion (#183) and the dropped sysvar
27
+ re-poll (#166). B-6/B-14/B-16 archived; roadmap is current.
18
28
 
19
29
  ## Decisions (2026-09-04)
20
30
 
@@ -50,14 +60,55 @@ Lab addresses and credentials are intentionally **not** in this file
50
60
  (ccu-value node writing LEVEL_2 to the HmIP-FBL's `:4` channel on
51
61
  the Node-RED test box, log shows the COMBINED_PARAMETER remap) stays
52
62
  valid if it is ever wanted.
53
- 3. **Release 4.1.0** — in progress 2026-09-04: CHANGELOG heading dated,
54
- `npm pkg set version=4.1.0`, commit, push, CI green, `git tag v4.1.0
55
- && git push origin v4.1.0` — release.yml publishes via OIDC and
56
- creates the GitHub release from the CHANGELOG.
57
- 4. **Release 4.2.0 = B-16** right after: user does the editor smoke test
58
- on a lab CCU (the branch build is installed on both), then rebase the
59
- branch onto master, push for CI, merge, date the CHANGELOG section,
60
- version 4.2.0, tag. B-2 moves to 4.3.0.
63
+ 3. ~~Release 4.1.0~~ **done 2026-09-04** (tag v4.1.0, release.yml green,
64
+ npm latest 4.1.0). Follow-up worth doing: comment on #136/#154/#175
65
+ that 4.1.0 contains the LEVEL_2 fix and ask for confirmation on real
66
+ hardware (needs the user's go — outward-facing).
67
+ 4. **Release 4.2.0 = B-16** — editor smoke test done by the user
68
+ 2026-09-04 (ok), released the same day: branch merged into master
69
+ with `--no-ff` (never rebase with `-X theirs` — it silently keeps the
70
+ branch side of conflicting doc hunks, which bit twice today), CHANGELOG
71
+ dated, version 4.2.0, tag v4.2.0. B-16 archived. B-2 is 4.3.0.
72
+
73
+ ## B-16 branch `b-16-homeassistant` (2026-09-04, target 4.2.0)
74
+
75
+ - Implemented and committed on the branch (not pushed): ccu-homeassistant
76
+ node + `lib/haroles.js` + `lib/hadiscovery.js` (ported from hm2mqtt.js;
77
+ channel TYPE is the primary role key because only ~45 % of the shipped
78
+ VALUES descriptions carry CONTROL hints), 24 unit tests, ccu-mqtt HA
79
+ command words + empty-name
80
+ topic fix, ccu-connection `deregister` fix and `type=devices` admin
81
+ endpoint, README section, `examples/home-assistant.json`, CHANGELOG
82
+ "Unreleased (4.2.0)". Details in ROADMAP B-16.
83
+ - Local `npm test`: lint + 71 pure tests green. The mocha integration
84
+ suite cannot run on this WSL machine (hm-simulator's port 8181 →
85
+ EADDRINUSE, identical on master) — push the branch and let CI run it.
86
+ - **Lab test done 2026-09-04** on the CCU3 lab box (branch build
87
+ installed into RedMatic, `node-red-contrib-aedes` as broker inside
88
+ Node-RED, flow tab "B-16 Home Assistant" left deployed there) against
89
+ Home Assistant 2026.9.0 in docker on WSL: 3 wired devices discovered
90
+ (232 entities, 47 enabled), switch round trip on/off, DRI16 event
91
+ entities, removal on untick — all good after fixing three payload
92
+ defects HA had rejected (see ROADMAP B-16). Scripts for the whole setup
93
+ (install, deploy, HA onboarding, status via comms websocket) are in
94
+ this session's scratchpad; the lab hand-over note lists the HA
95
+ container and login.
96
+ - Second round on the OpenCCU lab box (branch build installed there too,
97
+ flow tab "B-16 Home Assistant" with topic prefix `hm2/` and plain
98
+ payloads, publishing to the CCU3 box's broker): HmIP-PDT light round
99
+ trip with brightness verified, HmIP-WRC2 events discovered, no HA
100
+ warnings.
101
+ - she (Smart Home Engine) as consumer: the user moved their she dev
102
+ instance to the test broker, and both lab flows now publish there as
103
+ well (second mqtt-broker config in each flow), so that instance's
104
+ HA-discovery view lists the 5 lab devices (no orphaned/duplicate
105
+ flags) — the quick check for future B-16 changes; a private she on the
106
+ lab broker exists too. Details and addresses in the lab hand-over note.
107
+ - Still open: editor smoke test in a browser on a lab box (device table,
108
+ ccu-mqtt select), a real key press (event entity), CI. Cover/climate
109
+ payloads have no lab hardware — unit tests only.
110
+ - Merge after 4.1.0 is released (rebase onto master; the CHANGELOG has
111
+ separate Unreleased sections, so this is trivial).
61
112
 
62
113
  ## Infrastructure (this does not travel via git; addresses live outside the repo)
63
114
 
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
+ ## Home Assistant
32
+
33
+ The `ccu-homeassistant` node publishes
34
+ [MQTT discovery](https://www.home-assistant.io/integrations/mqtt/#mqtt-discovery) configurations (device-based,
35
+ Home Assistant >= 2024.11) for the devices you tick in its config dialog. It is a companion to the `ccu-mqtt` node:
36
+ it reuses that node's topic templates and payload format, so state and commands keep flowing through `ccu-mqtt` and
37
+ the discovery configs simply point Home Assistant at those topics. Wire both nodes to the same `mqtt out` node and
38
+ feed the `hm/set/#` topics from an `mqtt in` node into `ccu-mqtt` — see
39
+ [examples/home-assistant.json](examples/home-assistant.json). One Home Assistant device is created per Homematic
40
+ device with switch, light, cover, climate, binary_sensor, event, lock and sensor entities; every other datapoint can
41
+ optionally be included as a disabled-by-default entity. Unticking a device removes it from Home Assistant on the
42
+ next deploy.
43
+
44
+ ## Dynamic configuration
45
+
46
+ Most nodes can be reconfigured per message: put an object in `msg.config` and its
47
+ properties override that node's own configuration **for that one message**. The stored
48
+ configuration is never modified, so the next message starts from the dialog settings
49
+ again — sending a different room, channel or brightness each time works as you would
50
+ expect.
51
+
52
+ ```javascript
53
+ // one signal node, a different colour and duration per message
54
+ msg.config = {dimmerColor: 4, durationValue: 10};
55
+
56
+ // one set-value node, a different room per message
57
+ msg.config = {rooms: 'Kitchen'};
58
+ return msg;
59
+ ```
60
+
61
+ Which keys a node accepts is listed in its help panel in the editor. Anything not on
62
+ that list is ignored, so an unrelated property in `msg.config` cannot reach node
63
+ internals. `msg.ccu` is not used for this because it already carries the CCU host name.
64
+
65
+ The `value`, `get value` and `set value` nodes additionally read plain top-level
66
+ properties (`msg.channel`, `msg.datapoint`, `msg.rooms`, …) to fill in fields left empty
67
+ in the dialog. That is the older mechanism and is unchanged; `msg.config` wins over it.
68
+
69
+ Inside a **subflow**, Node-RED substitutes `${PARAMETER}` placeholders in a node's text
70
+ fields before the node is created, so a subflow parameter can be typed straight into the
71
+ Channel or Datapoint field and each instance reads its own device.
72
+
31
73
  ## Configuration Examples
32
74
 
33
75
  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).