node-red-contrib-ccu 4.4.4 → 4.5.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 (60) hide show
  1. package/CHANGELOG.md +175 -0
  2. package/README.md +35 -0
  3. package/nodes/ccu-alexa.html +12 -14
  4. package/nodes/ccu-connection.html +63 -95
  5. package/nodes/ccu-connection.js +812 -115
  6. package/nodes/ccu-get-value.html +18 -15
  7. package/nodes/ccu-get-value.js +16 -0
  8. package/nodes/ccu-homeassistant.html +0 -48
  9. package/nodes/ccu-mqtt.html +0 -8
  10. package/nodes/ccu-poll.html +0 -17
  11. package/nodes/ccu-program.html +0 -53
  12. package/nodes/ccu-rpc-event.html +0 -34
  13. package/nodes/ccu-rpc.html +0 -64
  14. package/nodes/ccu-script.html +0 -8
  15. package/nodes/ccu-set-value.html +0 -62
  16. package/nodes/ccu-set-value.js +6 -11
  17. package/nodes/ccu-signal.html +0 -64
  18. package/nodes/ccu-switch.html +12 -24
  19. package/nodes/ccu-sysvar.html +0 -64
  20. package/nodes/ccu-value.html +23 -95
  21. package/nodes/ccu-value.js +8 -2
  22. package/nodes/lib/initretry.js +46 -9
  23. package/nodes/lib/localccu.js +21 -3
  24. package/nodes/lib/metaprovider.js +47 -19
  25. package/nodes/lib/party.js +103 -0
  26. package/nodes/lib/topic.js +22 -1
  27. package/nodes/lib/transport.js +80 -0
  28. package/nodes/locales/de/ccu-alexa.html +4 -0
  29. package/nodes/locales/de/ccu-connection.html +103 -0
  30. package/nodes/locales/de/ccu-get-value.html +16 -0
  31. package/nodes/locales/de/ccu-homeassistant.html +23 -0
  32. package/nodes/locales/de/ccu-mqtt.html +21 -0
  33. package/nodes/locales/de/ccu-poll.html +8 -0
  34. package/nodes/locales/de/ccu-program.html +26 -0
  35. package/nodes/locales/de/ccu-rpc-event.html +32 -0
  36. package/nodes/locales/de/ccu-rpc.html +31 -0
  37. package/nodes/locales/de/ccu-script.html +13 -0
  38. package/nodes/locales/de/ccu-set-value.html +46 -0
  39. package/nodes/locales/de/ccu-signal.html +29 -0
  40. package/nodes/locales/de/ccu-switch.html +18 -0
  41. package/nodes/locales/de/ccu-sysvar.html +43 -0
  42. package/nodes/locales/de/ccu-value.html +98 -0
  43. package/nodes/locales/de/ccu-value.json +1 -0
  44. package/nodes/locales/en-US/ccu-alexa.html +4 -0
  45. package/nodes/locales/en-US/ccu-connection.html +41 -0
  46. package/nodes/locales/en-US/ccu-get-value.html +13 -0
  47. package/nodes/locales/en-US/ccu-homeassistant.html +23 -0
  48. package/nodes/locales/en-US/ccu-mqtt.html +21 -0
  49. package/nodes/locales/en-US/ccu-poll.html +7 -0
  50. package/nodes/locales/en-US/ccu-program.html +25 -0
  51. package/nodes/locales/en-US/ccu-rpc-event.html +31 -0
  52. package/nodes/locales/en-US/ccu-rpc.html +30 -0
  53. package/nodes/locales/en-US/ccu-script.html +13 -0
  54. package/nodes/locales/en-US/ccu-set-value.html +45 -0
  55. package/nodes/locales/en-US/ccu-signal.html +29 -0
  56. package/nodes/locales/en-US/ccu-switch.html +6 -0
  57. package/nodes/locales/en-US/ccu-sysvar.html +42 -0
  58. package/nodes/locales/en-US/ccu-value.html +81 -0
  59. package/nodes/locales/en-US/ccu-value.json +1 -0
  60. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,181 @@ 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.5.0 (2026-09-29)
