optolink-bridge 1.3.0 → 1.4.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 +4 -0
- package/config.toml +1 -1
- package/index.js +11 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file documents all *major & minor* releases. For revisions, please consult the [commit history](https://github.com/kristian/optolink-bridge/commits/main).
|
|
4
4
|
|
|
5
|
+
## [1.4] 2026-06-14
|
|
6
|
+
|
|
7
|
+
Upgrade to Node.js 24 and bump dependencies.
|
|
8
|
+
|
|
5
9
|
## [1.3] - 2026-04-12
|
|
6
10
|
|
|
7
11
|
Introduce a `max_buffer_chunks` option to prevent stalled streams from filling up the memory with too many buffered chunks, and expose the vito + opto serial ports and bridges on the event emitter for debugging purposes.
|
package/config.toml
CHANGED
|
@@ -3,7 +3,7 @@ port_vito = "/dev/ttyS0"
|
|
|
3
3
|
# serial port of the Optolink adapter / device, defaults to "/dev/ttyUSB0"
|
|
4
4
|
port_opto = "/dev/ttyUSB0"
|
|
5
5
|
|
|
6
|
-
# log level, one of "none", "error", "warn", "info", "
|
|
6
|
+
# log level, one of "none", "error", "warn", "info", "debug" or "trace" defaults to "warn"
|
|
7
7
|
# note: this setting may be changed during runtime and is picked up from this file automatically
|
|
8
8
|
log_level = "warn"
|
|
9
9
|
|
package/index.js
CHANGED
|
@@ -85,6 +85,10 @@ async function applyConfig(config) {
|
|
|
85
85
|
const device = config.mqtt?.device_discovery?.overrides?.device;
|
|
86
86
|
deviceSerialNo = device?.serial_number || device?.identifiers || deviceSerialNo;
|
|
87
87
|
Array.isArray(deviceSerialNo) && (deviceSerialNo = deviceSerialNo[0]);
|
|
88
|
+
|
|
89
|
+
if (deviceSerialNo) {
|
|
90
|
+
logger.warn('No device serial number set in the config.toml, device discovery will be deferred until Vitoconnect sends it')
|
|
91
|
+
}
|
|
88
92
|
}
|
|
89
93
|
|
|
90
94
|
deviceDiscoveryOptions = config.mqtt?.device_discovery;
|
|
@@ -105,7 +109,10 @@ let mqttClient, mqttTopic, mqttAvailabilityTopic, mqttDpTopic = dp => {
|
|
|
105
109
|
};
|
|
106
110
|
|
|
107
111
|
deviceDiscovery = async function(options = (deviceDiscoveryOptions ?? { enabled: true })) {
|
|
108
|
-
if (!mqttClient?.connected || !deviceSerialNo
|
|
112
|
+
if (!mqttClient?.connected || !deviceSerialNo) {
|
|
113
|
+
return;
|
|
114
|
+
} else if (!(options?.enabled ?? true)) {
|
|
115
|
+
logger.warn('Device discovery is disabled in the config.toml');
|
|
109
116
|
return;
|
|
110
117
|
}
|
|
111
118
|
|
|
@@ -156,7 +163,9 @@ if (config.mqtt && config.mqtt.url) {
|
|
|
156
163
|
};
|
|
157
164
|
|
|
158
165
|
// connect to MQTT broker
|
|
166
|
+
logger.info('Connecting to MQTT broker and waiting for connection...');
|
|
159
167
|
mqttClient = await mqttConnect(config.mqtt.url, mqttOptions);
|
|
168
|
+
logger.info('MQTT connected, proceeding with publishing online topic / device discovery');
|
|
160
169
|
const mqttConnected = async () => {
|
|
161
170
|
config.mqtt.online && await mqttClient.publishAsync(
|
|
162
171
|
mqttAvailabilityTopic, `${true}`, { retain: true });
|
|
@@ -216,6 +225,7 @@ const packetQueue = async.queue(async task => {
|
|
|
216
225
|
// we wait for the serial number to be sent by Vitoconnect (0xF010) and then publish the discovery message
|
|
217
226
|
if (!deviceSerialNo && packet.addr === 0xF010 && (config.mqtt?.device_discovery?.enabled ?? true)) {
|
|
218
227
|
deviceSerialNo = parseValue('string', packet.data)?.trim?.();
|
|
228
|
+
logger.info(`Device serial number received from Vitoconnect: ${deviceSerialNo}`);
|
|
219
229
|
await deviceDiscovery();
|
|
220
230
|
}
|
|
221
231
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "optolink-bridge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Safely bridge the Optolink bus of your Viessmann heating system and publish attributes via MQTT + Home Assistant Device Discovery",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"viessmann",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"start": "node ./index.js"
|
|
33
33
|
},
|
|
34
34
|
"engines": {
|
|
35
|
-
"node": ">=
|
|
35
|
+
"node": ">=24"
|
|
36
36
|
},
|
|
37
37
|
"author": {
|
|
38
38
|
"name": "Kristian Kraljic",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"buffer-to-str": "^1.0.0",
|
|
55
55
|
"change-case": "^5.4.4",
|
|
56
56
|
"chokidar": "^5.0.0",
|
|
57
|
-
"mqtt": "^5.15.
|
|
57
|
+
"mqtt": "^5.15.2",
|
|
58
58
|
"serialport": "^13.0.0",
|
|
59
|
-
"smol-toml": "^1.
|
|
59
|
+
"smol-toml": "^1.8.0",
|
|
60
60
|
"yocto-queue": "^1.2.2"
|
|
61
61
|
},
|
|
62
62
|
"packageManager": "yarn@4.12.0"
|