iobroker.zigbee2mqtt 2.4.4 → 2.5.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 +11 -1
- 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 +18 -3
- package/lib/exposes.js +24 -6
- package/lib/statesController.js +27 -47
- package/lib/websocketController.js +4 -0
- package/lib/z2mController.js +1 -1
- package/package.json +8 -8
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,6 +32,16 @@ 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.5.0 (2023-01-02)
|
|
36
|
+
|
|
37
|
+
- (o0shojo0o) added option `Brightness step should also turn the light on or off`
|
|
38
|
+
- (o0shojo0o) added handling of `brightness_step` ([#96](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/96))
|
|
39
|
+
- (o0shojo0o) states processing more flexible designed ([#94](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/94))
|
|
40
|
+
|
|
41
|
+
### 2.4.5 (2022-12-20)
|
|
42
|
+
|
|
43
|
+
- (o0shojo0o) extend 'text' for 'action' ([#84](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/84))
|
|
44
|
+
|
|
35
45
|
### 2.4.4 (2022-12-06)
|
|
36
46
|
|
|
37
47
|
- (o0shojo0o) better state identification ([#79](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/79))
|
|
@@ -131,7 +141,7 @@ This adapter allows to control the data points of the devices of a Zigbee2MQTT i
|
|
|
131
141
|
|
|
132
142
|
MIT License
|
|
133
143
|
|
|
134
|
-
Copyright (c)
|
|
144
|
+
Copyright (c) 2023 Dennis Rathjen <dennis.rathjen@outlook.de>
|
|
135
145
|
|
|
136
146
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
137
147
|
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.5.0",
|
|
5
5
|
"news": {
|
|
6
|
+
"2.5.0": {
|
|
7
|
+
"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))",
|
|
8
|
+
"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)",
|
|
9
|
+
"ru": "добавленная опция `Яркость шаг должен также повернуть свет на или вне`\nдобавлена обработка brightness_step #[96](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/96)\nсостояния обработки более гибкий дизайн #[94](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/94)",
|
|
10
|
+
"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)",
|
|
11
|
+
"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",
|
|
12
|
+
"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)",
|
|
13
|
+
"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)",
|
|
14
|
+
"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)",
|
|
15
|
+
"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)",
|
|
16
|
+
"uk": "доданий варіант `Бритальність кроку також повинен перетворювати світло або вимкнути`\nдодано обробка яскравості_кроку #[96](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/96)\n[94] (https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/94)",
|
|
17
|
+
"zh-cn": "增加“权利步骤”的选择,也应该改变“或”的提法。\n增加光明处理:第[96]号(http://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/96)\n国家处理较为灵活的第[94]号(http://github.com/oshojo0o/ioBroker.zigbee2mqt/issues/94)"
|
|
18
|
+
},
|
|
19
|
+
"2.4.5": {
|
|
20
|
+
"en": "extend 'text' for 'action' ([#84](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/84))",
|
|
21
|
+
"de": "text für die Aktion #[84](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/84)",
|
|
22
|
+
"ru": "расширить текст для действия #[84](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/84)",
|
|
23
|
+
"pt": "extensão do texto para a ação #[84](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/84)",
|
|
24
|
+
"nl": "quality over Quantity (QoQ) Releases Vertaling:",
|
|
25
|
+
"fr": "extension text for action #[84](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/84)",
|
|
26
|
+
"it": "estendere il testo all'azione #[84](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/84)",
|
|
27
|
+
"es": "extensión text for action #[84](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/84)",
|
|
28
|
+
"pl": "tekst do akcji #84 (https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/84)",
|
|
29
|
+
"uk": "javaScript licenses API Веб-сайт Go1.13.8",
|
|
30
|
+
"zh-cn": "行动案文[84](http://github.com/oshojo0o/ioBroker.zigbee2mqt/issues/84)"
|
|
31
|
+
},
|
|
6
32
|
"2.4.4": {
|
|
7
33
|
"en": "better state identification ([#79](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/79))",
|
|
8
34
|
"de": "bessere Zustandserkennung #[79](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/79)",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"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).",
|
|
68
94
|
"uk": "виправлення для пристроїв з декількома кінцевими точками [#57](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/57).\nдоданий варіант `Брайтний рух також повинен перетворювати світло або вимкнути`\nдодано державний контроль за групами\nбільш динамічний при створенні точки даних [#48](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/48).",
|
|
69
95
|
"zh-cn": "fix 有多个最终用户的装置[第57号](http://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/57).\n增加“权利流动”的选择,也应该改变“或”以外的照明。\n加入集团的州\n在数据点创建期间,增加活力[第48](http://github.com/oshojo0o/ioBroker.zigbee2mqt/issues/48)."
|
|
70
|
-
},
|
|
71
|
-
"2.3.0": {
|
|
72
|
-
"en": "added support for the `toggle` of states that support this.\nadded correct handling of `color_move` and `color_temperature_move`",
|
|
73
|
-
"de": "zusätzliche unterstützung für den kippen von staaten, die dies unterstützen.\nkorrekte handhabung von color_move und color_temperature_move",
|
|
74
|
-
"ru": "добавлена поддержка в отношении государств, которые поддерживают это.\nдобавлена правильная обработка color_move и color_temperature_move",
|
|
75
|
-
"pt": "acrescentou apoio para o conjunto de estados que apoiam isso.\nadicionado manuseio correto de color_move e color_temperature_move",
|
|
76
|
-
"nl": "steun toegevoegd voor de toggle van staten die dit ondersteunen.\nvoegde de juiste kleding en kleurtemperatuur toe",
|
|
77
|
-
"fr": "a ajouté un soutien pour la lutte des etats qui appuient cela.\nla manipulation correcte de color_move et color_temperature_move",
|
|
78
|
-
"it": "ha aggiunto il sostegno per la lotta di stati che sostengono questo.\naggiunto corretto trattamento di colore_move e colore_temperature_move",
|
|
79
|
-
"es": "agregó apoyo para la lucha de estados que apoyan esto.\nañadido correcto manejo de color_move y color_temperature_move",
|
|
80
|
-
"pl": "dodał wsparcie dla porozumień stanów, które to wspierają.\ndodano poprawne zachowanie koloru i kolor_temperature_move",
|
|
81
|
-
"uk": "додана підтримка для тягових станів, які підтримують це.\nдодано правильну обробку кольором_move та color_ infrastructure_move",
|
|
82
|
-
"zh-cn": "此外,还支持支持这一国家。.\n· 删除白色、流血和色色色色色彩。"
|
|
83
|
-
},
|
|
84
|
-
"2.2.1": {
|
|
85
|
-
"en": "fix state roles and access\nfix state handling\nfix createZ2MMessage",
|
|
86
|
-
"de": "zustandsrollen und zugriff beheben\nmanuelle zustandsbearbeitung\nfix erstellenZ2MMessage",
|
|
87
|
-
"ru": "исправить государственные роли и доступ\nисправить государственную обработку\nисправить CreateZ2MMessage",
|
|
88
|
-
"pt": "corrigir funções estaduais e acesso\ncorrigir o manuseio do estado\ncorrigir createZ2MMessage",
|
|
89
|
-
"nl": "vertaling:\nvertaling:\nvertaling:",
|
|
90
|
-
"fr": "fixer les rôles de l'état et l'accès\nmaniement de l ' état\nfix createZ2MMessage",
|
|
91
|
-
"it": "fissare i ruoli dello stato e l'accesso\ncorretta gestione dello stato\nfix createZ2MMessage",
|
|
92
|
-
"es": "fijar funciones estatales y acceso\ncorrección del estado\nfix createZ2MMessage",
|
|
93
|
-
"pl": "uchwała rola państwowa i dostęp\nnaprawa\ntworzenie Z2MM",
|
|
94
|
-
"uk": "фіксувати державні ролі і доступ\nфіксувати стан обробки\nфіксатор творуZ2MMessage",
|
|
95
|
-
"zh-cn": "fix 国家作用和准入\nfix 国家处理\nfix 建立Z2MMessage"
|
|
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
|
@@ -38,7 +38,8 @@ class DeviceController {
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
async defineGroupDevice(groupID, ieee_address, scenes) {
|
|
41
|
-
const
|
|
41
|
+
const brmPropName = this.adapter.config.brightnessMoveOnOff == true ? 'brightness_move_onoff' : 'brightness_move';
|
|
42
|
+
const brsPropName = this.adapter.config.brightnessStepOnOff == true ? 'brightness_step_onoff' : 'brightness_step';
|
|
42
43
|
const newDevice = {
|
|
43
44
|
id: groupID,
|
|
44
45
|
ieee_address: ieee_address,
|
|
@@ -49,8 +50,8 @@ class DeviceController {
|
|
|
49
50
|
states.colortemp_move,
|
|
50
51
|
{
|
|
51
52
|
id: 'brightness_move',
|
|
52
|
-
prop:
|
|
53
|
-
name: '
|
|
53
|
+
prop: brmPropName,
|
|
54
|
+
name: 'Increases or decreases the brightness by X units per second',
|
|
54
55
|
icon: undefined,
|
|
55
56
|
role: 'state',
|
|
56
57
|
write: true,
|
|
@@ -60,6 +61,20 @@ class DeviceController {
|
|
|
60
61
|
max: 50,
|
|
61
62
|
def: 0
|
|
62
63
|
},
|
|
64
|
+
|
|
65
|
+
{
|
|
66
|
+
id: 'brightness_step',
|
|
67
|
+
prop: brsPropName,
|
|
68
|
+
name: 'Increases or decreases brightness by X steps',
|
|
69
|
+
icon: undefined,
|
|
70
|
+
role: 'state',
|
|
71
|
+
write: true,
|
|
72
|
+
read: false,
|
|
73
|
+
type: 'number',
|
|
74
|
+
min: -255,
|
|
75
|
+
max: 255,
|
|
76
|
+
def: 0
|
|
77
|
+
},
|
|
63
78
|
{
|
|
64
79
|
id: 'color',
|
|
65
80
|
prop: 'color',
|
package/lib/exposes.js
CHANGED
|
@@ -90,7 +90,7 @@ function genState(expose, role, name, desc) {
|
|
|
90
90
|
write: writable,
|
|
91
91
|
read: true,
|
|
92
92
|
type: 'number',
|
|
93
|
-
min: expose.value_min
|
|
93
|
+
min: expose.value_min,
|
|
94
94
|
max: expose.value_max,
|
|
95
95
|
unit: expose.unit,
|
|
96
96
|
};
|
|
@@ -143,12 +143,15 @@ function genState(expose, role, name, desc) {
|
|
|
143
143
|
id: stateId,
|
|
144
144
|
prop: propName,
|
|
145
145
|
name: stateName,
|
|
146
|
-
icon: undefined,
|
|
147
146
|
role: role || 'state',
|
|
148
147
|
write: writable,
|
|
149
148
|
read: true,
|
|
150
149
|
type: 'string',
|
|
151
150
|
};
|
|
151
|
+
if (propName == 'action') {
|
|
152
|
+
state.isEvent = true;
|
|
153
|
+
state.getter = (payload) => { return payload[propName]; };
|
|
154
|
+
}
|
|
152
155
|
if (expose.endpoint) {
|
|
153
156
|
state.epname = expose.endpoint;
|
|
154
157
|
}
|
|
@@ -338,11 +341,11 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
|
|
|
338
341
|
},
|
|
339
342
|
}, prop.access);
|
|
340
343
|
// brightnessMoveOnOff
|
|
341
|
-
const
|
|
344
|
+
const brmPropName = config.brightnessMoveOnOff == true ? `${stateName}_move_onoff` : `${stateName}_move`;
|
|
342
345
|
pushToStates({
|
|
343
346
|
id: `${stateName}_move`,
|
|
344
|
-
prop:
|
|
345
|
-
name: '
|
|
347
|
+
prop: brmPropName,
|
|
348
|
+
name: 'Increases or decreases the brightness by X units per second',
|
|
346
349
|
icon: undefined,
|
|
347
350
|
role: 'state',
|
|
348
351
|
write: true,
|
|
@@ -351,7 +354,22 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
|
|
|
351
354
|
min: -50,
|
|
352
355
|
max: 50,
|
|
353
356
|
def: 0
|
|
354
|
-
},
|
|
357
|
+
}, z2mAccess.SET);
|
|
358
|
+
// brightnessStepOnOff
|
|
359
|
+
const brspropName = config.brightnessStepOnOff == true ? `${stateName}_step_onoff` : `${stateName}_step`;
|
|
360
|
+
pushToStates({
|
|
361
|
+
id: `${stateName}_step`,
|
|
362
|
+
prop: brspropName,
|
|
363
|
+
name: 'Increases or decreases brightness by X steps',
|
|
364
|
+
icon: undefined,
|
|
365
|
+
role: 'state',
|
|
366
|
+
write: true,
|
|
367
|
+
read: false,
|
|
368
|
+
type: 'number',
|
|
369
|
+
min: -255,
|
|
370
|
+
max: 255,
|
|
371
|
+
def: 0
|
|
372
|
+
}, z2mAccess.SET);
|
|
355
373
|
break;
|
|
356
374
|
}
|
|
357
375
|
case 'color_temp': {
|
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
|
@@ -49,7 +49,7 @@ class Z2mController {
|
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
// set stats with the mentioned role or ids always immediately to ack = true, because these are not reported back by Zigbee2MQTT
|
|
52
|
-
if (['button'].includes(deviceState.role) || ['brightness_move', 'colortemp_move', 'brightness_move', 'effect'].includes(deviceState.id)) {
|
|
52
|
+
if (['button'].includes(deviceState.role) || ['brightness_move', 'colortemp_move', 'brightness_move', 'brightness_step', 'effect'].includes(deviceState.id)) {
|
|
53
53
|
this.adapter.setState(id, state, true);
|
|
54
54
|
}
|
|
55
55
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.zigbee2mqtt",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "Zigbee2MQTT adapter for ioBroker",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Dennis Rathjen",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@iobroker/adapter-core": "^2.6.7",
|
|
23
|
-
"aedes": "^0.48.
|
|
23
|
+
"aedes": "^0.48.1",
|
|
24
24
|
"aedes-persistence-nedb": "^2.0.3",
|
|
25
25
|
"mqtt": "^4.3.7",
|
|
26
26
|
"net": "^1.0.2",
|
|
@@ -36,21 +36,21 @@
|
|
|
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.
|
|
45
|
+
"eslint": "^8.31.0",
|
|
46
46
|
"eslint-config-prettier": "^8.5.0",
|
|
47
47
|
"eslint-plugin-prettier": "^4.2.1",
|
|
48
|
-
"mocha": "^10.
|
|
49
|
-
"prettier": "^2.8.
|
|
48
|
+
"mocha": "^10.2.0",
|
|
49
|
+
"prettier": "^2.8.1",
|
|
50
50
|
"proxyquire": "^2.1.3",
|
|
51
|
-
"sinon": "^15.0.
|
|
51
|
+
"sinon": "^15.0.1",
|
|
52
52
|
"sinon-chai": "^3.7.0",
|
|
53
|
-
"typescript": "~4.9.
|
|
53
|
+
"typescript": "~4.9.4"
|
|
54
54
|
},
|
|
55
55
|
"main": "main.js",
|
|
56
56
|
"files": [
|