9
+
10
+ ### Added
11
+
12
+ - **TLS and authentication for every connection to a CCU on the network**
13
+ (task 5, #27). With _TLS/SSL_ on, all XML-RPC interfaces are reached over
14
+ the CCU's TLS ports (42000, 42001, 42010, 49292; CCU-Jack 2122), the ReGaHSS
15
+ over 48181 and openccu-lite's metadata api over 443; with _Authentication_
16
+ on, the username and password go out as HTTP basic auth on every call, the
17
+ `init` included, to every XML-RPC interface and the ReGaHSS. Both are the
18
+ CCU's web server's - a CCU3 switches them on in its firewall settings,
19
+ openccu-lite under remote access. A local connection (Node-RED on the
20
+ system, `localhost` / `127.0.0.1`) reaches the interface processes directly
21
+ on the loopback and uses neither, whatever the dialog says: https to a plain
22
+ port or credentials in a BIN-RPC frame only broke the connection before;
23
+ the dialog hides the fields for a loopback address and says so. BIN-RPC has
24
+ neither: with TLS on, BidCos-RF goes XML-RPC over TLS even when the hidden
25
+ `bcrfBinRpc` property asked for BIN-RPC (a warning names it); CUxD's BIN-RPC
26
+ never has them. Node-RED's own callback server for the CCU's events stays
27
+ plain HTTP - the CCU presents no credentials and cannot verify our
28
+ certificate; the help text says so and asks for a firewall rule on the
29
+ Node-RED host. Ticking _Authentication_ ticks _TLS/SSL_ with a notice in the
30
+ editor instead of a browser alert. Without _Ignore invalid TLS
31
+ certificates_, the CCU's self-signed certificate is refused, as before.
32
+
33
+ - **One topic template in every node that emits, the value node's input
34
+ takes the emitted shape** (task 6, #39 @psi-4ward). The `get value` node has a _Topic_
35
+ field now, the same `${…}` template as rpc-event, value, sysvar, program,
36
+ rpc and script; empty (the default, and every existing flow) leaves
37
+ `msg.topic` as it came in. The value node's input accepts a datapoint
38
+ address in `msg.topic` in the shape the nodes emit
39
+ (`ccu3/BidCos-RF/OEQ1868878:1/STATE`, `hm/BidCos-RF/OEQ1868878:1/STATE`: the
40
+ last three slash-separated segments) besides the old
41
+ `BidCos-RF.OEQ1868878:1.STATE`, so an event's topic can be fed straight back.
42
+ No default changed: whoever wants one scheme everywhere enters e.g.
43
+ `hm/${Interface}/${channel}/${datapoint}` in each node; the README's _Topics_
44
+ section lists the defaults and the placeholders, the help texts of
45
+ rpc-event, value and get value the placeholders.
46
+
47
+ - **Help texts for every node in German and English, as locale files**
48
+ (task 7, #58). The help moved from inline blocks in the node files into
49
+ `nodes/locales/de/` and `nodes/locales/en-US/`, the layout Node-RED
50
+ documents for node help: the runtime serves one language's text per
51
+ request through the same lookup as its own nodes (`de` and `de-DE` both
52
+ get the German text, everything else the English one) instead of shipping
53
+ every language's block with the node. German is the source; the English texts of the connection,
54
+ value, rpc-event, set-value, sysvar and switch nodes, which were missing or
55
+ one-line stubs, are complete now, the mqtt node's help describes its topics,
56
+ commands and payload formats in both languages, the set-value node's German
57
+ configuration list (empty bullets since 3.x) and the rpc-event node's output
58
+ section are written, and the value nodes link the eQ-3 HmIP device
59
+ documentation for what a datapoint means (@lolli78). A unit test guards
60
+ that every node has both files, that neither is a stub, and that no inline
61
+ help is left.
62
+
63
+ ### Fixed
64
+
65
+ - **Writing one party-mode datapoint of an HmIP thermostat reset the other
66
+ two** (task 2, #156 @ben-5555, #161 @lolli78). An HmIP eTRV/WTH takes
67
+ `PARTY_TIME_START`, `PARTY_TIME_END` and `PARTY_SET_POINT_TEMPERATURE` only
68
+ together: a `setValue` of one of them put the others back to
69
+ `1999_11_30 00:00`, so party or holiday mode could not be set from the
70
+ value nodes at all. A write to one of the three through the value or
71
+ set-value node now goes out as one `putParamset` on `VALUES` with all
72
+ three, the other two taken from our own last write, the value cache or a
73
+ `getParamset` read of the channel - the way the WebUI writes them. The two
74
+ times may be given as the device's `YYYY_MM_DD HH:MM` string, a JavaScript
75
+ Date, an ISO string or epoch milliseconds; they are formatted for the device
76
+ in local time. Any other datapoint of the channel is written as before. The
77
+ older HM thermostats (`PARTY_MODE_SUBMIT`) are not covered.
78
+ - **A callback call with an unknown interface id ended Node-RED** (B-32).
79
+ Anything on the system can connect to the connection's callback ports on
80
+ the loopback; a `system.listMethods` without parameters, an `event` with an
81
+ id that is not one of ours, or a `newDevices` list with a malformed entry
82
+ threw inside the RPC server's handler, which runs from an event emitter -
83
+ an uncaught `TypeError`, and the whole Node-RED process exited. Such a call
84
+ is now answered with an empty result (the method list for
85
+ `system.listMethods`) and logged at debug; a throw inside a handler is
86
+ logged as an error and answered instead of ending the process.
87
+ - **A metadata api detection that timed out at start left the connection in
88
+ ReGa mode for good** (B-28). On openccu-lite the connection asks
89
+ `GET /api/meta/v1/version` once at start; when that probe ran into its 5 s
90
+ timeout - on a Raspberry Pi 3 Node-RED's own start blocks the event loop
91
+ long enough for that at every start, on a busy system now and then - the
92
+ connection settled for the ReGaHSS, the ReGa polls failed every 30 s and
93
+ names, rooms and functions stayed empty; the only re-detection ran from rare
94
+ error paths, at most every five minutes. A timeout, a refused connection or
95
+ a 502/503/504 is now taken as "not decided": the ReGa path starts as before,
96
+ the detection is repeated after 1, 2, 4, 8 s and then every 15 s (up to 20
97
+ times, then the five-minute rule again), and the failing ReGa poll asks for
98
+ a re-detection too. A CCU's 404 is still a conclusive "no".
99
+ - **After an hmipserver restart HmIP-RF events stopped for up to ten minutes**
100
+ (B-29). hmipserver forgets its clients when it restarts and does not tell
101
+ them: the `init` had succeeded, nothing failed, and the events simply stopped
102
+ until the 600 s silence timeout called `init` again. The connection now
103
+ pings HmIP-RF after 30 s without an event and, when no event (the PONG)
104
+ arrives within 10 s, subscribes again at once - the interface shows
105
+ _waiting_ meanwhile, one warning names the reason, and the retry of 4.4.4
106
+ covers the time the process is down. A `newDevices` from the restarted
107
+ hmipserver (it sends one about 16 s in) triggers the ping right away, so
108
+ events are back well within a minute. An interface that never delivered an
109
+ event since its `init` is not re-subscribed on a missing PONG alone.
110
+ - **A queued write of the same set point was dropped after the actuator had
111
+ been operated by hand** (B-19, #151 @vigeland). The value node's _Queue_ compared the
112
+ new value with the value cache, and the cache of a control channel
113
+ (HmIP-FROLL/BROLL `:4`, the status lives in `:3`) holds the echo of our own
114
+ last write for good - a blind moved by hand reports no new set point there,
115
+ so the same `1` could never be sent again while Homematic Manager moved the
116
+ blind at once. A cached value that is the echo of our own last write no
117
+ longer dedupes; only a value from another source does. The value node has a
118
+ _Force_ option (and `msg.config.force`), as set-value has it; set-value's
119
+ own pre-check no longer drops a forced write when the cache already holds
120
+ the value.
121
+
122
+ ### Security
123
+
124
+ - **The CCU password and the openccu-lite token were stored in plain text in
125
+ `flows.json`** and went out with every exported flow (B-31). Both are
126
+ Node-RED credentials now (`flows_cred.json`, encrypted, never exported).
127
+ A flow written before this version still carries them as plain properties:
128
+ the connection uses them once, moves them into the credentials and warns;
129
+ the editor no longer knows the two properties, so the next deploy removes
130
+ them from `flows.json`. Nothing to do by hand.
131
+
132
+ ### Changed
133
+
134
+ - **The device table follows the CCU, and can be re-read by hand** (task 9,
135
+ #146 @guny74, #181 @vore). A device or channel the CCU reports with another TYPE,
136
+ VERSION or FIRMWARE than the cache holds replaces the cached entry, leaves
137
+ its old type list and gets its datapoints fetched again - a channel whose
138
+ type changed in place kept its old datapoints before, until the cache file
139
+ was deleted. The connection node's dialog has a _Re-read device data_
140
+ button that asks every connected interface for its device list again
141
+ (new and changed devices get their datapoints, removed ones go) and
142
+ reports what changed. The editor's channel pickers no longer empty the
143
+ configured channel when the connection is still initialising: they show
144
+ _loading device data_ and ask again.
145
+ - **An interface without devices is watched too** (task 9, old B-11). The
146
+ ping watchdog returned early for an interface with no devices in the
147
+ cache, so such an interface never pinged and never re-initialised after a
148
+ CCU reboot. It pings now, and re-initialises after the ping timeout once
149
+ it has ever delivered an event (a PONG counts) - a process that answers no
150
+ ping at all is not asked to `init` every timeout.
151
+ - **The `listDevices` answer to hmipserver lists the CCU's virtual remote
152
+ control (HmIP-RCV-1) again** (task 13). It was left out since CCU3 firmware
153
+ 3.43.15 (2019), whose hmipserver failed on an answer that held it; current
154
+ hmipservers take it, and without it every `init` made hmipserver log a
155
+ _handleIDMigration_ warning and send the whole virtual remote (52
156
+ descriptions) again with `newDevices`.
157
+
158
+ ## 4.4.5 (2026-09-26)
159
+
160
+ ### Fixed
161
+
162
+ - **A Node-RED started before rfd went through the CCU's proxy for good.**
163
+ The connection decides at start whether it runs on the CCU itself, and
164
+ looked only for a listener on rfd's direct port. On openccu-lite, where
165
+ RedMatic starts at boot before the interface processes (the early start),
166
+ that port is not open yet, so every interface went through lighttpd's
167
+ proxy ports (XML-RPC instead of BIN-RPC for BidCos) until the next restart.
168
+ A loopback host on a system that has the CCU's interface list
169
+ (`/etc/config/InterfacesList.xml`) is now taken as local as well.
170
+ - **Waiting for an interface process that is still starting is no warning**
171
+ (task 12). Before the interface was ever connected, a refused connection
172
+ is one info line (_"HmIP-RF not listening yet (connect ECONNREFUSED),
173
+ waiting for it - retrying in 1 s"_); another transport error, or a refused
174
+ connection after the interface had been connected, is still a warning, and
175
+ a fault answer an error.
176
+
177
+ ### Changed
178
+
179
+ - **A failed `init` is retried after 1 s, 2 s, 4 s and 8 s, then every 15 s**
180
+ (task 12; was 2, 4, 8, 16 s, then every 30 s), the schedule of hm2mqtt.js and
181
+ the Homematic Manager.
182
+
8
183
  ## 4.4.4 (2026-09-17)
9
184
 
10
185
  ### Fixed
package/README.md CHANGED
@@ -28,6 +28,41 @@ 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 based on OpenCCU **without
34
+ ReGaHSS**. The interface processes (`rfd`, `hs485d`, `hmipserver`) are the same, so everything these nodes do over
35
+ BINRPC/XMLRPC works unchanged. Device, channel, room and function names come from the system's metadata API instead of
36
+ ReGaHSS; the connection node detects this at start (`GET /api/meta/v1/version`), nothing has to be configured, and
37
+ `msg.channelName`, `msg.rooms`, `msg.functions` and the room/function filters keep their shape.
38
+
39
+ - Node-RED **on the system** (RedMatic from its addon catalogue): the system's own read-only token is used, nothing to do.
40
+ - Node-RED **elsewhere**: an API token of the system goes into the connection node's **openccu-lite token** field.
41
+ - **System variables, programs and HM-Script do not exist there.** The `ccu-sysvar`, `ccu-program`, `ccu-script` and
42
+ `ccu-poll` nodes stay in the flows and answer every message with an error.
43
+
44
+ ## Topics
45
+
46
+ Every node that emits messages builds `msg.topic` from the same template, configurable per node, with these defaults:
47
+
48
+ | Node | Default topic |
49
+ | --------------- | ------------------------------------------------- |
50
+ | rpc-event | `${CCU}/${Interface}/${channelName}/${datapoint}` |
51
+ | value | `${CCU}/${Interface}/${channel}/${datapoint}` |
52
+ | get value | _(empty: `msg.topic` stays as it came in)_ |
53
+ | sysvar, program | `ReGaHSS/${Name}` |
54
+ | rpc | `${CCU}/${Interface}/${Method}` |
55
+ | script | `${CCU}/${Interface}` |
56
+
57
+ Placeholders are the message's properties, matched case-insensitively: `${CCU}`, `${Interface}`, `${device}`,
58
+ `${deviceName}`, `${deviceType}`, `${channel}`, `${channelName}`, `${channelType}`, `${channelIndex}`, `${datapoint}`,
59
+ `${datapointName}`; `${Name}` for a variable or program, `${Method}` for an RPC call. To get one scheme everywhere -
60
+ `hm/<interface>/<channel>/<datapoint>`, say - enter `hm/${Interface}/${channel}/${datapoint}` in each node; the defaults
61
+ stay as they are so existing flows and subscriptions keep working. The value node's input accepts a datapoint address in
62
+ `msg.topic` either as `iface.channel.datapoint` or in the emitted shape (`ccu3/BidCos-RF/OEQ1868878:1/STATE`,
63
+ `hm/BidCos-RF/OEQ1868878:1/STATE`: the last three segments count), so an event's topic can be fed straight back. The
64
+ `ccu-mqtt` node has its own templates for its MQTT topics.
65
+
31
66
  ## Home Assistant
32
67
 
33
68
  The `ccu-homeassistant` node publishes
@@ -30,6 +30,7 @@
30
30
  let ifacesLoaded = false;
31
31
  let ifacesPending = false;
32
32
  let ifaceLoadRetries = 5;
33
+ let channelLoadRetries = 30;
33
34
 
34
35
  function loadIfaces(iface, cb) {
35
36
  if (ifacesPending) {
@@ -73,7 +74,16 @@
73
74
 
74
75
  const nodeId = $nodeInputCcuConfig.val();
75
76
  const url = 'ccu?config=' + nodeId + '&type=channels&iface=' + $nodeInputIface.val();
76
- $.getJSON(url, d => {
77
+ $.getJSON(url, (d, _status, xhr) => {
78
+ // task 9: an empty list while the connection is still initialising is "not yet",
79
+ // not "nothing" - keep what is configured, say so, and ask again
80
+ if (Object.keys(d).length === 0 && xhr.getResponseHeader('X-CCU-Loading') && channelLoadRetries-- > 0) {
81
+ $nodeInputChannel.attr('placeholder', 'loading device data ...');
82
+ setTimeout(loadConfig, 2000);
83
+ return;
84
+ }
85
+
86
+ $nodeInputChannel.removeAttr('placeholder');
77
87
  data = d;
78
88
  autocompleteChannel();
79
89
  });
@@ -124,7 +134,7 @@
124
134
 
125
135
  // ${ENV} placeholders are substituted by Node-RED before the node is
126
136
  // constructed (subflow parameters, #158) - do not clear them
127
- if (!/^\$\{[^}]+\}$/.test($nodeInputChannel.val()) && !data[$nodeInputChannel.val().split(' ')[0]]) {
137
+ if (Object.keys(data).length > 0 && !/^\$\{[^}]+\}$/.test($nodeInputChannel.val()) && !data[$nodeInputChannel.val().split(' ')[0]]) {
128
138
  $nodeInputChannel.val('');
129
139
  }
130
140
  }
@@ -170,21 +180,9 @@
170
180
  <input type="text" id="node-input-channel">
171
181
  </div>
172
182
 
173
-
174
183
  <div class="form-row">
175
184
  <label for="node-input-name"><i class="icon-bookmark"></i> Name</label>
176
185
  <input type="text" id="node-input-name">
177
186
  </div>
178
187
 
179
-
180
- </script>
181
-
182
- <script type="text/x-red" data-help-name="ccu-alexa" lang="de">
183
- <p>Homematic Geräte mit node-red-contrib-alexa-smart-home verbinden. Am Eingang den Node "alexa smart home v3"
184
- anschließen, am Ausgang "alexa smart home v3 state".</p>
185
- </script>
186
-
187
- <script type="text/x-red" data-help-name="ccu-alexa" lang="en-US">
188
- <p>Connect Homematic Devices with node-red-contrib-alexa-smart-home. Connect a Node "alexa smart home v3" to the
189
- input and "alexa smart home v3 state" to the output.</p>
190
188
  </script>
@@ -29,9 +29,7 @@
29
29
  inSecure: {value: false},
30
30
  authentication: {value: false},
31
31
  username: {value: ''},
32
- password: {value: ''},
33
32
 
34
- metaToken: {value: ''},
35
33
  metaPort: {value: ''},
36
34
 
37
35
  queueTimeout: {value: 5000, required: true},
@@ -39,6 +37,12 @@
39
37
 
40
38
  contextStore: {value: ''}
41
39
  },
40
+ // B-31: the CCU password and the openccu-lite token live in Node-RED's
41
+ // credentials (flows_cred.json, encrypted, never exported), not in the flow
42
+ credentials: {
43
+ password: {type: 'password'},
44
+ metaToken: {type: 'password'}
45
+ },
42
46
  label() {
43
47
  return this.name || this.host;
44
48
  },
@@ -133,17 +137,51 @@
133
137
  $nodeConfigInputHost.focus();
134
138
  }
135
139
  }, 250);
136
- }
137
- });
138
140
 
139
- // called from the inline onclick attribute of the authentication checkbox
140
- // eslint-disable-next-line no-unused-vars
141
- function TLSSSL(){
142
- if (document.getElementById('node-config-input-authentication').checked && !document.getElementById('node-config-input-tls').checked){
143
- document.getElementById('node-config-input-tls').checked = true
144
- alert('TLS/SSL activated. \nWithout TLS/SSL your credentials would be sent unencrypted!')
141
+ // task 5 (#27): credentials without TLS travel in plain text - turning
142
+ // authentication on turns TLS on too (it can be unticked again)
143
+ const $auth = $('#node-config-input-authentication');
144
+ const $tls = $('#node-config-input-tls');
145
+ $auth.on('change', () => {
146
+ if ($auth.is(':checked') && !$tls.is(':checked')) {
147
+ $tls.prop('checked', true);
148
+ RED.notify('TLS/SSL switched on: without it the credentials would be sent in plain text.', {type: 'warning', timeout: 6000});
149
+ }
150
+ });
151
+
152
+ // a loopback address is Node-RED on the system: the interface processes are
153
+ // reached directly, TLS and credentials are not used (lib/localccu.js)
154
+ const isLoopback = host => /^(127\.|localhost$|::1$)/.test(String(host || '').trim());
155
+ const showAuthRows = () => {
156
+ const local = isLoopback($nodeConfigInputHost.val());
157
+ $('#node-config-auth-fields, #node-config-auth-hint').toggle(!local);
158
+ $('#node-config-input-username, #node-config-input-password').closest('.form-row').toggle(!local);
159
+ $('#node-config-auth-local').toggle(local);
160
+ };
161
+ $nodeConfigInputHost.on('change keyup', showAuthRows);
162
+ showAuthRows();
163
+
164
+ // task 9: re-read the device table of the deployed connection
165
+ const $reread = $('#node-config-reread');
166
+ const $rereadStatus = $('#node-config-reread-status');
167
+ $reread.on('click', () => {
168
+ $reread.prop('disabled', true);
169
+ $rereadStatus.text('Re-reading ...');
170
+ $.ajax({url: 'ccu/' + this.id + '/reread', type: 'POST', dataType: 'json'})
171
+ .done(summary => {
172
+ const parts = Object.keys(summary).map(iface => {
173
+ const s = summary[iface];
174
+ return iface + ': ' + (s.error ? s.error : s.total + ' entries (' + s.added + ' new, ' + s.changed + ' changed, ' + s.removed + ' removed)');
175
+ });
176
+ $rereadStatus.text(parts.length > 0 ? parts.join('; ') : 'no interface connected');
177
+ })
178
+ .fail(xhr => {
179
+ $rereadStatus.text(xhr.status === 404 ? 'Deploy this connection first.' : 'Failed: ' + (xhr.responseJSON && xhr.responseJSON.error || xhr.statusText));
180
+ })
181
+ .always(() => $reread.prop('disabled', false));
182
+ });
145
183
  }
146
- }
184
+ });
147
185
 
