iobroker.zigbee2mqtt 2.4.5 → 2.6.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/LICENSE +1 -1
- package/README.md +16 -2
- package/admin/i18n/de/translations.json +2 -1
- package/admin/i18n/en/translations.json +2 -1
- package/admin/i18n/es/translations.json +2 -1
- package/admin/i18n/fr/translations.json +2 -1
- package/admin/i18n/it/translations.json +2 -1
- package/admin/i18n/nl/translations.json +2 -1
- package/admin/i18n/pl/translations.json +2 -1
- package/admin/i18n/pt/translations.json +2 -1
- package/admin/i18n/ru/translations.json +2 -1
- package/admin/i18n/uk/translations.json +2 -1
- package/admin/i18n/zh-cn/translations.json +2 -1
- package/admin/jsonConfig.json +5 -0
- package/io-package.json +29 -28
- package/lib/deviceController.js +83 -23
- package/lib/exposes.js +50 -18
- package/lib/states.js +18 -11
- package/lib/statesController.js +27 -47
- package/lib/websocketController.js +4 -0
- package/lib/z2mController.js +36 -5
- package/main.js +2 -0
- package/package.json +6 -6
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2023 Dennis Rathjen <dennis.rathjen@outlook.de>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -32,9 +32,23 @@ This adapter allows to control the data points of the devices of a Zigbee2MQTT i
|
|
|
32
32
|
Placeholder for the next version (at the beginning of the line):
|
|
33
33
|
### **WORK IN PROGRESS**
|
|
34
34
|
-->
|
|
35
|
+
### 2.6.0 (2023-01-10)
|
|
36
|
+
|
|
37
|
+
- (o0shojo0o) added state `transition` for transition overwrite (-1 disabled overwrite) ([#101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101))
|
|
38
|
+
- (o0shojo0o) consideration of the description when creating the friendly name ([#105](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/105))
|
|
39
|
+
- (o0shojo0o) added state `effect` for groups ([#101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101))
|
|
40
|
+
- (o0shojo0o) fix state contact
|
|
41
|
+
- (o0shojo0o) added handling for disabled devices
|
|
42
|
+
|
|
43
|
+
### 2.5.0 (2023-01-02)
|
|
44
|
+
|
|
45
|
+
- (o0shojo0o) added option `Brightness step should also turn the light on or off`
|
|
46
|
+
- (o0shojo0o) added handling of `brightness_step` ([#96](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/96))
|
|
47
|
+
- (o0shojo0o) states processing more flexible designed ([#94](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/94))
|
|
48
|
+
|
|
35
49
|
### 2.4.5 (2022-12-20)
|
|
36
50
|
|
|
37
|
-
- (o0shojo0o) extend
|
|
51
|
+
- (o0shojo0o) extend `text` for `action` ([#84](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/84))
|
|
38
52
|
|
|
39
53
|
### 2.4.4 (2022-12-06)
|
|
40
54
|
|
|
@@ -135,7 +149,7 @@ This adapter allows to control the data points of the devices of a Zigbee2MQTT i
|
|
|
135
149
|
|
|
136
150
|
MIT License
|
|
137
151
|
|
|
138
|
-
Copyright (c)
|
|
152
|
+
Copyright (c) 2023 Dennis Rathjen <dennis.rathjen@outlook.de>
|
|
139
153
|
|
|
140
154
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
141
155
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -21,5 +21,6 @@
|
|
|
21
21
|
"Use Kelvin instead of mired for the color temps": "Kelvin anstelle von Mired für die Farbtemperaturen verwenden",
|
|
22
22
|
"Other configurations": "Andere Konfigurationen",
|
|
23
23
|
"Proxy Zigbee2MQTT logs to ioBroker logs": "Proxy Zigbee2MQTT Protokolle zu ioBroker Protokollen",
|
|
24
|
-
"Brightness move should also turn the light on or off": "Brightness move soll auch das Licht ein- oder ausschalten"
|
|
24
|
+
"Brightness move should also turn the light on or off": "Brightness move soll auch das Licht ein- oder ausschalten",
|
|
25
|
+
"Brightness step should also turn the light on or off": "Brightness step soll auch das Licht ein- oder ausschalten"
|
|
25
26
|
}
|
|
@@ -21,5 +21,6 @@
|
|
|
21
21
|
"Use Kelvin instead of mired for the color temps": "Use Kelvin instead of mired for the color temps",
|
|
22
22
|
"Other configurations": "Other configurations",
|
|
23
23
|
"Proxy Zigbee2MQTT logs to ioBroker logs": "Proxy Zigbee2MQTT logs to ioBroker logs",
|
|
24
|
-
"Brightness move should also turn the light on or off": "Brightness move should also turn the light on or off"
|
|
24
|
+
"Brightness move should also turn the light on or off": "Brightness move should also turn the light on or off",
|
|
25
|
+
"Brightness step should also turn the light on or off": "Brightness step should also turn the light on or off"
|
|
25
26
|
}
|
|
@@ -21,5 +21,6 @@
|
|
|
21
21
|
"Use Kelvin instead of mired for the color temps": "Use Kelvin en lugar de mired para las temperaturas de color",
|
|
22
22
|
"Other configurations": "Otras configuraciones",
|
|
23
23
|
"Proxy Zigbee2MQTT logs to ioBroker logs": "Proxy de registros Zigbee2MQTT a registros de ioBroker",
|
|
24
|
-
"Brightness move should also turn the light on or off": "El movimiento de brillo también debe encender o apagar la luz"
|
|
24
|
+
"Brightness move should also turn the light on or off": "El movimiento de brillo también debe encender o apagar la luz",
|
|
25
|
+
"Brightness step should also turn the light on or off": "El paso de brillo también debe encender o apagar la luz"
|
|
25
26
|
}
|
|
@@ -21,5 +21,6 @@
|
|
|
21
21
|
"Use Kelvin instead of mired for the color temps": "Utilisez Kelvin au lieu de embourbé pour les températures de couleur",
|
|
22
22
|
"Other configurations": "Autres configurations",
|
|
23
23
|
"Proxy Zigbee2MQTT logs to ioBroker logs": "Proxy Zigbee2MQTT se connecte aux journaux ioBroker",
|
|
24
|
-
"Brightness move should also turn the light on or off": "Le mouvement de luminosité devrait également allumer ou éteindre la lumière"
|
|
24
|
+
"Brightness move should also turn the light on or off": "Le mouvement de luminosité devrait également allumer ou éteindre la lumière",
|
|
25
|
+
"Brightness step should also turn the light on or off": "L'étape de luminosité devrait également allumer ou éteindre la lumière"
|
|
25
26
|
}
|
|
@@ -21,5 +21,6 @@
|
|
|
21
21
|
"Use Kelvin instead of mired for the color temps": "Usa Kelvin invece di mired per le temperature di colore",
|
|
22
22
|
"Other configurations": "Altre configurazioni",
|
|
23
23
|
"Proxy Zigbee2MQTT logs to ioBroker logs": "Proxy Zigbee2MQTT registra nei registri di ioBroker",
|
|
24
|
-
"Brightness move should also turn the light on or off": "Il movimento della luminosità dovrebbe anche accendere o spegnere la luce"
|
|
24
|
+
"Brightness move should also turn the light on or off": "Il movimento della luminosità dovrebbe anche accendere o spegnere la luce",
|
|
25
|
+
"Brightness step should also turn the light on or off": "Il passo di luminosità dovrebbe anche accendere o spegnere la luce"
|
|
25
26
|
}
|
|
@@ -21,5 +21,6 @@
|
|
|
21
21
|
"Use Kelvin instead of mired for the color temps": "Gebruik Kelvin in plaats van mired voor de kleurtemperaturen",
|
|
22
22
|
"Other configurations": "Andere configuraties",
|
|
23
23
|
"Proxy Zigbee2MQTT logs to ioBroker logs": "Proxy Zigbee2MQTT logt in op ioBroker logs",
|
|
24
|
-
"Brightness move should also turn the light on or off": "Helderheidsbeweging moet ook het licht aan- of uitzetten"
|
|
24
|
+
"Brightness move should also turn the light on or off": "Helderheidsbeweging moet ook het licht aan- of uitzetten",
|
|
25
|
+
"Brightness step should also turn the light on or off": "De helderheidsstap moet het licht ook in- of uitschakelen"
|
|
25
26
|
}
|
|
@@ -21,5 +21,6 @@
|
|
|
21
21
|
"Use Kelvin instead of mired for the color temps": "Użyj Kelvina zamiast mired dla temperatury kolorów",
|
|
22
22
|
"Other configurations": "Inne konfiguracje",
|
|
23
23
|
"Proxy Zigbee2MQTT logs to ioBroker logs": "Proxy Zigbee2MQTT loguje do logów ioBroker",
|
|
24
|
-
"Brightness move should also turn the light on or off": "Ruch jasności powinien również włączać lub wyłączać światło"
|
|
24
|
+
"Brightness move should also turn the light on or off": "Ruch jasności powinien również włączać lub wyłączać światło",
|
|
25
|
+
"Brightness step should also turn the light on or off": "Krok jasności powinien również włączać lub wyłączać światło"
|
|
25
26
|
}
|
|
@@ -21,5 +21,6 @@
|
|
|
21
21
|
"Use Kelvin instead of mired for the color temps": "Use Kelvin em vez de atolado para as temperaturas de cor",
|
|
22
22
|
"Other configurations": "Outras configurações",
|
|
23
23
|
"Proxy Zigbee2MQTT logs to ioBroker logs": "Proxy Zigbee2MQTT logs para logs ioBroker",
|
|
24
|
-
"Brightness move should also turn the light on or off": "O movimento de brilho também deve ligar ou desligar a luz"
|
|
24
|
+
"Brightness move should also turn the light on or off": "O movimento de brilho também deve ligar ou desligar a luz",
|
|
25
|
+
"Brightness step should also turn the light on or off": "A etapa de brilho também deve ligar ou desligar a luz"
|
|
25
26
|
}
|
|
@@ -21,5 +21,6 @@
|
|
|
21
21
|
"Use Kelvin instead of mired for the color temps": "Используйте шкалу Кельвина вместо майреда для цветовой температуры.",
|
|
22
22
|
"Other configurations": "Другие конфигурации",
|
|
23
23
|
"Proxy Zigbee2MQTT logs to ioBroker logs": "Проксировать журналы Zigbee2MQTT в журналы ioBroker",
|
|
24
|
-
"Brightness move should also turn the light on or off": "Изменение яркости также должно включать или выключать свет."
|
|
24
|
+
"Brightness move should also turn the light on or off": "Изменение яркости также должно включать или выключать свет.",
|
|
25
|
+
"Brightness step should also turn the light on or off": "Шаг яркости также должен включать или выключать свет."
|
|
25
26
|
}
|
|
@@ -21,5 +21,6 @@
|
|
|
21
21
|
"Use Kelvin instead of mired for the color temps": "Використовуйте для колірних температур замість Кельвіна",
|
|
22
22
|
"Other configurations": "Інші конфігурації",
|
|
23
23
|
"Proxy Zigbee2MQTT logs to ioBroker logs": "Журнали проксі Zigbee2MQTT до журналів ioBroker",
|
|
24
|
-
"Brightness move should also turn the light on or off": "Переміщення яскравості також повинно вмикати або вимикати світло"
|
|
24
|
+
"Brightness move should also turn the light on or off": "Переміщення яскравості також повинно вмикати або вимикати світло",
|
|
25
|
+
"Brightness step should also turn the light on or off": "Крок яскравості також повинен вмикати або вимикати світло"
|
|
25
26
|
}
|
|
@@ -21,5 +21,6 @@
|
|
|
21
21
|
"Use Kelvin instead of mired for the color temps": "使用 Kelvin 而不是 mired 作为色温",
|
|
22
22
|
"Other configurations": "其他配置",
|
|
23
23
|
"Proxy Zigbee2MQTT logs to ioBroker logs": "代理 Zigbee2MQTT 日志到 ioBroker 日志",
|
|
24
|
-
"Brightness move should also turn the light on or off": "亮度移动也应该打开或关闭灯"
|
|
24
|
+
"Brightness move should also turn the light on or off": "亮度移动也应该打开或关闭灯",
|
|
25
|
+
"Brightness step should also turn the light on or off": "亮度步骤也应该打开或关闭灯"
|
|
25
26
|
}
|
package/admin/jsonConfig.json
CHANGED
|
@@ -149,6 +149,11 @@
|
|
|
149
149
|
"label": "Brightness move should also turn the light on or off",
|
|
150
150
|
"newLine": true
|
|
151
151
|
},
|
|
152
|
+
"brightnessStepOnOff": {
|
|
153
|
+
"type": "checkbox",
|
|
154
|
+
"label": "Brightness step should also turn the light on or off",
|
|
155
|
+
"newLine": true
|
|
156
|
+
},
|
|
152
157
|
"proxyZ2MLogs": {
|
|
153
158
|
"type": "checkbox",
|
|
154
159
|
"label": "Proxy Zigbee2MQTT logs to ioBroker logs",
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "zigbee2mqtt",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.6.0",
|
|
5
5
|
"news": {
|
|
6
|
+
"2.6.0": {
|
|
7
|
+
"en": "added state `transition` for transition overwrite (-1 disabled overwrite) ([#101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101))\nconsideration of the description when creating the friendly name ([#105](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/105))\nadded state `effect` for groups ([#101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101))\nfix state contact\nadded handling for disabled devices",
|
|
8
|
+
"de": "hinzugefügter Zustandsübergang für Übergangsüberschreiben -(1 behinderte Überschreiben) #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nberücksichtigung der Beschreibung bei der Erstellung des freundlichen Namens #[105](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/105)\nzusätzliche staatliche Wirkung für Gruppen #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/101)\nkontakt mit dem status\nzusätzliches handling für behinderte",
|
|
9
|
+
"ru": "добавлен государственный переход для перехода переписать -(1 отключен перезапись) #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nрассмотрение описания при создании дружественного имени #[105](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/105)\nдобавлен государственный эффект для групп #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nисправить государственный контакт\nдобавлена обработка для инвалидов",
|
|
10
|
+
"pt": "adicionado transição de estado para a transição sobreescrita -(1 sobreescrita desativada) #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nconsideração da descrição ao criar o nome amigável #[105](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/105)\nadicionado efeito estatal para grupos #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\ncorrigir contato estado\nmanuseio adicionado para dispositivos com deficiência",
|
|
11
|
+
"nl": "voegde staatsoverschrijving toe voor overschrijving overschrijving - (1 gehandicapte overschrijving) (1) (1 gehandicapte overschrijving)\noverweeg de beschrijving als het creëren van de vriendelijke naam £10:\nvoegde toegevoegd staats effect voor groepen £101, httub.com/oshojoo/ioBroker\nvertaling:\nvoegde toegevoegd voor gehandicapte apparaten",
|
|
12
|
+
"fr": "transition de l ' État pour la surécriture de transition -(1 surécriture désactivée) #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/101)\nexamen de la description lors de la création du nom amical #[105](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/105)\neffet d ' État ajouté pour les groupes #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/101)\ncontact étatique\nmanipulation supplémentaire pour les dispositifs handicapés",
|
|
13
|
+
"it": "aggiunto passaggio di stato per overwrite di transizione -(1 overwrite disabilitato) #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/101)\nconsiderazione della descrizione quando si crea il nome amichevole #[105](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/105)\neffetto stato aggiunto per gruppi #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/101)\nfix contatto stato\nmanipolazione aggiuntiva per dispositivi disabili",
|
|
14
|
+
"es": "añadida transición estatal para la sobreescritura de transición -(1 invalidez sobreescritura) #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nexamen de la descripción al crear el nombre amistoso #[105](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/105)\nañadido efecto estatal para los grupos #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\narreglar contacto estado\nmanejo añadido para dispositivos discapacitados",
|
|
15
|
+
"pl": "dodano przejście stanowe na przepisanie -(1 disabled overwrite) #101(https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nrezultatem tego opisu było stworzenie przyjaznej nazwy #105 (https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/105)\ndodano efekt stanowy dla grup #101 (https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nkontakt państwowy\nobsługa urządzeń dla osób niepełnosprawnych",
|
|
16
|
+
"uk": "додано державний перехід для переходу перезапису -(1 вимкнено перезапис) #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nрозгляд опису при створенні дружньої назви #[105](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/products/105)\nдодано державний ефект для груп #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nфіксувати державний контакт\nдодана обробка для пристроїв відключення",
|
|
17
|
+
"zh-cn": "此外,国家向过渡过渡的过渡——《残疾》第[101]号(http://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/101)\n在建立友好名称编号(http://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/105)时,审议说明\n第[101]号(http://github.com/oshojo0o/ioBroker.zigbee2mqt/issues/101)\nfix 国家联络点\nd. 增加处理残疾装置"
|
|
18
|
+
},
|
|
19
|
+
"2.5.0": {
|
|
20
|
+
"en": "added option `Brightness step should also turn the light on or off`\nadded handling of `brightness_step` ([#96](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/96))\nstates processing more flexible designed ([#94](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/94))",
|
|
21
|
+
"de": "zusätzliche Option `Brightness Schritt sollte auch das Licht ein- oder ausschalten `\nzusätzliches Handling der Helligkeit_step #[96](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/96)\nzustände, die flexibler gestaltet sind #[94](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/94)",
|
|
22
|
+
"ru": "добавленная опция `Яркость шаг должен также повернуть свет на или вне`\nдобавлена обработка brightness_step #[96](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/96)\nсостояния обработки более гибкий дизайн #[94](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/94)",
|
|
23
|
+
"pt": "opção adicionada `A etapa de justiça também deve ligar ou desligar a luz`\nmanuseio adicionado de gloss_step #[96](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/96)\nestados processando mais flexível projetado #[94](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/94)",
|
|
24
|
+
"nl": "voegde optie 'Brightness step' ook het licht aan of uit'\nvoegde toegevoegd om te gaan met helderheid stegen cijfer 96\nhet verwerkt meer flexibele ontworpen 94: github.com/oshojoo/ioBroker",
|
|
25
|
+
"fr": "option ajoutée `Brightness step should also turn the light on or off`\ngestion de la luminosité_step #[96](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/96)\ndéclare que le traitement est plus souple, conçu #[94](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/94)",
|
|
26
|
+
"it": "opzione aggiunta `Brightness passo dovrebbe anche accendere o spegnere la luce `\n[96](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/96)\n(https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/94)",
|
|
27
|
+
"es": "opción agregada `El paso de la rectitud también debe encender o apagar la luz &apos\nadicional handling of brightness_step #[96](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/96)\nestados procesan más flexiblemente diseñados #[94](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/94)",
|
|
28
|
+
"pl": "dodał również krok opcji 'Brightness'\ndodano obsługę jasności (stop #96) (https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/96)\nprzetwarzają bardziej elastyczne przetwory #94 (https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/94)",
|
|
29
|
+
"uk": "доданий варіант `Бритальність кроку також повинен перетворювати світло або вимкнути`\nдодано обробка яскравості_кроку #[96](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/96)\n[94] (https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/94)",
|
|
30
|
+
"zh-cn": "增加“权利步骤”的选择,也应该改变“或”的提法。\n增加光明处理:第[96]号(http://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/96)\n国家处理较为灵活的第[94]号(http://github.com/oshojo0o/ioBroker.zigbee2mqt/issues/94)"
|
|
31
|
+
},
|
|
6
32
|
"2.4.5": {
|
|
7
33
|
"en": "extend 'text' for 'action' ([#84](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/84))",
|
|
8
34
|
"de": "text für die Aktion #[84](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/84)",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "recenzent oparty na przeglądzie (https:/github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1316656363636378)",
|
|
68
94
|
"uk": "javaScript licenses API Веб-сайт Go1.13.8",
|
|
69
95
|
"zh-cn": "fix 基于[审查](http://github.com/ioBroker/ioBroker.reories/pull/1976#issuement-1316656378)"
|
|
70
|
-
},
|
|
71
|
-
"2.4.0": {
|
|
72
|
-
"en": "fix for devices with multiple endpoints ([#57](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/57)).\nadded option `Brightness move should also turn the light on or off`\nadded state toggle for groups \nmore dynamic during data point creation ([#48](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/48)).",
|
|
73
|
-
"de": "fix für Geräte mit mehreren Endpunkten [#57](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/57).\nzusätzliche Option `Brightness move sollte auch das Licht ein- oder ausschalten `\nzusatzzustandswinkel für gruppen\nmehr Dynamik bei der Erstellung von Datenpunkten [#48](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/48).",
|
|
74
|
-
"ru": "исправить для устройств с несколькими точками [#57](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/57).\nдобавленная опция `Перемещение яркости должно также повернуть свет на или вне`\nдобавлена государственная очка для групп\nболее динамично во время создания данных [#48](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/48).",
|
|
75
|
-
"pt": "correção para dispositivos com múltiplos endpoints [#57](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/57).\nopção adicionada `Brightness move também deve ligar ou desligar a luz`\nadicionado conjunto de estado para grupos\nmais dinâmico durante a criação do ponto de dados [#48](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/48).",
|
|
76
|
-
"nl": "vertaling:.\nvoegde optie 'Brightness zet ook het licht aan of uit'\nvertaling:\ndynamischer tijdens datapunt 48: github.com/oshojoo/ioBroker.",
|
|
77
|
-
"fr": "correction des dispositifs comportant plusieurs paramètres [#57](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/57).\noption ajoutée `Brightness move should also turn the light on or off`\nla lutte de l'état pour les groupes\nplus dynamique lors de la création de points de données [#48](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/48).",
|
|
78
|
-
"it": "fix per dispositivi con più endpoint [#57](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/57).\nopzione aggiunta `Brightness movimento dovrebbe anche accendere o spegnere la luce `\ntoggle di stato aggiunto per gruppi\npiù dinamica durante la creazione di data point [#48](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/48).",
|
|
79
|
-
"es": "fix for devices with multiple endpoints [#57](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/57).\nopción agregada `El movimiento de la rectitud también debe encender o apagar la luz &apos\nañadido a la lucha estatal para grupos\nmás dinámica durante la creación de puntos de datos [#48](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/48).",
|
|
80
|
-
"pl": "urządzenia z wieloma punktami końcowymi (#57(https:/github.com/o0shojo0/ioBroker.zigbee2mqtt/issues/57).\ndodano również możliwość wykonania ruchu `Brightness'\ndodać stan dla grup\ndynamiczny w czasie tworzenia danych (#48)(https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/48).",
|
|
81
|
-
"uk": "виправлення для пристроїв з декількома кінцевими точками [#57](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/57).\nдоданий варіант `Брайтний рух також повинен перетворювати світло або вимкнути`\nдодано державний контроль за групами\nбільш динамічний при створенні точки даних [#48](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/48).",
|
|
82
|
-
"zh-cn": "fix 有多个最终用户的装置[第57号](http://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/57).\n增加“权利流动”的选择,也应该改变“或”以外的照明。\n加入集团的州\n在数据点创建期间,增加活力[第48](http://github.com/oshojo0o/ioBroker.zigbee2mqt/issues/48)."
|
|
83
|
-
},
|
|
84
|
-
"2.3.0": {
|
|
85
|
-
"en": "added support for the `toggle` of states that support this.\nadded correct handling of `color_move` and `color_temperature_move`",
|
|
86
|
-
"de": "zusätzliche unterstützung für den kippen von staaten, die dies unterstützen.\nkorrekte handhabung von color_move und color_temperature_move",
|
|
87
|
-
"ru": "добавлена поддержка в отношении государств, которые поддерживают это.\nдобавлена правильная обработка color_move и color_temperature_move",
|
|
88
|
-
"pt": "acrescentou apoio para o conjunto de estados que apoiam isso.\nadicionado manuseio correto de color_move e color_temperature_move",
|
|
89
|
-
"nl": "steun toegevoegd voor de toggle van staten die dit ondersteunen.\nvoegde de juiste kleding en kleurtemperatuur toe",
|
|
90
|
-
"fr": "a ajouté un soutien pour la lutte des etats qui appuient cela.\nla manipulation correcte de color_move et color_temperature_move",
|
|
91
|
-
"it": "ha aggiunto il sostegno per la lotta di stati che sostengono questo.\naggiunto corretto trattamento di colore_move e colore_temperature_move",
|
|
92
|
-
"es": "agregó apoyo para la lucha de estados que apoyan esto.\nañadido correcto manejo de color_move y color_temperature_move",
|
|
93
|
-
"pl": "dodał wsparcie dla porozumień stanów, które to wspierają.\ndodano poprawne zachowanie koloru i kolor_temperature_move",
|
|
94
|
-
"uk": "додана підтримка для тягових станів, які підтримують це.\nдодано правильну обробку кольором_move та color_ infrastructure_move",
|
|
95
|
-
"zh-cn": "此外,还支持支持这一国家。.\n· 删除白色、流血和色色色色色彩。"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
|
@@ -196,7 +196,8 @@
|
|
|
196
196
|
"proxyZ2MLogs": true,
|
|
197
197
|
"useKelvin": false,
|
|
198
198
|
"colorTempSyncColor": false,
|
|
199
|
-
"brightnessMoveOnOff": false
|
|
199
|
+
"brightnessMoveOnOff": false,
|
|
200
|
+
"brightnessStepOnOff": false
|
|
200
201
|
},
|
|
201
202
|
"objects": [],
|
|
202
203
|
"instanceObjects": [
|
package/lib/deviceController.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const states = require('./states').states;
|
|
2
|
-
const
|
|
2
|
+
const createDeviceFromExposes = require('./exposes').createDeviceFromExposes;
|
|
3
3
|
const utils = require('./utils');
|
|
4
4
|
const colors = require('./colors.js');
|
|
5
5
|
const rgb = require('./rgb.js');
|
|
@@ -15,42 +15,56 @@ class DeviceController {
|
|
|
15
15
|
this.createCache = createCache;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
async createDeviceDefinitions(
|
|
18
|
+
async createDeviceDefinitions(devicesMessage) {
|
|
19
19
|
utils.clearArray(this.deviceCache);
|
|
20
|
-
for (const
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
scenes = scenes.concat(expose.endpoints[key].scenes);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if (this.logCustomizations.debugDevices.includes(expose.ieee_address)) {
|
|
30
|
-
this.adapter.log.warn(`--->>> fromZ2M -> ${expose.ieee_address} exposes: ${JSON.stringify(expose)}`);
|
|
31
|
-
}
|
|
20
|
+
for (const devicesMessag of devicesMessage) {
|
|
21
|
+
if (this.logCustomizations.debugDevices.includes(devicesMessag.ieee_address)) {
|
|
22
|
+
this.adapter.log.warn(`--->>> fromZ2M -> ${devicesMessag.ieee_address} exposes: ${JSON.stringify(devicesMessag)}`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (devicesMessag.definition != null) {
|
|
32
26
|
// if the device is already present in the cache, remove it
|
|
33
|
-
this.removeDeviceByIeee(this.deviceCache,
|
|
34
|
-
|
|
27
|
+
this.removeDeviceByIeee(this.deviceCache, devicesMessag.ieee_address);
|
|
28
|
+
|
|
29
|
+
if (devicesMessag.definition.exposes) {
|
|
30
|
+
const newDevice = createDeviceFromExposes(devicesMessag, this.config);
|
|
31
|
+
this.deviceCache.push(newDevice);
|
|
32
|
+
}
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
|
|
40
38
|
async defineGroupDevice(groupID, ieee_address, scenes) {
|
|
41
|
-
const
|
|
39
|
+
const brmPropName = this.adapter.config.brightnessMoveOnOff == true ? 'brightness_move_onoff' : 'brightness_move';
|
|
40
|
+
const brsPropName = this.adapter.config.brightnessStepOnOff == true ? 'brightness_step_onoff' : 'brightness_step';
|
|
42
41
|
const newDevice = {
|
|
43
42
|
id: groupID,
|
|
44
43
|
ieee_address: ieee_address,
|
|
45
44
|
icon: undefined,
|
|
45
|
+
optionsValues: {},
|
|
46
46
|
states: [
|
|
47
|
-
states.state,
|
|
48
47
|
states.brightness,
|
|
49
48
|
states.colortemp_move,
|
|
49
|
+
states.transition,
|
|
50
|
+
{
|
|
51
|
+
id: 'state',
|
|
52
|
+
prob: 'state',
|
|
53
|
+
name: 'Switch state',
|
|
54
|
+
options: ['transition'],
|
|
55
|
+
icon: undefined,
|
|
56
|
+
role: 'switch',
|
|
57
|
+
write: true,
|
|
58
|
+
read: true,
|
|
59
|
+
type: 'boolean',
|
|
60
|
+
def: false,
|
|
61
|
+
getter: payload => (payload.state === 'ON'),
|
|
62
|
+
setter: (value) => (value) ? 'ON' : 'OFF',
|
|
63
|
+
},
|
|
50
64
|
{
|
|
51
65
|
id: 'brightness_move',
|
|
52
|
-
prop:
|
|
53
|
-
name: '
|
|
66
|
+
prop: brmPropName,
|
|
67
|
+
name: 'Increases or decreases the brightness by X units per second',
|
|
54
68
|
icon: undefined,
|
|
55
69
|
role: 'state',
|
|
56
70
|
write: true,
|
|
@@ -60,10 +74,24 @@ class DeviceController {
|
|
|
60
74
|
max: 50,
|
|
61
75
|
def: 0
|
|
62
76
|
},
|
|
77
|
+
{
|
|
78
|
+
id: 'brightness_step',
|
|
79
|
+
prop: brsPropName,
|
|
80
|
+
name: 'Increases or decreases brightness by X steps',
|
|
81
|
+
icon: undefined,
|
|
82
|
+
role: 'state',
|
|
83
|
+
write: true,
|
|
84
|
+
read: false,
|
|
85
|
+
type: 'number',
|
|
86
|
+
min: -255,
|
|
87
|
+
max: 255,
|
|
88
|
+
def: 0
|
|
89
|
+
},
|
|
63
90
|
{
|
|
64
91
|
id: 'color',
|
|
65
92
|
prop: 'color',
|
|
66
93
|
name: 'Color',
|
|
94
|
+
options: ['transition'],
|
|
67
95
|
icon: undefined,
|
|
68
96
|
role: 'level.color.rgb',
|
|
69
97
|
write: true,
|
|
@@ -95,6 +123,7 @@ class DeviceController {
|
|
|
95
123
|
id: 'colortemp',
|
|
96
124
|
prop: 'color_temp',
|
|
97
125
|
name: 'Color temperature',
|
|
126
|
+
options: ['transition'],
|
|
98
127
|
icon: undefined,
|
|
99
128
|
role: 'level.color.temperature',
|
|
100
129
|
write: true,
|
|
@@ -121,6 +150,7 @@ class DeviceController {
|
|
|
121
150
|
{
|
|
122
151
|
id: 'state_toggle',
|
|
123
152
|
name: 'Toggle the state',
|
|
153
|
+
options: ['transition'],
|
|
124
154
|
icon: undefined,
|
|
125
155
|
role: 'button',
|
|
126
156
|
write: true,
|
|
@@ -129,7 +159,19 @@ class DeviceController {
|
|
|
129
159
|
setattr: 'state',
|
|
130
160
|
def: true,
|
|
131
161
|
setter: (value) => (value) ? 'TOGGLE' : undefined
|
|
132
|
-
}
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: 'effect',
|
|
165
|
+
name: 'Triggers an effect on the light (e.g. make light blink for a few seconds)',
|
|
166
|
+
prop: 'effect',
|
|
167
|
+
icon: undefined,
|
|
168
|
+
role: 'state',
|
|
169
|
+
write: true,
|
|
170
|
+
read: true,
|
|
171
|
+
type: 'string',
|
|
172
|
+
def: '',
|
|
173
|
+
states: { blink: 'blink', breathe: 'breathe', okay: 'okay', channel_change: 'channel_change', finish_effect: 'finish_effect', stop_effect: 'stop_effect' }
|
|
174
|
+
},
|
|
133
175
|
],
|
|
134
176
|
};
|
|
135
177
|
|
|
@@ -165,7 +207,17 @@ class DeviceController {
|
|
|
165
207
|
|
|
166
208
|
async createOrUpdateDevices() {
|
|
167
209
|
for (const device of this.groupCache.concat(this.deviceCache)) {
|
|
168
|
-
|
|
210
|
+
let deviceName = device.id == device.ieee_address ? '' : device.id;
|
|
211
|
+
|
|
212
|
+
if (deviceName == '' && device.description) {
|
|
213
|
+
deviceName = device.description;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Manipulate deviceName if the device is disabled, so the update of the device is triggered as well
|
|
217
|
+
if (device.disabled && device.disabled == true) {
|
|
218
|
+
deviceName = `[Disabled] ${deviceName}`;
|
|
219
|
+
}
|
|
220
|
+
|
|
169
221
|
if (!this.createCache[device.ieee_address] || this.createCache[device.ieee_address].name != deviceName) {
|
|
170
222
|
const deviceObj = {
|
|
171
223
|
type: 'device',
|
|
@@ -176,11 +228,17 @@ class DeviceController {
|
|
|
176
228
|
native: {}
|
|
177
229
|
};
|
|
178
230
|
|
|
179
|
-
if
|
|
231
|
+
// Only the onlineId is set if the device is not disabled and is not a group
|
|
232
|
+
if (!device.ieee_address.includes('group_') && (!device.disabled || device.disabled == false)) {
|
|
180
233
|
deviceObj.common.statusStates = {
|
|
181
234
|
onlineId: `${this.adapter.name}.${this.adapter.instance}.${device.ieee_address}.available`
|
|
182
235
|
};
|
|
183
236
|
}
|
|
237
|
+
else {
|
|
238
|
+
deviceObj.common.statusStates = {
|
|
239
|
+
onlineId: ''
|
|
240
|
+
};
|
|
241
|
+
}
|
|
184
242
|
|
|
185
243
|
//@ts-ignore
|
|
186
244
|
await this.adapter.extendObjectAsync(device.ieee_address, deviceObj);
|
|
@@ -251,6 +309,7 @@ class DeviceController {
|
|
|
251
309
|
async copyAndCleanStateObj(state) {
|
|
252
310
|
const iobState = { ...state };
|
|
253
311
|
const blacklistedKeys = [
|
|
312
|
+
'prop',
|
|
254
313
|
'setter',
|
|
255
314
|
'setterOpt',
|
|
256
315
|
'getter',
|
|
@@ -260,6 +319,7 @@ class DeviceController {
|
|
|
260
319
|
'isOption',
|
|
261
320
|
'inOptions',
|
|
262
321
|
'isEvent',
|
|
322
|
+
'options',
|
|
263
323
|
];
|
|
264
324
|
for (const blacklistedKey of blacklistedKeys) {
|
|
265
325
|
delete iobState[blacklistedKey];
|
package/lib/exposes.js
CHANGED
|
@@ -164,8 +164,16 @@ function genState(expose, role, name, desc) {
|
|
|
164
164
|
return state;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
function
|
|
167
|
+
function createDeviceFromExposes(devicesMessag, config) {
|
|
168
168
|
const states = [];
|
|
169
|
+
let scenes = [];
|
|
170
|
+
const deviceID = devicesMessag.friendly_name;
|
|
171
|
+
const ieee_address = devicesMessag.ieee_address;
|
|
172
|
+
const definition = devicesMessag.definition;
|
|
173
|
+
const power_source = devicesMessag.power_source;
|
|
174
|
+
const disabled = devicesMessag.disabled && devicesMessag.disabled == true;
|
|
175
|
+
const description = devicesMessag.description ? devicesMessag.description : undefined;
|
|
176
|
+
|
|
169
177
|
function pushToStates(state, access) {
|
|
170
178
|
if (state === undefined) {
|
|
171
179
|
return 0;
|
|
@@ -278,7 +286,14 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
|
|
|
278
286
|
}
|
|
279
287
|
}
|
|
280
288
|
|
|
281
|
-
for
|
|
289
|
+
// search for scenes in the endpoints and build them into an array
|
|
290
|
+
for (const key in devicesMessag.endpoints) {
|
|
291
|
+
if (devicesMessag.endpoints[key].scenes) {
|
|
292
|
+
scenes = scenes.concat(devicesMessag.endpoints[key].scenes);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
for (const expose of definition.exposes) {
|
|
282
297
|
let state;
|
|
283
298
|
|
|
284
299
|
switch (expose.type) {
|
|
@@ -290,6 +305,7 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
|
|
|
290
305
|
pushToStates({
|
|
291
306
|
id: stateName,
|
|
292
307
|
name: `Switch state ${expose.endpoint ? expose.endpoint : ''}`.trim(),
|
|
308
|
+
options: ['transition'],
|
|
293
309
|
icon: undefined,
|
|
294
310
|
role: 'switch',
|
|
295
311
|
write: true,
|
|
@@ -306,6 +322,7 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
|
|
|
306
322
|
id: `${stateName}_toggle`,
|
|
307
323
|
prop: `${stateName}_toggle`,
|
|
308
324
|
name: `Toggle state of the ${stateName}`,
|
|
325
|
+
options: ['transition'],
|
|
309
326
|
icon: undefined,
|
|
310
327
|
role: 'button',
|
|
311
328
|
write: true,
|
|
@@ -323,6 +340,7 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
|
|
|
323
340
|
pushToStates({
|
|
324
341
|
id: stateName,
|
|
325
342
|
name: `Brightness ${expose.endpoint ? expose.endpoint : ''}`.trim(),
|
|
343
|
+
options: ['transition'],
|
|
326
344
|
icon: undefined,
|
|
327
345
|
role: 'level.dimmer',
|
|
328
346
|
write: true,
|
|
@@ -331,7 +349,6 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
|
|
|
331
349
|
min: 0, // ignore expose.value_min
|
|
332
350
|
max: 100, // ignore expose.value_max
|
|
333
351
|
def: 100,
|
|
334
|
-
inOptions: true,
|
|
335
352
|
unit: '%',
|
|
336
353
|
getter: (value) => {
|
|
337
354
|
return utils.bulbLevelToAdapterLevel(value[stateName]);
|
|
@@ -341,11 +358,11 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
|
|
|
341
358
|
},
|
|
342
359
|
}, prop.access);
|
|
343
360
|
// brightnessMoveOnOff
|
|
344
|
-
const
|
|
361
|
+
const brmPropName = config.brightnessMoveOnOff == true ? `${stateName}_move_onoff` : `${stateName}_move`;
|
|
345
362
|
pushToStates({
|
|
346
363
|
id: `${stateName}_move`,
|
|
347
|
-
prop:
|
|
348
|
-
name: '
|
|
364
|
+
prop: brmPropName,
|
|
365
|
+
name: 'Increases or decreases the brightness by X units per second',
|
|
349
366
|
icon: undefined,
|
|
350
367
|
role: 'state',
|
|
351
368
|
write: true,
|
|
@@ -354,7 +371,23 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
|
|
|
354
371
|
min: -50,
|
|
355
372
|
max: 50,
|
|
356
373
|
def: 0
|
|
357
|
-
},
|
|
374
|
+
}, z2mAccess.SET);
|
|
375
|
+
// brightnessStepOnOff
|
|
376
|
+
const brspropName = config.brightnessStepOnOff == true ? `${stateName}_step_onoff` : `${stateName}_step`;
|
|
377
|
+
pushToStates({
|
|
378
|
+
id: `${stateName}_step`,
|
|
379
|
+
prop: brspropName,
|
|
380
|
+
name: 'Increases or decreases brightness by X steps',
|
|
381
|
+
options: ['transition'],
|
|
382
|
+
icon: undefined,
|
|
383
|
+
role: 'state',
|
|
384
|
+
write: true,
|
|
385
|
+
read: false,
|
|
386
|
+
type: 'number',
|
|
387
|
+
min: -255,
|
|
388
|
+
max: 255,
|
|
389
|
+
def: 0
|
|
390
|
+
}, z2mAccess.SET);
|
|
358
391
|
break;
|
|
359
392
|
}
|
|
360
393
|
case 'color_temp': {
|
|
@@ -365,6 +398,7 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
|
|
|
365
398
|
id: stateName,
|
|
366
399
|
prop: propName,
|
|
367
400
|
name: `Color temperature ${expose.endpoint ? expose.endpoint : ''}`.trim(),
|
|
401
|
+
options: ['transition'],
|
|
368
402
|
icon: undefined,
|
|
369
403
|
role: 'level.color.temperature',
|
|
370
404
|
write: true,
|
|
@@ -410,6 +444,7 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
|
|
|
410
444
|
pushToStates({
|
|
411
445
|
id: stateName,
|
|
412
446
|
name: `Color ${expose.endpoint ? expose.endpoint : ''}`.trim(),
|
|
447
|
+
options: ['transition'],
|
|
413
448
|
icon: undefined,
|
|
414
449
|
role: 'level.color.rgb',
|
|
415
450
|
write: true,
|
|
@@ -449,6 +484,7 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
|
|
|
449
484
|
pushToStates({
|
|
450
485
|
id: stateName,
|
|
451
486
|
name: `Color ${expose.endpoint ? expose.endpoint : ''}`.trim(),
|
|
487
|
+
options: ['transition'],
|
|
452
488
|
icon: undefined,
|
|
453
489
|
role: 'level.color.rgb',
|
|
454
490
|
write: true,
|
|
@@ -489,8 +525,7 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
|
|
|
489
525
|
break;
|
|
490
526
|
}
|
|
491
527
|
}
|
|
492
|
-
|
|
493
|
-
//pushToStates(statesDefs.transition_time, 2);
|
|
528
|
+
pushToStates(statesDefs.transition, z2mAccess.SET);
|
|
494
529
|
break;
|
|
495
530
|
|
|
496
531
|
case 'switch':
|
|
@@ -787,7 +822,7 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
|
|
|
787
822
|
}
|
|
788
823
|
}
|
|
789
824
|
// Can the device simulated_brightness?
|
|
790
|
-
if (
|
|
825
|
+
if (definition.options && definition.options.find(x => x.property == 'simulated_brightness')) {
|
|
791
826
|
pushToStates(statesDefs.simulated_brightness, z2mAccess.STATE);
|
|
792
827
|
}
|
|
793
828
|
state = null;
|
|
@@ -949,7 +984,7 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
|
|
|
949
984
|
|
|
950
985
|
// If necessary, add states defined for this device model.
|
|
951
986
|
// Unfortunately this is necessary for some device models because they do not adhere to the standard
|
|
952
|
-
for (const state of getNonGenDevStatesDefs(
|
|
987
|
+
for (const state of getNonGenDevStatesDefs(definition.model)) {
|
|
953
988
|
pushToStates(state, state.write ? z2mAccess.SET : z2mAccess.STATE);
|
|
954
989
|
}
|
|
955
990
|
|
|
@@ -976,19 +1011,16 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
|
|
|
976
1011
|
id: deviceID,
|
|
977
1012
|
ieee_address: ieee_address,
|
|
978
1013
|
power_source: power_source,
|
|
1014
|
+
disabled: disabled,
|
|
1015
|
+
description: description,
|
|
1016
|
+
optionsValues: {},
|
|
979
1017
|
states: states,
|
|
980
1018
|
};
|
|
981
1019
|
|
|
982
1020
|
return newDevice;
|
|
983
1021
|
}
|
|
984
1022
|
|
|
985
|
-
function defineDeviceFromExposes(devices, deviceID, ieee_address, definitions, power_source, scenes, config) {
|
|
986
|
-
if (definitions.hasOwnProperty('exposes')) {
|
|
987
|
-
const newDevice = createFromExposes(deviceID, ieee_address, definitions, power_source, scenes, config);
|
|
988
|
-
devices.push(newDevice);
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
1023
|
|
|
992
1024
|
module.exports = {
|
|
993
|
-
|
|
1025
|
+
createDeviceFromExposes: createDeviceFromExposes,
|
|
994
1026
|
};
|
package/lib/states.js
CHANGED
|
@@ -144,6 +144,7 @@ const states = {
|
|
|
144
144
|
brightness: {
|
|
145
145
|
id: 'brightness',
|
|
146
146
|
name: 'Brightness',
|
|
147
|
+
options: ['transition'],
|
|
147
148
|
icon: undefined,
|
|
148
149
|
role: 'level.dimmer',
|
|
149
150
|
write: true,
|
|
@@ -189,6 +190,22 @@ const states = {
|
|
|
189
190
|
def: 0
|
|
190
191
|
},
|
|
191
192
|
|
|
193
|
+
transition: {
|
|
194
|
+
id: 'transition',
|
|
195
|
+
prop: 'transition',
|
|
196
|
+
name: 'Transition time overwrite (-1 disabled)',
|
|
197
|
+
icon: undefined,
|
|
198
|
+
role: 'state',
|
|
199
|
+
write: true,
|
|
200
|
+
read: false,
|
|
201
|
+
type: 'number',
|
|
202
|
+
unit: 'sec',
|
|
203
|
+
min: -1,
|
|
204
|
+
max: 65535,
|
|
205
|
+
def: -1,
|
|
206
|
+
isOption: true
|
|
207
|
+
},
|
|
208
|
+
|
|
192
209
|
//#################################################################
|
|
193
210
|
device_query: { // button to trigger device read
|
|
194
211
|
id: 'device_query',
|
|
@@ -781,6 +798,7 @@ const states = {
|
|
|
781
798
|
},
|
|
782
799
|
contact: {
|
|
783
800
|
id: 'contact',
|
|
801
|
+
prop: 'contact',
|
|
784
802
|
name: 'Contact event',
|
|
785
803
|
icon: undefined,
|
|
786
804
|
role: 'state',
|
|
@@ -1327,17 +1345,6 @@ const states = {
|
|
|
1327
1345
|
}
|
|
1328
1346
|
},
|
|
1329
1347
|
},
|
|
1330
|
-
transition_time: {
|
|
1331
|
-
id: 'transition_time',
|
|
1332
|
-
name: 'Transition time',
|
|
1333
|
-
icon: undefined,
|
|
1334
|
-
role: 'state',
|
|
1335
|
-
write: true,
|
|
1336
|
-
read: false,
|
|
1337
|
-
type: 'number',
|
|
1338
|
-
unit: 'sec',
|
|
1339
|
-
isOption: true,
|
|
1340
|
-
},
|
|
1341
1348
|
operation_mode: {
|
|
1342
1349
|
id: 'decoupled',
|
|
1343
1350
|
prop: 'operation_mode',
|
package/lib/statesController.js
CHANGED
|
@@ -35,11 +35,19 @@ class StatesController {
|
|
|
35
35
|
this.adapter.log.warn(`--->>> fromZ2M -> ${device.ieee_address} states: ${JSON.stringify(messageObj)}`);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
for (const [key, value] of Object.entries(messageObj.payload)) {
|
|
39
|
+
let states = device.states.filter(x => x.prop && x.prop == key);
|
|
40
|
+
|
|
41
|
+
if (states.length == 0) {
|
|
42
|
+
states = device.states.filter(x => x.id == key);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (states.length == 0) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
41
48
|
|
|
42
49
|
for (const state of states) {
|
|
50
|
+
|
|
43
51
|
const stateName = `${device.ieee_address}.${state.id}`;
|
|
44
52
|
|
|
45
53
|
// It may be that the state has not yet been created!
|
|
@@ -48,61 +56,33 @@ class StatesController {
|
|
|
48
56
|
continue;
|
|
49
57
|
}
|
|
50
58
|
|
|
51
|
-
if (!state.getter) {
|
|
52
|
-
this.adapter.log.error(`Action ${stateName} has no getter, this must not be!`);
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
59
|
try {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
// Is an action
|
|
61
|
+
if (state.prop && state.prop == 'action') {
|
|
62
|
+
if (state.isEvent && state.isEvent == true) {
|
|
63
|
+
if (state.type == 'boolean') {
|
|
64
|
+
await this.setStateWithTimeoutAsync(stateName, state.getter(messageObj.payload), 300);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
await this.setStateSafelyAsync(stateName, state.getter(messageObj.payload));
|
|
68
|
+
}
|
|
60
69
|
}
|
|
61
70
|
else {
|
|
62
|
-
await this.
|
|
71
|
+
await this.setStateChangedSafelyAsync(stateName, state.getter(messageObj.payload));
|
|
63
72
|
}
|
|
64
73
|
}
|
|
74
|
+
// Is not an action
|
|
65
75
|
else {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// Is not an action
|
|
75
|
-
else {
|
|
76
|
-
for (const [key, value] of Object.entries(messageObj.payload)) {
|
|
77
|
-
let state = device.states.find(x => x.prop && x.prop == key);
|
|
78
|
-
|
|
79
|
-
if (!state) {
|
|
80
|
-
state = device.states.find(x => x.id == key);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (!state) {
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const stateName = `${device.ieee_address}.${state.id}`;
|
|
88
|
-
|
|
89
|
-
// It may be that the state has not yet been created!
|
|
90
|
-
if (!this.createCache[device.ieee_address] || !this.createCache[device.ieee_address][state.id] || !this.createCache[device.ieee_address][state.id].created) {
|
|
91
|
-
incStatsQueue[incStatsQueue.length] = messageObj;
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
try {
|
|
96
|
-
if (state.getter) {
|
|
97
|
-
await this.setStateChangedSafelyAsync(stateName, state.getter(messageObj.payload));
|
|
98
|
-
} else {
|
|
99
|
-
await this.setStateChangedSafelyAsync(stateName, value);
|
|
76
|
+
if (state.getter) {
|
|
77
|
+
await this.setStateChangedSafelyAsync(stateName, state.getter(messageObj.payload));
|
|
78
|
+
} else {
|
|
79
|
+
await this.setStateChangedSafelyAsync(stateName, value);
|
|
80
|
+
}
|
|
100
81
|
}
|
|
101
82
|
} catch (err) {
|
|
102
83
|
incStatsQueue[incStatsQueue.length] = messageObj;
|
|
103
84
|
this.adapter.log.debug(`Can not set ${stateName}, queue state in incStatsQueue!`);
|
|
104
85
|
}
|
|
105
|
-
|
|
106
86
|
}
|
|
107
87
|
}
|
|
108
88
|
}
|
package/lib/z2mController.js
CHANGED
|
@@ -40,23 +40,53 @@ class Z2mController {
|
|
|
40
40
|
stateID = deviceState.setattr;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
44
43
|
const controlObj = {
|
|
45
44
|
payload: {
|
|
46
|
-
[stateID]: stateVal
|
|
45
|
+
[stateID]: stateVal,
|
|
47
46
|
},
|
|
48
47
|
topic: `${device.id}/set`
|
|
49
48
|
};
|
|
50
49
|
|
|
51
|
-
//
|
|
52
|
-
if (
|
|
50
|
+
// if available read option and set payload
|
|
51
|
+
if (deviceState.options) {
|
|
52
|
+
for (const option of deviceState.options) {
|
|
53
|
+
// if optionsValues not set, set it!
|
|
54
|
+
if (!device.optionsValues[option]) {
|
|
55
|
+
const optionValue = (await this.adapter.getStateAsync(`${splitedID[0]}.${splitedID[1]}.${splitedID[2]}.${option}`)).val;
|
|
56
|
+
// optionsValues Cache
|
|
57
|
+
device.optionsValues[option] = optionValue;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// if transition value == -1 it will be ignored. -1 stands for no overwrite!
|
|
61
|
+
if (option == 'transition' && device.optionsValues[option] == -1) {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
controlObj.payload[option] = device.optionsValues[option];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// If an option datapoint has been set, it does not have to be sent.
|
|
70
|
+
// This is confirmed directly by the adapter (ack = true)
|
|
71
|
+
if (deviceState.isOption && deviceState.isOption == true) {
|
|
72
|
+
// set optionsValues 'Cache'
|
|
73
|
+
device.optionsValues[stateName] = state.val;
|
|
74
|
+
this.adapter.setState(id, state, true);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// set stats with the mentioned roles or always immediately to ack = true, because these are not reported back by Zigbee2MQTT
|
|
79
|
+
if (['button'].includes(deviceState.role)) {
|
|
80
|
+
this.adapter.setState(id, state, true);
|
|
81
|
+
}
|
|
82
|
+
// set stats with the mentioned ids always immediately to ack = true, because these are not reported back by Zigbee2MQTT
|
|
83
|
+
if (['brightness_move', 'colortemp_move', 'brightness_move', 'brightness_step', 'effect'].includes(deviceState.id)) {
|
|
53
84
|
this.adapter.setState(id, state, true);
|
|
54
85
|
}
|
|
55
86
|
|
|
56
87
|
if (this.logCustomizations.debugDevices.includes(device.ieee_address)) {
|
|
57
88
|
this.adapter.log.warn(`<<<--- toZ2M -> ${device.ieee_address} states: ${JSON.stringify(controlObj)}`);
|
|
58
89
|
}
|
|
59
|
-
|
|
60
90
|
return controlObj;
|
|
61
91
|
}
|
|
62
92
|
|
|
@@ -80,6 +110,7 @@ class Z2mController {
|
|
|
80
110
|
}
|
|
81
111
|
}
|
|
82
112
|
|
|
113
|
+
|
|
83
114
|
module.exports = {
|
|
84
115
|
Z2mController: Z2mController
|
|
85
116
|
};
|
package/main.js
CHANGED
|
@@ -169,6 +169,8 @@ class Zigbee2mqtt extends core.Adapter {
|
|
|
169
169
|
case 'bridge/response/device/remove':
|
|
170
170
|
deviceController.processRemoveEvent(messageObj);
|
|
171
171
|
break;
|
|
172
|
+
case 'bridge/response/device/options':
|
|
173
|
+
break;
|
|
172
174
|
case 'bridge/extensions':
|
|
173
175
|
break;
|
|
174
176
|
case 'bridge/logging':
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.zigbee2mqtt",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Zigbee2MQTT adapter for ioBroker",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Dennis Rathjen",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"aedes-persistence-nedb": "^2.0.3",
|
|
25
25
|
"mqtt": "^4.3.7",
|
|
26
26
|
"net": "^1.0.2",
|
|
27
|
-
"ws": "^8.
|
|
27
|
+
"ws": "^8.12.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@alcalzone/release-script-plugin-iobroker": "^3.5.9",
|
|
@@ -36,17 +36,17 @@
|
|
|
36
36
|
"@types/chai": "^4.3.4",
|
|
37
37
|
"@types/chai-as-promised": "^7.1.5",
|
|
38
38
|
"@types/mocha": "^10.0.1",
|
|
39
|
-
"@types/node": "^18.11.
|
|
39
|
+
"@types/node": "^18.11.18",
|
|
40
40
|
"@types/proxyquire": "^1.3.28",
|
|
41
41
|
"@types/sinon": "^10.0.13",
|
|
42
42
|
"@types/sinon-chai": "^3.2.9",
|
|
43
43
|
"chai": "^4.3.7",
|
|
44
44
|
"chai-as-promised": "^7.1.1",
|
|
45
|
-
"eslint": "^8.
|
|
46
|
-
"eslint-config-prettier": "^8.
|
|
45
|
+
"eslint": "^8.31.0",
|
|
46
|
+
"eslint-config-prettier": "^8.6.0",
|
|
47
47
|
"eslint-plugin-prettier": "^4.2.1",
|
|
48
48
|
"mocha": "^10.2.0",
|
|
49
|
-
"prettier": "^2.8.
|
|
49
|
+
"prettier": "^2.8.2",
|
|
50
50
|
"proxyquire": "^2.1.3",
|
|
51
51
|
"sinon": "^15.0.1",
|
|
52
52
|
"sinon-chai": "^3.7.0",
|