iobroker.zigbee2mqtt 3.0.21 → 3.1.5
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/README.md +23 -0
- package/admin/jsonConfig.json +37 -0
- package/io-package.json +68 -68
- package/lib/check.js +24 -14
- package/lib/colors.js +9 -9
- package/lib/deviceController.js +244 -157
- package/lib/exposes.js +1362 -1315
- package/lib/imageController.js +98 -66
- package/lib/messages.js +29 -19
- package/lib/mqttServerController.js +120 -23
- package/lib/nonGenericDevicesExtension.js +2 -3
- package/lib/rgb.js +52 -63
- package/lib/states.js +150 -33
- package/lib/statesController.js +152 -72
- package/lib/utils.js +37 -97
- package/lib/websocketController.js +187 -50
- package/lib/z2mController.js +63 -42
- package/main.js +467 -201
- package/package.json +13 -12
package/README.md
CHANGED
|
@@ -22,6 +22,29 @@ This adapter allows to control the data points of the devices of a Zigbee2MQTT i
|
|
|
22
22
|
[Adapter Documentation](https://github.com/arteck/ioBroker.zigbee2mqtt/blob/main/docs/wiki.md)
|
|
23
23
|
|
|
24
24
|
## Changelog
|
|
25
|
+
### 3.1.5 (2026-04-23)
|
|
26
|
+
* (arteck) fix illuminance
|
|
27
|
+
|
|
28
|
+
### 3.1.4 (2026-04-23)
|
|
29
|
+
* (arteck) fix illuminance if not exists. we calculate it ourselves
|
|
30
|
+
|
|
31
|
+
### 3.1.3 (2026-04-23)
|
|
32
|
+
* (arteck) fix illuminance_raw
|
|
33
|
+
* (arteck) fix illuminance
|
|
34
|
+
* (arteck) fix action state
|
|
35
|
+
|
|
36
|
+
### 3.1.2 (2026-04-23)
|
|
37
|
+
* (arteck) add test
|
|
38
|
+
|
|
39
|
+
### 3.1.1 (2026-04-21)
|
|
40
|
+
* (arteck) fix connection handling
|
|
41
|
+
|
|
42
|
+
### 3.1.0 (2026-04-20)
|
|
43
|
+
* (arteck) refactoring
|
|
44
|
+
|
|
45
|
+
### 3.0.22 (2026-04-12)
|
|
46
|
+
* (arteck) Dependencies have been updated
|
|
47
|
+
|
|
25
48
|
### 3.0.21 (2026-01-29)
|
|
26
49
|
* (arteck) add coordinator status info
|
|
27
50
|
|
package/admin/jsonConfig.json
CHANGED
|
@@ -560,6 +560,43 @@
|
|
|
560
560
|
"lg": 12,
|
|
561
561
|
"xl": 12,
|
|
562
562
|
"newLine": true
|
|
563
|
+
},
|
|
564
|
+
"spacerDeleteStates": {
|
|
565
|
+
"type": "staticText",
|
|
566
|
+
"text": "",
|
|
567
|
+
"xs": 12,
|
|
568
|
+
"newLine": true
|
|
569
|
+
},
|
|
570
|
+
"headerDeleteStates": {
|
|
571
|
+
"type": "header",
|
|
572
|
+
"text": "coming soon ",
|
|
573
|
+
"size": 4,
|
|
574
|
+
"newLine": true
|
|
575
|
+
},
|
|
576
|
+
"buttonDeleteOldStates": {
|
|
577
|
+
"type": "sendTo",
|
|
578
|
+
"command": "deleteOldStates",
|
|
579
|
+
"label": "Delete old / unused states",
|
|
580
|
+
"variant": "contained",
|
|
581
|
+
"color": "secondary",
|
|
582
|
+
"icon": "delete",
|
|
583
|
+
"disabled": "1 === 1",
|
|
584
|
+
"xs": 12,
|
|
585
|
+
"sm": 6,
|
|
586
|
+
"md": 4,
|
|
587
|
+
"lg": 3,
|
|
588
|
+
"xl": 3,
|
|
589
|
+
"newLine": true
|
|
590
|
+
},
|
|
591
|
+
"_deleteOldStatesResult": {
|
|
592
|
+
"type": "staticText",
|
|
593
|
+
"text": "",
|
|
594
|
+
"xs": 12,
|
|
595
|
+
"newLine": false,
|
|
596
|
+
"style": {
|
|
597
|
+
"marginTop": 8,
|
|
598
|
+
"fontStyle": "italic"
|
|
599
|
+
}
|
|
563
600
|
}
|
|
564
601
|
}
|
|
565
602
|
}
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,73 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "zigbee2mqtt",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.1.5",
|
|
5
5
|
"news": {
|
|
6
|
+
"3.1.5": {
|
|
7
|
+
"en": "fix illuminance",
|
|
8
|
+
"de": "befestigungsleuchten",
|
|
9
|
+
"ru": "фиксировать освещенность",
|
|
10
|
+
"pt": "fixar a iluminação",
|
|
11
|
+
"nl": "fix verlichtingssterkte",
|
|
12
|
+
"fr": "fixer l'éclairage",
|
|
13
|
+
"it": "illuminazione di correzione",
|
|
14
|
+
"es": "iluminación de fijación",
|
|
15
|
+
"pl": "podświetlenie",
|
|
16
|
+
"uk": "фіксувати ілюмінанс",
|
|
17
|
+
"zh-cn": "修补灯光"
|
|
18
|
+
},
|
|
19
|
+
"3.1.4": {
|
|
20
|
+
"en": "fix illuminance if not exists. we calculate it ourselves",
|
|
21
|
+
"de": "fixe beleuchtungsstärke, wenn nicht vorhanden. wir berechnen es selbst",
|
|
22
|
+
"ru": "установить свет, если его нет. мы сами вычисляем",
|
|
23
|
+
"pt": "fixar a iluminação se não existir. nós mesmos calculamos",
|
|
24
|
+
"nl": "fix verlichtingssterkte indien niet bestaat. we berekenen het zelf",
|
|
25
|
+
"fr": "fixer l'éclairage s'il n'existe pas. nous le calculons nous-mêmes",
|
|
26
|
+
"it": "fissare l'illuminazione se non esiste. noi lo calcoliamo noi stessi",
|
|
27
|
+
"es": "fijar la iluminación si no existe. lo calculamos nosotros mismos",
|
|
28
|
+
"pl": "naprawić oświetlenie, jeśli nie istnieje. sami to obliczymy",
|
|
29
|
+
"uk": "зафіксувати ілюмінанс, якщо не існує. ми розраховуємо самі",
|
|
30
|
+
"zh-cn": "如果不存在的话, 则固定灯光。 我们自己计算"
|
|
31
|
+
},
|
|
32
|
+
"3.1.3": {
|
|
33
|
+
"en": "fix illuminance_raw \nfix illuminance\nfix action state",
|
|
34
|
+
"de": "fix illuminance raw\nbefestigungsleuchten\nfixer aktionszustand",
|
|
35
|
+
"ru": "осветительный прибор raw\nфиксировать освещенность\nопределить состояние",
|
|
36
|
+
"pt": "corrigir illuminance raw\nfixar a iluminação\ncorrigir o estado da ação",
|
|
37
|
+
"nl": "fix illuminantie raw\nfix verlichtingssterkte\nfix actiestatus",
|
|
38
|
+
"fr": "correction de l'éclairage raw\nfixer l'éclairage\nfixer l'état d'action",
|
|
39
|
+
"it": "correzione illuminazione raw\nilluminazione di correzione\nfix azione stato",
|
|
40
|
+
"es": "iluminación raw\niluminación de fijación\nestado de acción",
|
|
41
|
+
"pl": "fix lightinance _ raw\npodświetlenie\nstan działania",
|
|
42
|
+
"uk": "фіксація талії raw\nфіксувати ілюмінанс\nфіксувати стан дії",
|
|
43
|
+
"zh-cn": "修补灯光 raw\n修补灯光\n固定动作状态"
|
|
44
|
+
},
|
|
45
|
+
"3.1.2": {
|
|
46
|
+
"en": "add test",
|
|
47
|
+
"de": "test hinzufügen",
|
|
48
|
+
"ru": "добавить тест",
|
|
49
|
+
"pt": "adicionar teste",
|
|
50
|
+
"nl": "test toevoegen",
|
|
51
|
+
"fr": "ajouter un essai",
|
|
52
|
+
"it": "aggiungere test",
|
|
53
|
+
"es": "agregar la prueba",
|
|
54
|
+
"pl": "dodać test",
|
|
55
|
+
"uk": "додати тест",
|
|
56
|
+
"zh-cn": "添加测试"
|
|
57
|
+
},
|
|
58
|
+
"3.1.1": {
|
|
59
|
+
"en": "fix connection handling",
|
|
60
|
+
"de": "befestigungstechnik",
|
|
61
|
+
"ru": "фиксировать связь",
|
|
62
|
+
"pt": "corrigir o tratamento da ligação",
|
|
63
|
+
"nl": "fix verbinding handling",
|
|
64
|
+
"fr": "fixer la manipulation de la connexion",
|
|
65
|
+
"it": "gestione del collegamento",
|
|
66
|
+
"es": "corrección de conexión",
|
|
67
|
+
"pl": "naprawić obsługę połączenia",
|
|
68
|
+
"uk": "кріплення з'єднання",
|
|
69
|
+
"zh-cn": "固定连接处理"
|
|
70
|
+
},
|
|
6
71
|
"3.0.21": {
|
|
7
72
|
"en": "add coordinator status info",
|
|
8
73
|
"de": "koordinator statusinfo hinzufügen",
|
|
@@ -28,71 +93,6 @@
|
|
|
28
93
|
"pl": "sprawdzanie ładunku użytecznego, jeżeli nie określono",
|
|
29
94
|
"uk": "перевірити навантаження, якщо не визначено",
|
|
30
95
|
"zh-cn": "检查未定义的有效载荷"
|
|
31
|
-
},
|
|
32
|
-
"3.0.19": {
|
|
33
|
-
"en": "modify action dp",
|
|
34
|
-
"de": "änderung der aktion dp",
|
|
35
|
-
"ru": "модифицировать действие dp",
|
|
36
|
-
"pt": "modificar ação dp",
|
|
37
|
-
"nl": "actie dp wijzigen",
|
|
38
|
-
"fr": "modifier l'action dp",
|
|
39
|
-
"it": "modificare l'azione",
|
|
40
|
-
"es": "modificar la acción dp",
|
|
41
|
-
"pl": "modyfikacja działania dp",
|
|
42
|
-
"uk": "змінити дію dp",
|
|
43
|
-
"zh-cn": "修改动作 dp"
|
|
44
|
-
},
|
|
45
|
-
"3.0.18": {
|
|
46
|
-
"en": "typo",
|
|
47
|
-
"de": "typo",
|
|
48
|
-
"ru": "опечатка",
|
|
49
|
-
"pt": "erro de digitação",
|
|
50
|
-
"nl": "type",
|
|
51
|
-
"fr": "typo",
|
|
52
|
-
"it": "tipo",
|
|
53
|
-
"es": "typo",
|
|
54
|
-
"pl": "typo",
|
|
55
|
-
"uk": "типи",
|
|
56
|
-
"zh-cn": "类型"
|
|
57
|
-
},
|
|
58
|
-
"3.0.17": {
|
|
59
|
-
"en": "typo",
|
|
60
|
-
"de": "typo",
|
|
61
|
-
"ru": "опечатка",
|
|
62
|
-
"pt": "erro de digitação",
|
|
63
|
-
"nl": "type",
|
|
64
|
-
"fr": "typo",
|
|
65
|
-
"it": "tipo",
|
|
66
|
-
"es": "typo",
|
|
67
|
-
"pl": "typo",
|
|
68
|
-
"uk": "типи",
|
|
69
|
-
"zh-cn": "类型"
|
|
70
|
-
},
|
|
71
|
-
"3.0.16": {
|
|
72
|
-
"en": "fix action dp",
|
|
73
|
-
"de": "funktion dp",
|
|
74
|
-
"ru": "исправить действие dp",
|
|
75
|
-
"pt": "corrigir ação dp",
|
|
76
|
-
"nl": "fix actie dp",
|
|
77
|
-
"fr": "corriger l'action dp",
|
|
78
|
-
"it": "fix azione dp",
|
|
79
|
-
"es": "arreglar acción dp",
|
|
80
|
-
"pl": "fix action dp",
|
|
81
|
-
"uk": "фіксувати дію dp",
|
|
82
|
-
"zh-cn": "固定动作 dp"
|
|
83
|
-
},
|
|
84
|
-
"3.0.15": {
|
|
85
|
-
"en": "update",
|
|
86
|
-
"de": "aktualisierung",
|
|
87
|
-
"ru": "обновление",
|
|
88
|
-
"pt": "atualizar",
|
|
89
|
-
"nl": "bijwerken",
|
|
90
|
-
"fr": "mise à jour",
|
|
91
|
-
"it": "aggiornamento",
|
|
92
|
-
"es": "actualización",
|
|
93
|
-
"pl": "aktualizacja",
|
|
94
|
-
"uk": "оновлення",
|
|
95
|
-
"zh-cn": "更新"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"messages": [
|
|
@@ -220,12 +220,12 @@
|
|
|
220
220
|
},
|
|
221
221
|
"dependencies": [
|
|
222
222
|
{
|
|
223
|
-
"js-controller": ">=
|
|
223
|
+
"js-controller": ">= 6.0.11"
|
|
224
224
|
}
|
|
225
225
|
],
|
|
226
226
|
"globalDependencies": [
|
|
227
227
|
{
|
|
228
|
-
"admin": ">=7.
|
|
228
|
+
"admin": ">=7.6.20"
|
|
229
229
|
}
|
|
230
230
|
]
|
|
231
231
|
},
|
package/lib/check.js
CHANGED
|
@@ -1,32 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Prüft die Zigbee2MQTT-Konfiguration auf veraltete/inkompatible Einstellungen
|
|
3
|
+
* und gibt Fehlermeldungen mit Korrekturhinweisen aus.
|
|
2
4
|
*
|
|
3
|
-
* @param config
|
|
4
|
-
* @param log
|
|
5
|
-
* @param version
|
|
5
|
+
* @param {object} config Der config-Block aus dem bridge/info-Payload
|
|
6
|
+
* @param {object} log Das ioBroker-Log-Objekt (this.log)
|
|
7
|
+
* @param {string} version Die Zigbee2MQTT-Versionsnummer (z.B. "1.35.0")
|
|
6
8
|
*/
|
|
7
9
|
function checkConfig(config, log, version) {
|
|
10
|
+
if (!config || !log) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const advanced = config.advanced || {};
|
|
15
|
+
const deviceOptions = config.device_options || {};
|
|
16
|
+
|
|
8
17
|
const checkAPIOptions = {
|
|
9
|
-
legacy_api_enabled:
|
|
10
|
-
legacy_availability_payload_enabled:
|
|
11
|
-
device_legacy_enabled:
|
|
18
|
+
legacy_api_enabled: advanced.legacy_api !== false,
|
|
19
|
+
legacy_availability_payload_enabled: advanced.legacy_availability_payload !== false,
|
|
20
|
+
device_legacy_enabled: deviceOptions.legacy !== false,
|
|
12
21
|
};
|
|
13
22
|
|
|
14
23
|
const checkAPIOptionsOutput = {
|
|
15
|
-
payload_contains_not_json:
|
|
24
|
+
payload_contains_not_json: advanced.output !== 'attribute_and_json' && advanced.output !== 'json',
|
|
16
25
|
};
|
|
17
26
|
|
|
18
|
-
|
|
19
|
-
|
|
27
|
+
// Fix: version kann undefined/null sein (ältere Z2M-Versionen)
|
|
28
|
+
if (version && version.startsWith('1.')) {
|
|
29
|
+
if (Object.values(checkAPIOptions).filter((x) => x === true).length > 0) {
|
|
20
30
|
log.error('===================================================');
|
|
21
31
|
log.error('===================================================');
|
|
22
|
-
if (checkAPIOptions.legacy_api_enabled
|
|
32
|
+
if (checkAPIOptions.legacy_api_enabled === true) {
|
|
23
33
|
log.error('Legacy api is activated, so the adapter can not work correctly!!!');
|
|
24
34
|
log.error('Please add the following lines to your Zigbee2MQTT configuration.yaml:');
|
|
25
35
|
log.error('advanced:');
|
|
26
36
|
log.error(' legacy_api: false');
|
|
27
37
|
log.error('');
|
|
28
38
|
}
|
|
29
|
-
if (checkAPIOptions.legacy_availability_payload_enabled
|
|
39
|
+
if (checkAPIOptions.legacy_availability_payload_enabled === true) {
|
|
30
40
|
log.error(
|
|
31
41
|
'Legacy Availability Payload is activated, thus the adapter cannot represent the availability of the devices!!!'
|
|
32
42
|
);
|
|
@@ -35,7 +45,7 @@ function checkConfig(config, log, version) {
|
|
|
35
45
|
log.error('legacy_availability_payload: false');
|
|
36
46
|
log.error('');
|
|
37
47
|
}
|
|
38
|
-
if (checkAPIOptions.device_legacy_enabled
|
|
48
|
+
if (checkAPIOptions.device_legacy_enabled === true) {
|
|
39
49
|
log.error(
|
|
40
50
|
'Device Legacy Payload is activated, therefore the adapter may process the states of the devices correctly!!!'
|
|
41
51
|
);
|
|
@@ -46,8 +56,8 @@ function checkConfig(config, log, version) {
|
|
|
46
56
|
log.error('===================================================');
|
|
47
57
|
}
|
|
48
58
|
}
|
|
49
|
-
if (Object.values(checkAPIOptionsOutput).filter((x) => x
|
|
50
|
-
if (
|
|
59
|
+
if (Object.values(checkAPIOptionsOutput).filter((x) => x === true).length > 0) {
|
|
60
|
+
if (checkAPIOptionsOutput.payload_contains_not_json === true) {
|
|
51
61
|
log.error('===================================================');
|
|
52
62
|
log.error(
|
|
53
63
|
'MQTT output type must "attribute_and_json" or "json" , therefore the adapter may process the states of the devices correctly!!!'
|
package/lib/colors.js
CHANGED
|
@@ -431,8 +431,8 @@ const namedColors = {
|
|
|
431
431
|
function NamedColorToRGBstring(name) {
|
|
432
432
|
const lowerName = name.toLowerCase();
|
|
433
433
|
if (namedColors.hasOwnProperty(lowerName)) {
|
|
434
|
-
return namedColors[lowerName].rgb;
|
|
435
|
-
}
|
|
434
|
+
return namedColors[lowerName].rgb;
|
|
435
|
+
}
|
|
436
436
|
return '#0088FF';
|
|
437
437
|
}
|
|
438
438
|
|
|
@@ -444,13 +444,13 @@ function ParseColor(rgbstring) {
|
|
|
444
444
|
if (typeof rgbstring === 'string') {
|
|
445
445
|
const lowerName = rgbstring.toLowerCase();
|
|
446
446
|
if (namedColors.hasOwnProperty(lowerName)) {
|
|
447
|
-
rgbstring = namedColors[lowerName].rgb;
|
|
448
|
-
}
|
|
447
|
+
rgbstring = namedColors[lowerName].rgb;
|
|
448
|
+
}
|
|
449
449
|
rgbstring = rgbstring.trim();
|
|
450
450
|
if (rgbstring.startsWith('#')) {
|
|
451
|
-
rgbstring = rgbstring.slice(1);
|
|
452
|
-
}
|
|
453
|
-
const val = parseInt(`0x${
|
|
451
|
+
rgbstring = rgbstring.slice(1);
|
|
452
|
+
}
|
|
453
|
+
const val = parseInt(`0x${rgbstring}`);
|
|
454
454
|
const oneColor = {};
|
|
455
455
|
oneColor.r = Math.floor(val / (256 * 256));
|
|
456
456
|
oneColor.g = Math.floor((val % (256 * 256)) / 256);
|
|
@@ -466,8 +466,8 @@ rgbstring = rgbstring.slice(1);
|
|
|
466
466
|
*/
|
|
467
467
|
function NamedColorToRGB(name) {
|
|
468
468
|
if (namedColors.hasOwnProperty(name)) {
|
|
469
|
-
return ParseColor(namedColors[name].rgb);
|
|
470
|
-
}
|
|
469
|
+
return ParseColor(namedColors[name].rgb);
|
|
470
|
+
}
|
|
471
471
|
return { r: 0, g: 128, b: 255 };
|
|
472
472
|
}
|
|
473
473
|
module.exports = {
|