148
186
  </script>
149
187
 
@@ -206,6 +244,13 @@
206
244
  <label for="node-config-input-rpcPingTimeout"><i class="icon-tag"></i> RPC ping timeout (s)</label>
207
245
  <input type="text" id="node-config-input-rpcPingTimeout">
208
246
  </div>
247
+ <div class="form-row">
248
+ <label for="node-config-reread"><i class="icon-tag"></i> Device data</label>
249
+ <div style="width: 70%; display: inline-block; vertical-align: text-top;">
250
+ <button type="button" class="red-ui-button" id="node-config-reread">Re-read device data</button><br>
251
+ <small id="node-config-reread-status">Asks every connected interface for its device list again; new and changed devices get their datapoints fetched, removed ones go.</small>
252
+ </div>
253
+ </div>
209
254
  <div class="form-row">
210
255
  <label for="node-config-input-regaPoll"><i class="icon-tag"></i> Rega poll</label>
211
256
  <div style="width: 70%; display: inline-block; vertical-align: text-top;">
@@ -238,9 +283,13 @@
238
283
  <div class="form-row">
239
284
  <label for="node-config-input-authentication"><i class="icon-tag"></i> Authentication</label>
240
285
  <div style="width: 70%; display: inline-block; vertical-align: text-top;">
