node-red-contrib-ccu 4.9.0 → 4.10.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 +44 -0
- package/README.md +2 -1
- package/nodes/ccu-connection.js +127 -4
- package/nodes/lib/lite.js +179 -42
- package/nodes/lib/metaprovider.js +327 -333
- package/nodes/lib/status.js +18 -2
- package/nodes/locales/de/ccu-connection.html +1 -1
- package/nodes/locales/en-US/ccu-connection.html +1 -1
- package/package.json +2 -2
package/nodes/lib/status.js
CHANGED
|
@@ -5,6 +5,10 @@ module.exports = (that, data) => {
|
|
|
5
5
|
// task 11: an interface whose process does not answer yet is retried; the
|
|
6
6
|
// nodes show "waiting" (yellow ring) for it instead of "disconnected"
|
|
7
7
|
const waiting = data.ifaceWaiting || {};
|
|
8
|
+
// B-44: an interface the connection cannot reach for a reason the user has to fix (the
|
|
9
|
+
// openccu-lite token lacks a scope) shows that reason instead of "disconnected"
|
|
10
|
+
const errors = data.ifaceError || {};
|
|
11
|
+
const error = (text) => ({fill: 'red', shape: 'ring', text});
|
|
8
12
|
if (!that.iface) {
|
|
9
13
|
if (data.ifaceStatus) {
|
|
10
14
|
let status = 0;
|
|
@@ -14,7 +18,11 @@ module.exports = (that, data) => {
|
|
|
14
18
|
}
|
|
15
19
|
});
|
|
16
20
|
if (status < 1) {
|
|
17
|
-
|
|
21
|
+
const failed = Object.keys(errors).find((s) => errors[s]);
|
|
22
|
+
if (failed) {
|
|
23
|
+
that.status(error(errors[failed]));
|
|
24
|
+
that.currentStatus = 'error';
|
|
25
|
+
} else if (Object.keys(waiting).some((s) => waiting[s])) {
|
|
18
26
|
that.status(WAITING);
|
|
19
27
|
that.currentStatus = 'waiting';
|
|
20
28
|
} else {
|
|
@@ -27,7 +35,12 @@ module.exports = (that, data) => {
|
|
|
27
35
|
that.currentStatus = 'green';
|
|
28
36
|
}
|
|
29
37
|
} else {
|
|
30
|
-
|
|
38
|
+
const failed = Object.keys(errors).find((s) => errors[s] && !data.ifaceStatus[s]);
|
|
39
|
+
that.status({
|
|
40
|
+
fill: 'yellow',
|
|
41
|
+
shape: 'dot',
|
|
42
|
+
text: failed ? 'partly connected: ' + errors[failed] : 'partly connected',
|
|
43
|
+
});
|
|
31
44
|
that.currentStatus = 'yellow';
|
|
32
45
|
}
|
|
33
46
|
} else {
|
|
@@ -39,6 +52,9 @@ module.exports = (that, data) => {
|
|
|
39
52
|
that.status({fill: 'green', shape: 'dot', text: 'connected'});
|
|
40
53
|
that.currentStatus = 'green';
|
|
41
54
|
}
|
|
55
|
+
} else if (errors[that.iface]) {
|
|
56
|
+
that.status(error(errors[that.iface]));
|
|
57
|
+
that.currentStatus = 'error';
|
|
42
58
|
} else if (waiting[that.iface]) {
|
|
43
59
|
that.status(WAITING);
|
|
44
60
|
that.currentStatus = 'waiting';
|
|
@@ -66,7 +66,7 @@ Weiteres unter <a target="_blank" href="https://nodered.org/docs/user-guide/cont
|
|
|
66
66
|
</ul>
|
|
67
67
|
<ul>
|
|
68
68
|
<li><b>openccu-lite Port</b>: Nur nötig, wenn der Webserver des Systems nicht auf Port 80 bzw. 443 (TLS) läuft.</li>
|
|
69
|
-
<li><b>openccu-lite Schnittstellen</b>: Wie die Schnittstellenprozesse auf einem openccu-lite-System erreicht werden. <i>auto</i> (Voreinstellung) geht dort über das <b>lite-rpc</b> des Systems - die Aufrufe über seinen Webport, die Ereignisse aus einem Stream, den dieser Node öffnet; ein Abonnent an den Prozessen für alle Programme auf dem System, die Ereignisse werden nach einer Unterbrechung nachgeliefert, kein eigener Callback-Server und kein eigenes <code>init</code> - und auf einer CCU, RaspberryMatic oder OpenCCU den CCU-Weg. Das Zugangsmerkmal ist das openccu-lite-Token oben, auf dem System selbst das eigene Token von RedMatic, das das System dafür erzeugt; ohne eines wird die direkte Verbindung benutzt, das Log sagt es. <i>CCU</i> behält auch auf openccu-lite die direkte Verbindung mit Rückrufen (CUxD geht immer so; lite-rpc trägt es nicht). Ein Flow aus einer Version vor 4.7.0 wird beim ersten Start auf openccu-lite einmal auf lite-rpc umgestellt - das Log sagt es - und eine hier getroffene Wahl ändert keine spätere Version mehr. Die Nodes sysvar, program, script und poll bleiben auf openccu-lite so oder so ohne Funktion.</li>
|
|
69
|
+
<li><b>openccu-lite Schnittstellen</b>: Wie die Schnittstellenprozesse auf einem openccu-lite-System erreicht werden. <i>auto</i> (Voreinstellung) geht dort über das <b>lite-rpc</b> des Systems - die Aufrufe über seinen Webport, die Ereignisse aus einem Stream, den dieser Node öffnet; ein Abonnent an den Prozessen für alle Programme auf dem System, die Ereignisse werden nach einer Unterbrechung nachgeliefert, kein eigener Callback-Server und kein eigenes <code>init</code> - und auf einer CCU, RaspberryMatic oder OpenCCU den CCU-Weg. Das Zugangsmerkmal ist das openccu-lite-Token oben, auf dem System selbst das eigene Token von RedMatic, das das System dafür erzeugt; ohne eines, oder mit einem Token ohne <code>rpc:read</code> (eines nur für die Namen), wird die direkte Verbindung benutzt, das Log sagt es; lite-rpc braucht <code>rpc:read</code> für die Ereignisse und <code>rpc:operate</code> für Befehle. <i>CCU</i> behält auch auf openccu-lite die direkte Verbindung mit Rückrufen (CUxD geht immer so; lite-rpc trägt es nicht). Ein Flow aus einer Version vor 4.7.0 wird beim ersten Start auf openccu-lite einmal auf lite-rpc umgestellt - das Log sagt es - und eine hier getroffene Wahl ändert keine spätere Version mehr. Die Nodes sysvar, program, script und poll bleiben auf openccu-lite so oder so ohne Funktion.</li>
|
|
70
70
|
</ul>
|
|
71
71
|
<ul>
|
|
72
72
|
<li><b>Device data / Re-read device data</b>: Liest die Geräteliste jeder verbundenen Schnittstelle neu ein.
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<li><b>Context Store</b>: The Node-RED context store the states of all devices and variables are kept in. See <a target="_blank" href="https://nodered.org/docs/user-guide/context">Working with context</a> in the Node-RED documentation.</li>
|
|
29
29
|
<li><b>openccu-lite token</b>: Only for <a href="https://github.com/hobbyquaker/openccu-lite" target="_blank">openccu-lite</a>, a CCU firmware without ReGaHSS. Names, rooms and functions come from the system's metadata API there, which needs a token made under <i>Users</i> on the system. When Node-RED runs on the system itself (RedMatic) the field stays empty: the local token is read automatically. The token is kept, like the password, in Node-RED's credentials (encrypted in <code>flows_cred.json</code>, never in the flow, never in an export). A CCU, RaspberryMatic or OpenCCU ignores the field. openccu-lite has no system variables, programs or HM-Script; those nodes stay in the flow and report an error per message.</li>
|
|
30
30
|
<li><b>openccu-lite port</b>: Only needed when the system's web server is not on port 80 (443 with TLS).</li>
|
|
31
|
-
<li><b>openccu-lite interfaces</b>: How the interface processes are reached on an openccu-lite system. <i>auto</i> (the default) goes through the system's <b>lite-rpc</b> there - the requests over its web port, the events from a stream this node opens, one subscriber at the processes for every program on the system, the events replayed after a break, no callback server and no <code>init</code> of its own - and the CCU way on a CCU, RaspberryMatic or OpenCCU. The credential is the openccu-lite token above, or on the system itself RedMatic's own token, which the system mints for it; without one the direct connection is used and the log says so. <i>CCU</i> keeps the direct connection with callbacks on openccu-lite as well (CUxD always goes that way; lite-rpc does not carry it). A flow from before 4.7.0 is moved to lite-rpc once at its first start on openccu-lite - the log says so - and a choice made here is never changed by a later version. The sysvar, program, script and poll nodes stay unavailable on openccu-lite either way.</li>
|
|
31
|
+
<li><b>openccu-lite interfaces</b>: How the interface processes are reached on an openccu-lite system. <i>auto</i> (the default) goes through the system's <b>lite-rpc</b> there - the requests over its web port, the events from a stream this node opens, one subscriber at the processes for every program on the system, the events replayed after a break, no callback server and no <code>init</code> of its own - and the CCU way on a CCU, RaspberryMatic or OpenCCU. The credential is the openccu-lite token above, or on the system itself RedMatic's own token, which the system mints for it; without one, or with a token that lacks <code>rpc:read</code> (one made for the names alone), the direct connection is used and the log says so; lite-rpc needs <code>rpc:read</code> for events and <code>rpc:operate</code> for commands. <i>CCU</i> keeps the direct connection with callbacks on openccu-lite as well (CUxD always goes that way; lite-rpc does not carry it). A flow from before 4.7.0 is moved to lite-rpc once at its first start on openccu-lite - the log says so - and a choice made here is never changed by a later version. The sysvar, program, script and poll nodes stay unavailable on openccu-lite either way.</li>
|
|
32
32
|
<li><b>Device data / Re-read device data</b>: Reads the device list of every connected interface again. New and changed devices (a channel whose type changed, say) get their datapoints fetched anew, removed ones leave the table. A device the CCU reports with a changed type or version is re-read without the button as well. The button needs a deployed connection.</li>
|
|
33
33
|
<li><b>Authentication</b>: Encryption and login for a CCU on the network (Node-RED not on the CCU). Both belong to the CCU's web server, which fronts the interface processes: on a CCU3 TLS and authentication are switched on in the firewall settings, on openccu-lite under <i>Remote access</i> (classic RPC). When Node-RED runs on the system itself (RedMatic; address <code>localhost</code> / <code>127.0.0.1</code>) the processes are reached directly on the loopback, BidCos over BIN-RPC, without TLS and without a login; these settings are then not used.
|
|
34
34
|
<ul>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-ccu",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.10.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "none",
|
|
6
6
|
"keywords": [
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"homematic-rega": "^2.0.1",
|
|
55
55
|
"homematic-xmlrpc": "^2.0.0",
|
|
56
56
|
"mqtt-wildcard": "^3.0.9",
|
|
57
|
-
"occulite-client": "^0.
|
|
57
|
+
"occulite-client": "^0.4.0"
|
|
58
58
|
},
|
|
59
59
|
"deprecated": false,
|
|
60
60
|
"description": "Node-RED Nodes for the Homematic CCU",
|