matterbridge-zigbee2mqtt 3.0.2-dev-20251201-a287727 → 3.0.2-dev-20251201-f681e77

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 CHANGED
@@ -12,6 +12,8 @@ If you like this project and find it useful, please consider giving it a star on
12
12
 
13
13
  - [scenes]: Added await for creation.
14
14
  - [mqtt]: Added config for a fixed clientId. If not provided, a random clientId will be generated. (https://github.com/Luligu/matterbridge-zigbee2mqtt/issues/138)
15
+ - [mqtt]: Added Unix socket: use unix://<SOCKET_PATH> for Unix socket (e.g. unix:///var/run/mqtt.sock). (https://github.com/Luligu/matterbridge-zigbee2mqtt/issues/133)
16
+ - [zigbee2mqtt]: Added frontend package detection. With the new windfront, link or bookmarks to the specific device page are not possible. (https://github.com/Luligu/matterbridge-zigbee2mqtt/issues/136)
15
17
 
16
18
  ### Changed
17
19
 
package/dist/module.js CHANGED
@@ -48,7 +48,8 @@ export class ZigbeePlatform extends MatterbridgeDynamicPlatform {
48
48
  this.shouldConfigure = false;
49
49
  if (config.host && typeof config.host === 'string') {
50
50
  this.mqttHost = config.host;
51
- this.mqttHost = !this.mqttHost.startsWith('mqtt://') && !this.mqttHost.startsWith('mqtts://') ? 'mqtt://' + this.mqttHost : this.mqttHost;
51
+ this.mqttHost =
52
+ !this.mqttHost.startsWith('mqtt://') && !this.mqttHost.startsWith('mqtts://') && !this.mqttHost.startsWith('unix://') ? 'mqtt://' + this.mqttHost : this.mqttHost;
52
53
  }
53
54
  if (config.port)
54
55
  this.mqttPort = config.port;
@@ -139,6 +140,8 @@ export class ZigbeePlatform extends MatterbridgeDynamicPlatform {
139
140
  this.log.info(`zigbee2MQTT advanced.legacy_api is ${this.z2mBridgeInfo.config.advanced.legacy_api}`);
140
141
  if (this.z2mBridgeInfo.config.advanced.legacy_availability_payload === true)
141
142
  this.log.info(`zigbee2MQTT advanced.legacy_availability_payload is ${this.z2mBridgeInfo.config.advanced.legacy_availability_payload}`);
143
+ if (this.z2mBridgeInfo.config.frontend?.package)
144
+ this.log.info(`zigbee2MQTT frontend.package is ${this.z2mBridgeInfo.config.frontend?.package}`);
142
145
  });
143
146
  this.z2m.on('bridge-devices', async (devices) => {
144
147
  if (devices === null || devices === undefined)
@@ -442,7 +445,7 @@ export class ZigbeePlatform extends MatterbridgeDynamicPlatform {
442
445
  try {
443
446
  matterDevice = await ZigbeeDevice.create(this, device);
444
447
  if (matterDevice.bridgedDevice) {
445
- matterDevice.bridgedDevice.configUrl = `${this.config.zigbeeFrontend}/#/device/${device.ieee_address}/info`;
448
+ matterDevice.bridgedDevice.configUrl = `${this.config.zigbeeFrontend}/#/device/${this.z2mBridgeInfo?.config.frontend?.package === 'zigbee2mqtt-frontend' ? '' : '0/'}${device.ieee_address}/info`;
446
449
  await this.registerDevice(matterDevice.bridgedDevice);
447
450
  this.bridgedDevices.push(matterDevice.bridgedDevice);
448
451
  this.zigbeeEntities.push(matterDevice);
@@ -466,7 +469,7 @@ export class ZigbeePlatform extends MatterbridgeDynamicPlatform {
466
469
  try {
467
470
  matterGroup = await ZigbeeGroup.create(this, group);
468
471
  if (matterGroup.bridgedDevice) {
469
- matterGroup.bridgedDevice.configUrl = `${this.config.zigbeeFrontend}/#/group/${group.id}`;
472
+ matterGroup.bridgedDevice.configUrl = `${this.config.zigbeeFrontend}/#/group/${this.z2mBridgeInfo?.config.frontend?.package === 'zigbee2mqtt-frontend' ? '' : '0/'}${group.id}`;
470
473
  await this.registerDevice(matterGroup.bridgedDevice);
471
474
  this.bridgedDevices.push(matterGroup.bridgedDevice);
472
475
  this.zigbeeEntities.push(matterGroup);
@@ -99,6 +99,18 @@ export class Zigbee2MQTT extends EventEmitter {
99
99
  this.log.warn('You are using mqtt:// protocol, but you provided a key. It will be ignored.');
100
100
  }
101
101
  }
102
+ else if (mqttHost.startsWith('unix://')) {
103
+ this.log.debug('Using unix:// protocol for MQTT connection over Unix socket');
104
+ if (ca) {
105
+ this.log.warn('You are using unix:// protocol, but you provided a CA certificate. It will be ignored.');
106
+ }
107
+ if (cert) {
108
+ this.log.warn('You are using unix:// protocol, but you provided a certificate. It will be ignored.');
109
+ }
110
+ if (key) {
111
+ this.log.warn('You are using unix:// protocol, but you provided a key. It will be ignored.');
112
+ }
113
+ }
102
114
  else {
103
115
  this.log.warn('You are using an unsupported MQTT protocol. Please use mqtt:// or mqtts://.');
104
116
  }
@@ -149,7 +161,7 @@ export class Zigbee2MQTT extends EventEmitter {
149
161
  }
150
162
  }
151
163
  getUrl() {
152
- return this.mqttHost + ':' + this.mqttPort.toString();
164
+ return this.mqttHost.startsWith('unix://') ? this.mqttHost : this.mqttHost + ':' + this.mqttPort.toString();
153
165
  }
154
166
  async start() {
155
167
  this.log.debug(`Starting connection to ${this.getUrl()}...`);
@@ -17,7 +17,7 @@
17
17
  "ui:widget": "hidden"
18
18
  },
19
19
  "host": {
20
- "description": "MQTT server host (IP address or hostname with mqtt:// or mqtts:// prefix). For secure connections, use the mqtts:// prefix and ensure your certificates are configured. If you use a hostname, make sure that the hostname is resolvable by the system running matterbridge.",
20
+ "description": "MQTT server host (IP address or hostname with mqtt:// or mqtts:// prefix) or unix://<SOCKET_PATH> for Unix socket (e.g. unix:///var/run/mqtt.sock). For secure connections, use the mqtts:// prefix and ensure your certificates are configured. If you use a hostname, make sure that the hostname is resolvable by the system running matterbridge.",
21
21
  "type": "string",
22
22
  "default": "mqtt://localhost"
23
23
  },
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
- "version": "3.0.2-dev-20251201-a287727",
3
+ "version": "3.0.2-dev-20251201-f681e77",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge-zigbee2mqtt",
9
- "version": "3.0.2-dev-20251201-a287727",
9
+ "version": "3.0.2-dev-20251201-f681e77",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "moment": "2.30.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
- "version": "3.0.2-dev-20251201-a287727",
3
+ "version": "3.0.2-dev-20251201-f681e77",
4
4
  "description": "Matterbridge zigbee2mqtt plugin",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",