241
- <label class="ccu-checkbox"><input type="checkbox" id="node-config-input-authentication" onclick="TLSSSL()"> Enabled</label><br>
242
- <label class="ccu-checkbox"><input type="checkbox" id="node-config-input-tls"> TLS/SSL</label><br>
243
- <label class="ccu-checkbox"><input type="checkbox" id="node-config-input-inSecure"> Ignore invalid TLS Certificates</label><br>
286
+ <span id="node-config-auth-fields">
287
+ <label class="ccu-checkbox"><input type="checkbox" id="node-config-input-authentication"> Enabled</label><br>
288
+ <label class="ccu-checkbox"><input type="checkbox" id="node-config-input-tls"> TLS/SSL</label><br>
289
+ <label class="ccu-checkbox"><input type="checkbox" id="node-config-input-inSecure"> Ignore invalid TLS Certificates</label><br>
290
+ </span>
291
+ <small id="node-config-auth-hint">For a CCU on the network: TLS uses the CCU's 4xxxx ports, the credentials are sent as HTTP basic auth (switch both on in the CCU's firewall settings, on openccu-lite under remote access). Node-RED's own callback server for the CCU's events stays plain HTTP.</small>
292
+ <small id="node-config-auth-local" style="display: none;">Node-RED runs on the system itself: the interface processes are reached directly on the loopback (BIN-RPC for BidCos), without TLS and without credentials. These settings are not used.</small>
244
293
  </div>
