mqtt2matter 0.3.2 → 0.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.
- package/CHANGELOG.md +24 -0
- package/README.md +17 -0
- package/dist/engine/payload.d.ts +6 -3
- package/dist/engine/payload.js +8 -1
- package/dist/engine/payload.js.map +1 -1
- package/dist/engine/runtime.js +4 -0
- package/dist/engine/runtime.js.map +1 -1
- package/dist/engine/template.d.ts +1 -20
- package/dist/engine/template.js +4 -263
- package/dist/engine/template.js.map +1 -1
- package/dist/families/color.d.ts +3 -22
- package/dist/families/color.js +7 -144
- package/dist/families/color.js.map +1 -1
- package/dist/importers/ha/areas.d.ts +1 -6
- package/dist/importers/ha/areas.js +5 -278
- package/dist/importers/ha/areas.js.map +1 -1
- package/dist/importers/ha/source.d.ts +11 -9
- package/dist/importers/ha/source.js +22 -63
- package/dist/importers/ha/source.js.map +1 -1
- package/dist/importers/ha/templates.d.ts +3 -14
- package/dist/importers/ha/templates.js +7 -248
- package/dist/importers/ha/templates.js.map +1 -1
- package/dist/importers/ha/types.d.ts +2 -78
- package/dist/importers/ha/types.js +1 -472
- package/dist/importers/ha/types.js.map +1 -1
- package/dist/mqtt/client.d.ts +17 -3
- package/dist/mqtt/client.js +70 -13
- package/dist/mqtt/client.js.map +1 -1
- package/docs/config.md +1 -1
- package/docs/importers.md +2 -2
- package/package.json +2 -2
- package/ui/dist/licenses.json +1 -1
package/dist/mqtt/client.js
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
/* The MQTT connection: mqtt.js with reconnect, the subscriptions it re-establishes itself, a message
|
|
2
|
-
event with the raw payload, and the topic cache fed with everything that arrives.
|
|
2
|
+
event with the raw payload, and the topic cache fed with everything that arrives. A connection error never
|
|
3
|
+
ends the process: mqtt.js keeps reconnecting, and the errors are logged with a backoff so a broker that is
|
|
4
|
+
away for hours does not fill the log. */
|
|
3
5
|
import { EventEmitter } from 'node:events';
|
|
4
6
|
import mqtt, {} from 'mqtt';
|
|
5
7
|
import { TopicCache } from "./topic-cache.js";
|
|
8
|
+
/** the first connection error is logged at once, the next ones after 10 s, 20 s, 40 s … at most every 10 min */
|
|
9
|
+
export const ERROR_LOG_FIRST_DELAY_MS = 10_000;
|
|
10
|
+
export const ERROR_LOG_MAX_DELAY_MS = 600_000;
|
|
6
11
|
export class MqttClient extends EventEmitter {
|
|
7
12
|
cache = new TopicCache();
|
|
8
13
|
options;
|
|
9
14
|
log;
|
|
10
15
|
client;
|
|
11
16
|
subscriptions = new Set();
|
|
17
|
+
/** connection errors since the last one logged */
|
|
18
|
+
suppressedErrors = 0;
|
|
19
|
+
nextErrorLog = 0;
|
|
20
|
+
errorLogDelay = ERROR_LOG_FIRST_DELAY_MS;
|
|
21
|
+
wasConnected = false;
|
|
22
|
+
abortConnect;
|
|
12
23
|
constructor(options, log) {
|
|
13
24
|
super();
|
|
14
25
|
this.options = options;
|
|
@@ -17,7 +28,10 @@ export class MqttClient extends EventEmitter {
|
|
|
17
28
|
get connected() {
|
|
18
29
|
return this.client?.connected ?? false;
|
|
19
30
|
}
|
|
20
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Connect and resolve on the first CONNACK. Without `connectTimeout` it waits as long as the broker is away
|
|
33
|
+
* (mqtt.js retries every `reconnectPeriod`); with one it rejects after that time, naming the last error.
|
|
34
|
+
*/
|
|
21
35
|
async connect() {
|
|
22
36
|
if (this.client !== undefined) {
|
|
23
37
|
return;
|
|
@@ -35,36 +49,77 @@ export class MqttClient extends EventEmitter {
|
|
|
35
49
|
}
|
|
36
50
|
const client = mqtt.connect(this.options.url, clientOptions);
|
|
37
51
|
this.client = client;
|
|
52
|
+
let lastError;
|
|
38
53
|
client.on('connect', () => {
|
|
39
|
-
|
|
54
|
+
const errors = this.suppressedErrors;
|
|
55
|
+
this.resetErrorLog();
|
|
56
|
+
this.wasConnected = true;
|
|
57
|
+
this.log.info(`connected to ${this.options.url}${errors > 0 ? ` (${errors} more connection error(s) not logged)` : ''}`);
|
|
40
58
|
this.emit('connect');
|
|
41
59
|
});
|
|
42
60
|
client.on('close', () => {
|
|
43
|
-
|
|
61
|
+
// mqtt.js closes after every failed attempt too; only losing a connection is worth a line
|
|
62
|
+
if (this.wasConnected) {
|
|
63
|
+
this.wasConnected = false;
|
|
64
|
+
this.log.warn(`connection to ${this.options.url} closed, reconnecting`);
|
|
65
|
+
}
|
|
44
66
|
this.emit('close');
|
|
45
67
|
});
|
|
46
68
|
client.on('error', (error) => {
|
|
47
|
-
|
|
48
|
-
this.
|
|
69
|
+
lastError = error;
|
|
70
|
+
this.logError(error);
|
|
49
71
|
});
|
|
50
72
|
client.on('message', (topic, payload, packet) => {
|
|
51
73
|
this.cache.store(topic, payload, packet.retain);
|
|
52
74
|
this.emit('message', topic, payload, packet.retain);
|
|
53
75
|
});
|
|
54
76
|
await new Promise((resolve, reject) => {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
77
|
+
const timeoutMs = this.options.connectTimeout;
|
|
78
|
+
const timeout = timeoutMs === undefined
|
|
79
|
+
? undefined
|
|
80
|
+
: setTimeout(() => {
|
|
81
|
+
this.abortConnect = undefined;
|
|
82
|
+
reject(new Error(`no connection to ${this.options.url} within ${timeoutMs} ms` +
|
|
83
|
+
(lastError === undefined ? '' : `: ${lastError.message}`)));
|
|
84
|
+
}, timeoutMs);
|
|
85
|
+
this.abortConnect = (error) => {
|
|
86
|
+
clearTimeout(timeout);
|
|
87
|
+
reject(error);
|
|
88
|
+
};
|
|
89
|
+
const waiting = setTimeout(() => {
|
|
90
|
+
if (!client.connected) {
|
|
91
|
+
this.log.warn(`waiting for the broker at ${this.options.url}`);
|
|
92
|
+
}
|
|
93
|
+
}, 2000);
|
|
94
|
+
waiting.unref();
|
|
58
95
|
client.once('connect', () => {
|
|
59
96
|
clearTimeout(timeout);
|
|
97
|
+
clearTimeout(waiting);
|
|
98
|
+
this.abortConnect = undefined;
|
|
60
99
|
resolve();
|
|
61
100
|
});
|
|
62
|
-
client.once('error', (error) => {
|
|
63
|
-
clearTimeout(timeout);
|
|
64
|
-
reject(error);
|
|
65
|
-
});
|
|
66
101
|
});
|
|
67
102
|
}
|
|
103
|
+
/** log a connection error now, or count it until the backoff has passed */
|
|
104
|
+
logError(error) {
|
|
105
|
+
const now = Date.now();
|
|
106
|
+
if (now < this.nextErrorLog) {
|
|
107
|
+
this.suppressedErrors += 1;
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const more = this.suppressedErrors;
|
|
111
|
+
this.suppressedErrors = 0;
|
|
112
|
+
this.nextErrorLog = now + this.errorLogDelay;
|
|
113
|
+
this.log.error(`mqtt error: ${error.message}` +
|
|
114
|
+
(more > 0 ? ` (and ${more} more since the last one logged)` : '') +
|
|
115
|
+
`; retrying, the next error is logged in ${Math.round(this.errorLogDelay / 1000)} s at the earliest`);
|
|
116
|
+
this.errorLogDelay = Math.min(this.errorLogDelay * 2, ERROR_LOG_MAX_DELAY_MS);
|
|
117
|
+
}
|
|
118
|
+
resetErrorLog() {
|
|
119
|
+
this.suppressedErrors = 0;
|
|
120
|
+
this.nextErrorLog = 0;
|
|
121
|
+
this.errorLogDelay = ERROR_LOG_FIRST_DELAY_MS;
|
|
122
|
+
}
|
|
68
123
|
/** subscribe once; mqtt.js re-subscribes after a reconnect (clean session, so we keep the list ourselves too) */
|
|
69
124
|
async subscribe(topic) {
|
|
70
125
|
if (this.subscriptions.has(topic)) {
|
|
@@ -86,6 +141,8 @@ export class MqttClient extends EventEmitter {
|
|
|
86
141
|
async close() {
|
|
87
142
|
const client = this.client;
|
|
88
143
|
this.client = undefined;
|
|
144
|
+
this.abortConnect?.(new Error('closed before the broker was reached'));
|
|
145
|
+
this.abortConnect = undefined;
|
|
89
146
|
if (client !== undefined) {
|
|
90
147
|
await client.endAsync();
|
|
91
148
|
}
|
package/dist/mqtt/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["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AAS,CAAC;QACxB,IAAI,CAAC,YAAY,EAAE,CAAC,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC,CAAC;QACvE,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;QAC9B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACvB,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC5B,CAAC;IACL,CAAC;CACJ"}
|
package/docs/config.md
CHANGED
|
@@ -259,7 +259,7 @@ Without `format`, `payload` and `template` the payload is the value as text (an
|
|
|
259
259
|
|
|
260
260
|
### Templates
|
|
261
261
|
|
|
262
|
-
Jinja through `@huggingface/jinja`, Home Assistant style. Available: expressions, `if … else …`, loops, the
|
|
262
|
+
Jinja through `@huggingface/jinja`, Home Assistant style (the engine of mqtt-ha-entities). Available: expressions, `if … else …`, dictionaries with any keys (`{0: 'off', 1: 'on'}[value]`), loops, the
|
|
263
263
|
filters `int` (Home Assistant's `int(default, base)`: `'ff' | int(0, 16)`), `float`, `string`, `bool`, `lower`, `upper`, `trim`, `abs`, `default`, `length`, `join`,
|
|
264
264
|
`replace`, `tojson`, `round(precision, method, default)`, `is_defined`, `iif`, `multiply`, `is_number`, `max`,
|
|
265
265
|
`min`; the tests `defined`, `none`, `number`, `string`; the functions `iif`, `float`, `int`, `max`, `min`.
|
package/docs/importers.md
CHANGED
|
@@ -207,8 +207,8 @@ merged over every entity (each repeats it, often only with its identifiers).
|
|
|
207
207
|
|
|
208
208
|
**Templates** go to the payload engine when it can run them: the importer parses every `*_template` with the
|
|
209
209
|
same library and checks the filters, tests, functions and free names against what the engine provides
|
|
210
|
-
([config.md](config.md), "Templates";
|
|
211
|
-
`now()`, `this`, the time and regex helpers,
|
|
210
|
+
([config.md](config.md), "Templates"; the check is mqtt-ha-entities'). A template it cannot run — `states()`,
|
|
211
|
+
`now()`, `this`, the time and regex helpers, macros — leaves
|
|
212
212
|
that half of the mapping out and is listed under `unmapped` with the template text, so the user sees what to
|
|
213
213
|
write by hand. Where Home Assistant's command template sees a value the engine names differently, a `{% set …
|
|
214
214
|
%}` prelude gives it Home Assistant's meaning: `value` is `ON` / `OFF` (`payload_on` / `payload_off`) for a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mqtt2matter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Generic MQTT to Matter bridge: compose Matter devices by hand and map them onto MQTT topics with configurable payloads; importers for Zigbee2MQTT and Home Assistant MQTT discovery",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"deploy": "bash deploy.sh"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@huggingface/jinja": "0.5.10",
|
|
67
66
|
"@matter/main": "0.18.0",
|
|
68
67
|
"mqtt": "^5.16.1",
|
|
68
|
+
"mqtt-ha-entities": "^0.1.0",
|
|
69
69
|
"ws": "^8.22.0",
|
|
70
70
|
"zod": "^4.6.7"
|
|
71
71
|
},
|