245
294
  </div>
246
295
  <div class="form-row">
@@ -262,84 +311,3 @@
262
311
  <small>Only needed when the box's web server is not on the default port.</small>
263
312
  </div>
264
313
  </script>
265
-
266
-
267
-
268
-
269
- <script type="text/x-red" data-help-name="ccu-connection" lang="de-DE">
270
- <p>Im Connection Node wird die Verbindung zu den CCU Schnittstellenprozessen und zur Logikschicht verwaltet.</p>
271
- <h3>Konfiguration</h3>
272
- <ul>
273
- <li><b>Name</b>: Frei wählbarer Name für die aktuelle CCU-Konfiguration. Er dient zur Unterscheidung falls mehrere CCUs an RedMatic angebunden werden und erscheint in allen anderen CCU Nodes.</li>
274
- </ul>
275
- <ul>
276
- <li><b>CCU Address</b>: Die IP-Adresse oder der Hostname der CCU. Wird das CCU-Addon RedMatic genutzt, läuft Node-RED auf dem selben Server weshalb die Loopback-Adresse <code>localhost</code> bzw. <code>127.0.0.1</code> gewählt werden kann.</li>
277
- </ul>
278
- <ul>
279
- <li><b>Listen Address</b>: Die IP-Adresse des Netzwerk-Interfaces auf welchem die RedMatic RPC Server "lauschen" sollen. Läuft RedMatic auf der CCU wird hier ebenfalls <code>localhost</code> bzw. <code>127.0.0.1</code> verwendet. Um auf allen Interfaces zu lauschen kann <code>0.0.0.0</code> verwendet werden.</li>
280
- </ul>
281
- <ul>
282
- <li><b>Init Address</b>: entspricht normalerweise <i>Listen address</i>, Die Adresse unter der Node-RED von der
283
- CCU aus erreichbar ist. Das Eingabefeld kann leer gelassen werden.</p>
284
- <p>Für fortgeschrittene User: Wenn auf allen Interfaces gelauscht wird (Adresse 0.0.0.0) oder wenn Node-RED in
285
- einem Container (z.B. Docker) mit NAT-Netzwerk läuft oder in anderen spezielleren Netzwerkumgebungen kann es
286
- notwendig sein <i>Init address</i> und <i>Listen Address</i> auf unterschiedliche Werte zu setzen.</li>
287
- </ul>
288
- <ul>
289
- <li><b>BinRPC Port</b>: Der Port des RedMatic BinRPC Dienstes an den die CCU Events schickt. Werden Verbindungen zu mehreren CCUs hergestellt (mehrere instanzen des ccu-configuration Node) braucht jede Verbindung einen exklusiven Port.</li>
290
- </ul>
291
- <ul>
292
- <li><b>XMLRPC Port</b>: Der Port des RedMatic XMLRPC Dienstes an den die CCU Events schickt. Werden Verbindungen zu mehreren CCUs hergestellt braucht jede Verbindung einen exklusiven Port.</li>
293
- </ul>
294
- <ul>
295
- <li><b>Interfaces</b>: Hier können die zu verwendenden Schnittstellen angegeben werden. Nutzt man Beispielsweise keinen CUxD oder HmIP Geräte, kann der Haken entfernt werden was die entsprechenden ungenutzten Komponenten deaktiviert.
296
- <ul>
297
- <li>ReGaHSS: Die Logikschicht der CCU, verwaltet CCU-Programme und CCU-Systemvariablen</li>
298
- <li>BidCos-RF: Homematic Funk</li>
299
- <li>BidCos-Wired: Homematic Wired</li>
300
- <li>HmIP-RF: Homematic-IP Funk</li>
301
- <li>VirtualDevices: Heizungsgruppen, in CCU eingebundene Systeme wie Osram Lightify</li>
302
- <li>CUxD</li>
303
- <li>CCU-Jack: XMLRPC-Schnittstelle des <a href="https://github.com/mdzio/ccu-jack" target="_blank">CCU-Jack</a> Addons (Port konfigurierbar, Standard 2121 bzw. 2122 mit TLS)</li>
304
- </ul>
305
-
306
- </li>
307
- </ul>
308
- <ul>
309
- <li><b>RPC Ping-Timeout</b>: Zeitinterval in Sekunden in dem die Verbindung zu den Schnittstellenprozessen geprüft wird.</li>
310
- </ul>
311
- <ul>
312
- <li><b>ReGaHSS Polling</b>: Änderungen von CCU-Systemvariablen werden nicht automatisch an RedMatic übermittelt. Mit aktiviertem Polling fragt RedMatic die Variablen und deren Werte in den per Poll-Interval eingestellten Zeitintervallen ab.</li>
313
- </ul>
314
- <ul>
315
- <li><b>ReGaHSS Poll-Interval</b>:
316
- Das Zeitintervall in Sekunden in dem Systemvariablen von der CCU abgefragt werden.</li>
317
- </ul>
318
- <ul>
319
- <li><b>Context-Store</b>: Hier wird der Node-RED Context-Store festgelegt in dem RedMatic die Zustände aller Geräte/Variablen vorhält.
320
-
321
- Weiteres unter <a target="_blank" href="https://nodered.org/docs/user-guide/context">Working</a> with context in der Node-RED Dokumentation.</li>
322
- </ul>
323
- <ul>
324
- <li><b>openccu-lite Token</b>: Nur für <a href="https://github.com/hobbyquaker/openccu-lite" target="_blank">openccu-lite</a>,
325
- eine CCU-Firmware ohne ReGaHSS. Namen, Räume und Gewerke kommen dort aus der Metadaten-API der Box;
326
- dafür wird ein Token benötigt, das auf der Box unter <i>Benutzer</i> erzeugt wird. Läuft Node-RED
327
- auf der Box selbst (RedMatic), bleibt das Feld leer – das lokale Token wird dann automatisch gelesen.
328
- Eine CCU/RaspberryMatic/OpenCCU ignoriert das Feld vollständig. Systemvariablen, Programme und
329
- HM-Scripte gibt es auf openccu-lite nicht; die entsprechenden Nodes bleiben im Flow, melden aber pro
330
- Nachricht einen Fehler.</li>
331
- </ul>
332
- <ul>
333
- <li><b>openccu-lite Port</b>: Nur nötig, wenn der Webserver der Box nicht auf Port 80 bzw. 443 (TLS) läuft.</li>
334
- </ul>
335
- <ul>
336
- <li><b>Authentication</b>: Hier kann angegeben werden wie mit der CCU Kommuniziert werden soll.</li>
337
- <ul>
338
- <li>Enabled: Es soll via Benutzer/Passwort kommuniziert werden</li>
339
- <li>TLS/SSL: Aktiviert die Transportverschlüsselung</li>
340
- <li>Ignore invalid TLS Certificates: Node-RED akzeptiert nicht vertrauenswürdige Zertifikate. Notwendig wenn die CCU kein vertrauenswürdiges Zertifikat hat.</li>
341
- <li>Username: Ein Benutzer der sich an der CCU anmelden darf.</li>
342
- <li>Password: Das Passwort des Benutzers.</li>
343
- </ul>
344
- </ul>
345
- </script>