iobroker.zigbee2mqtt 2.10.1 → 2.12.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/README.md CHANGED
@@ -32,14 +32,29 @@ 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.12.0 (2023-09-05)
36
+
37
+ - (o0shojo0o) added option `Size of the object icons in pixels`
38
+
39
+ ### 2.11.0 (2023-08-24)
40
+
41
+ - (o0shojo0o) added automatic download of device image from zigbee2mqtt to meta-storage
42
+ - (o0shojo0o) device images from Meta-Storage added to the object
43
+ - (o0shojo0o) device images from Meta-Storage auto resize to 28x28 pixel for smaller object
44
+ - (o0shojo0o) added option `Download device images from Zigbee2Mqtt and use them as object icons.`
45
+ - (o0shojo0o) fixed Hue_Move ([#223](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/223))
46
+ - (o0shojo0o) added option `Generate simple 'Hold' and 'Release' states`
47
+ - (o0shojo0o) added option `Generate simple 'Move' and 'Stop' states`
48
+ - (o0shojo0o) added option `Generate simple 'Press' and 'Release' states`
49
+
35
50
  ### 2.10.1 (2023-08-13)
36
51
 
37
- - (o0shojo0o) fix type definitions (thx @arteck)
52
+ - (o0shojo0o) fixed type definitions (thx @arteck)
38
53
 
39
54
  ### 2.10.0 (2023-08-12)
40
55
 
41
56
  - (o0shojo0o) optimisation for the MQTT connection
42
- - (o0shojo0o) fix for MQTT output type: attribute_and_json ([#87](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/87))
57
+ - (o0shojo0o) fixed for MQTT output type: attribute_and_json ([#87](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/87))
43
58
  - (o0shojo0o) added support for external MQTT-Server credentials ([#148](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/148))
44
59
  - *After update, Websocket Auth-Token must be set again, if used.*
45
60
 
@@ -58,7 +73,7 @@ This adapter allows to control the data points of the devices of a Zigbee2MQTT i
58
73
 
59
74
  ### 2.7.4 (2023-03-05)
60
75
 
61
- - (o0shojo0o) fix for Aqara presence detector FP1 `reset_nopresence_status`
76
+ - (o0shojo0o) fixed for Aqara presence detector FP1 `reset_nopresence_status`
62
77
 
63
78
  ### 2.7.3 (2023-02-18)
64
79
 
@@ -85,7 +100,7 @@ This adapter allows to control the data points of the devices of a Zigbee2MQTT i
85
100
  - (o0shojo0o) added state `transition` for transition overwrite (-1 disabled overwrite) ([#101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101))
86
101
  - (o0shojo0o) consideration of the description when creating the friendly name ([#105](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/105))
87
102
  - (o0shojo0o) added state `effect` for groups ([#101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101))
88
- - (o0shojo0o) fix state contact
103
+ - (o0shojo0o) fixed state contact
89
104
  - (o0shojo0o) added handling for disabled devices
90
105
 
91
106
  ### 2.5.0 (2023-01-02)
@@ -104,20 +119,20 @@ This adapter allows to control the data points of the devices of a Zigbee2MQTT i
104
119
 
105
120
  ### 2.4.3 (2022-11-23)
106
121
 
107
- - (o0shojo0o) fix availability when `friendly_name` `/` contains
122
+ - (o0shojo0o) fixed availability when `friendly_name` `/` contains
108
123
 
109
124
  ### 2.4.2 (2022-11-20)
110
125
 
111
126
  - (o0shojo0o) added correct handling of `move_to_saturation`, `hue_move` and `brightness_move_to_level` ([#68](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/68))
112
- - (o0shojo0o) fix when `friendly_name` `/` contains
127
+ - (o0shojo0o) fixed when `friendly_name` `/` contains
113
128
 
114
129
  ### 2.4.1 (2022-11-16)
115
130
 
116
- - (o0shojo0o) fix based on [review](https://github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1316656378)
131
+ - (o0shojo0o) fixed based on [review](https://github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1316656378)
117
132
 
118
133
  ### 2.4.0 (2022-11-08)
119
134
 
120
- - (o0shojo0o) fix for devices with multiple endpoints ([#57](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/57)).
135
+ - (o0shojo0o) fixed for devices with multiple endpoints ([#57](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/57)).
121
136
  - (o0shojo0o) added option `Brightness move should also turn the light on or off`
122
137
  - (o0shojo0o) added state toggle for groups
123
138
  - (o0shojo0o) more dynamic during data point creation ([#48](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/48)).
@@ -129,9 +144,9 @@ This adapter allows to control the data points of the devices of a Zigbee2MQTT i
129
144
 
130
145
  ### 2.2.1 (2022-10-25)
131
146
 
132
- - (o0shojo0o) fix state roles and access
133
- - (o0shojo0o) fix state handling
134
- - (o0shojo0o) fix createZ2MMessage
147
+ - (o0shojo0o) fixed state roles and access
148
+ - (o0shojo0o) fixed state handling
149
+ - (o0shojo0o) fixed createZ2MMessage
135
150
 
136
151
  ### 2.2.0 (2022-10-20)
137
152
 
@@ -147,7 +162,7 @@ This adapter allows to control the data points of the devices of a Zigbee2MQTT i
147
162
  ### 2.1.0 (2022-10-14)
148
163
 
149
164
  - (o0shojo0o) added option for color temperature sync with color
150
- - (o0shojo0o) fix logfilter and debugDevices
165
+ - (o0shojo0o) fixed logfilter and debugDevices
151
166
  - (o0shojo0o) lots of bugfixes
152
167
  - (o0shojo0o) now set the correct min/max at color temp
153
168
  - (o0shojo0o) better error handling for the connections
@@ -186,8 +201,8 @@ This adapter allows to control the data points of the devices of a Zigbee2MQTT i
186
201
  - (arteck) added debugmessage for specific device functionality
187
202
  - (arteck) added some states are default false
188
203
  - (o0shojo0o) added support for scenes defined on a device
189
- - (o0shojo0o) fix available state role
190
- - (o0shojo0o) fix subscribeWritableStates
204
+ - (o0shojo0o) fixed available state role
205
+ - (o0shojo0o) fixed edsubscribeWritableStates
191
206
 
192
207
  ### 0.1.0 (2022-09-29)
193
208
 
@@ -29,5 +29,14 @@
29
29
  "Scheme": "Scheme",
30
30
  "Use MQTT Credentials": "MQTT-Anmeldeinformationen verwenden",
31
31
  "MQTT Username": "MQTT-Benutzername",
32
- "MQTT Password": "MQTT-Passwort"
33
- }
32
+ "MQTT Password": "MQTT-Passwort",
33
+ "Download device images from Zigbee2Mqtt and use them as object icons.": "Device Bilder von Zigbee2Mqtt herunterladen und als Objektsymbole verwenden.",
34
+ "Generate simple 'Hold' and 'Release' states": "Generiert einfache „Hold“ und „Release“ States",
35
+ "When enabled, the 'Hold' and 'Release' states are combined and the 'Hold' data point remains true until the 'Release' event arrives.": "Bei Aktivierung werden die Datenpunkte „Hold“ und „Release“ kombiniert und der Datenpunkt „Hold“ bleibt true, bis das Ereignis „Release“ eintrifft.",
36
+ "Generate simple 'Move' and 'Stop' states": "Generiert einfache „Move“ und „Stop“ States",
37
+ "When enabled, the 'Move' and 'Stop' states are combined and the 'Move' data point remains true until the 'Stop' event arrives.": "Bei Aktivierung werden die Datenpunkte „Move“ und „Stop“ kombiniert und der Datenpunkt „Move“ bleibt true, bis das Ereignis „Stop“ eintrifft.",
38
+ "State configurations": "State konfigurationen",
39
+ "Generate simple 'Press' and 'Release' states": "Generieren einfache „Press“ und „Release“ States",
40
+ "When enabled, the 'Press' and 'Release' states are combined and the 'Press' data point remains true until the 'Release' event arrives.": "Wenn diese Option aktiviert ist, werden die Zustände „Press“ und „Release“ kombiniert und der Datenpunkt „Press“ bleibt true, bis das Ereignis „Release“ eintrifft.",
41
+ "If the size is later changed to a larger value, the images already downloaded must be deleted. <br> Please note that icons are stored in the object and should therefore not be unnecessarily large!": "Wird die Größe später auf einen größeren Wert geändert, müssen die bereits heruntergeladenen Bilder gelöscht werden. <br> Bitte beachten Sie, dass Icons im Objekt gespeichert werden und daher nicht unnötig groß sein sollten!"
42
+ }
@@ -29,5 +29,14 @@
29
29
  "Scheme": "Scheme",
30
30
  "Use MQTT Credentials": "Use MQTT Credentials",
31
31
  "MQTT Username": "MQTT Username",
32
- "MQTT Password": "MQTT Password"
32
+ "MQTT Password": "MQTT Password",
33
+ "Download device images from Zigbee2Mqtt and use them as object icons.": "Download device images from Zigbee2Mqtt and use them as object icons.",
34
+ "Generate simple 'Hold' and 'Release' states": "Generate simple 'Hold' and 'Release' states",
35
+ "When enabled, the 'Hold' and 'Release' states are combined and the 'Hold' data point remains true until the 'Release' event arrives.": "When enabled, the 'Hold' and 'Release' states are combined and the 'Hold' data point remains true until the 'Release' event arrives.",
36
+ "Generate simple 'Move' and 'Stop' states": "Generate simple 'Move' and 'Stop' states",
37
+ "When enabled, the 'Move' and 'Stop' states are combined and the 'Move' data point remains true until the 'Stop' event arrives.": "When enabled, the 'Move' and 'Stop' states are combined and the 'Move' data point remains true until the 'Stop' event arrives.",
38
+ "State configurations": "State configurations",
39
+ "Generate simple 'Press' and 'Release' states": "Generate simple 'Press' and 'Release' states",
40
+ "When enabled, the 'Press' and 'Release' states are combined and the 'Press' data point remains true until the 'Release' event arrives.": "When enabled, the 'Press' and 'Release' states are combined and the 'Press' data point remains true until the 'Release' event arrives.",
41
+ "If the size is later changed to a larger value, the images already downloaded must be deleted. <br> Please note that icons are stored in the object and should therefore not be unnecessarily large!": "If the size is later changed to a larger value, the images already downloaded must be deleted. <br> Please note that icons are stored in the object and should therefore not be unnecessarily large!"
33
42
  }
@@ -29,5 +29,14 @@
29
29
  "Scheme": "Esquema",
30
30
  "Use MQTT Credentials": "Usar credenciales MQTT",
31
31
  "MQTT Username": "Nombre de usuario MQTT",
32
- "MQTT Password": "Contraseña MQTT"
32
+ "MQTT Password": "Contraseña MQTT",
33
+ "Download device images from Zigbee2Mqtt and use them as object icons.": "Descargue imágenes de dispositivos de Zigbee2Mqtt y utilícelas como íconos de objetos.",
34
+ "Generate simple 'Hold' and 'Release' states": "Genere estados simples de 'Retener' y 'Liberar'",
35
+ "When enabled, the 'Hold' and 'Release' states are combined and the 'Hold' data point remains true until the 'Release' event arrives.": "Cuando está habilitado, los estados 'Retener' y 'Liberar' se combinan y el punto de datos 'Retener' permanece verdadero hasta que llega el evento 'Liberar'.",
36
+ "Generate simple 'Move' and 'Stop' states": "Genere estados simples de 'Mover' y 'Detener'",
37
+ "When enabled, the 'Move' and 'Stop' states are combined and the 'Move' data point remains true until the 'Stop' event arrives.": "Cuando está habilitado, los estados 'Mover' y 'Detener' se combinan y el punto de datos 'Mover' permanece verdadero hasta que llega el evento 'Detener'.",
38
+ "State configurations": "Configuraciones de estado",
39
+ "Generate simple 'Press' and 'Release' states": "Genere estados simples de \"Presionar\" y \"Liberar\"",
40
+ "When enabled, the 'Press' and 'Release' states are combined and the 'Press' data point remains true until the 'Release' event arrives.": "Cuando está habilitado, los estados \"Presionar\" y \"Liberar\" se combinan y el punto de datos \"Presionar\" permanece verdadero hasta que llega el evento \"Liberar\".",
41
+ "If the size is later changed to a larger value, the images already downloaded must be deleted. <br> Please note that icons are stored in the object and should therefore not be unnecessarily large!": "Si posteriormente se cambia el tamaño a un valor mayor, se deben eliminar las imágenes ya descargadas. <br> ¡Tenga en cuenta que los iconos se almacenan en el objeto y, por lo tanto, no deben ser innecesariamente grandes!"
33
42
  }
@@ -29,5 +29,14 @@
29
29
  "Scheme": "Schème",
30
30
  "Use MQTT Credentials": "Utiliser les identifiants MQTT",
31
31
  "MQTT Username": "Nom d'utilisateur MQTT",
32
- "MQTT Password": "Mot de passe MQTT"
32
+ "MQTT Password": "Mot de passe MQTT",
33
+ "Download device images from Zigbee2Mqtt and use them as object icons.": "Téléchargez des images d'appareils à partir de Zigbee2Mqtt et utilisez-les comme icônes d'objets.",
34
+ "Generate simple 'Hold' and 'Release' states": "Générer des états simples 'Hold' et 'Release'",
35
+ "When enabled, the 'Hold' and 'Release' states are combined and the 'Hold' data point remains true until the 'Release' event arrives.": "Lorsqu'il est activé, les états 'Hold' et 'Release' sont combinés et le point de données 'Hold' reste vrai jusqu'à ce que l'événement 'Release' arrive.",
36
+ "Generate simple 'Move' and 'Stop' states": "Générer des états simples 'Move' et 'Stop'",
37
+ "When enabled, the 'Move' and 'Stop' states are combined and the 'Move' data point remains true until the 'Stop' event arrives.": "Lorsqu'il est activé, les états 'Move' et 'Stop' sont combinés et le point de données 'Move' reste vrai jusqu'à ce que l'événement 'Stop' arrive.",
38
+ "State configurations": "Configurations d'état",
39
+ "Generate simple 'Press' and 'Release' states": "Générer des états simples « Presser » et « Relâcher »",
40
+ "When enabled, the 'Press' and 'Release' states are combined and the 'Press' data point remains true until the 'Release' event arrives.": "Lorsqu'ils sont activés, les états « Press » et « Release » sont combinés et le point de données « Press » reste vrai jusqu'à ce que l'événement « Release » arrive.",
41
+ "If the size is later changed to a larger value, the images already downloaded must be deleted. <br> Please note that icons are stored in the object and should therefore not be unnecessarily large!": "Si la taille est ultérieurement modifiée pour une valeur plus grande, les images déjà téléchargées doivent être supprimées. <br> Veuillez noter que les icônes sont stockées dans l'objet et ne doivent donc pas être inutilement grandes !"
33
42
  }
@@ -29,5 +29,14 @@
29
29
  "Scheme": "schema",
30
30
  "Use MQTT Credentials": "Usa le credenziali MQTT",
31
31
  "MQTT Username": "Nome utente MQTT",
32
- "MQTT Password": "Password MQTT"
32
+ "MQTT Password": "Password MQTT",
33
+ "Download device images from Zigbee2Mqtt and use them as object icons.": "Scarica le immagini del dispositivo da Zigbee2Mqtt e usale come icone degli oggetti.",
34
+ "Generate simple 'Hold' and 'Release' states": "Genera semplici stati \"Hold\" e \"Release\".",
35
+ "When enabled, the 'Hold' and 'Release' states are combined and the 'Hold' data point remains true until the 'Release' event arrives.": "Se abilitato, gli stati \"Hold\" e \"Release\" vengono combinati e il punto dati \"Hold\" rimane vero fino all'arrivo dell'evento \"Release\".",
36
+ "Generate simple 'Move' and 'Stop' states": "Genera semplici stati 'Move' e 'Stop'",
37
+ "When enabled, the 'Move' and 'Stop' states are combined and the 'Move' data point remains true until the 'Stop' event arrives.": "Se abilitato, gli stati 'Move' e 'Stop' vengono combinati e il punto dati 'Move' rimane vero fino all'arrivo dell'evento 'Stop'.",
38
+ "State configurations": "Configurazioni di stato",
39
+ "Generate simple 'Press' and 'Release' states": "Genera semplici stati \"Stampa\" e \"Rilascio\".",
40
+ "When enabled, the 'Press' and 'Release' states are combined and the 'Press' data point remains true until the 'Release' event arrives.": "Se abilitati, gli stati \"Press\" e \"Rilascio\" vengono combinati e il punto dati \"Press\" rimane vero fino all'arrivo dell'evento \"Rilascio\".",
41
+ "If the size is later changed to a larger value, the images already downloaded must be deleted. <br> Please note that icons are stored in the object and should therefore not be unnecessarily large!": "Se la dimensione viene successivamente modificata con un valore maggiore, le immagini già scaricate dovranno essere cancellate. <br> Tieni presente che le icone sono memorizzate nell'oggetto e quindi non dovrebbero essere inutilmente grandi!"
33
42
  }
@@ -29,5 +29,14 @@
29
29
  "Scheme": "Schema",
30
30
  "Use MQTT Credentials": "Gebruik MQTT-referenties",
31
31
  "MQTT Username": "MQTT-gebruikersnaam",
32
- "MQTT Password": "MQTT-wachtwoord"
32
+ "MQTT Password": "MQTT-wachtwoord",
33
+ "Download device images from Zigbee2Mqtt and use them as object icons.": "Download apparaatafbeeldingen van Zigbee2Mqtt en gebruik ze als objectpictogrammen.",
34
+ "Generate simple 'Hold' and 'Release' states": "Genereer eenvoudige 'Hold' en 'Release' statussen",
35
+ "When enabled, the 'Hold' and 'Release' states are combined and the 'Hold' data point remains true until the 'Release' event arrives.": "Indien ingeschakeld, worden de toestanden 'Hold' en 'Release' gecombineerd en blijft het datapunt 'Hold' waar totdat de 'Release'-gebeurtenis arriveert.",
36
+ "Generate simple 'Move' and 'Stop' states": "Genereer eenvoudige 'Move' en 'Stop' toestanden",
37
+ "When enabled, the 'Move' and 'Stop' states are combined and the 'Move' data point remains true until the 'Stop' event arrives.": "Indien ingeschakeld, worden de toestanden 'Verplaatsen' en 'Stop' gecombineerd en blijft het gegevenspunt 'Verplaatsen' waar totdat de gebeurtenis 'Stop' arriveert.",
38
+ "State configurations": "Staat configuraties",
39
+ "Generate simple 'Press' and 'Release' states": "Genereer eenvoudige 'Druk'- en 'loslaat'-statussen",
40
+ "When enabled, the 'Press' and 'Release' states are combined and the 'Press' data point remains true until the 'Release' event arrives.": "Indien ingeschakeld, worden de statussen 'Press' en 'Release' gecombineerd en blijft het datapunt 'Press' waar totdat de gebeurtenis 'Release' arriveert.",
41
+ "If the size is later changed to a larger value, the images already downloaded must be deleted. <br> Please note that icons are stored in the object and should therefore not be unnecessarily large!": "Als de grootte later wordt gewijzigd naar een grotere waarde, moeten de reeds gedownloade afbeeldingen worden verwijderd. <br> Let op: iconen worden in het object opgeslagen en mogen dus niet onnodig groot zijn!"
33
42
  }
@@ -29,5 +29,14 @@
29
29
  "Scheme": "Schemat",
30
30
  "Use MQTT Credentials": "Użyj poświadczeń MQTT",
31
31
  "MQTT Username": "Nazwa użytkownika MQTT",
32
- "MQTT Password": "Hasło MQTT"
32
+ "MQTT Password": "Hasło MQTT",
33
+ "Download device images from Zigbee2Mqtt and use them as object icons.": "Pobierz obrazy urządzeń z Zigbee2Mqtt i użyj ich jako ikon obiektów.",
34
+ "Generate simple 'Hold' and 'Release' states": "Generuj proste stany „Wstrzymaj” i „Zwolnij”.",
35
+ "When enabled, the 'Hold' and 'Release' states are combined and the 'Hold' data point remains true until the 'Release' event arrives.": "Po włączeniu stany „Wstrzymaj” i „Zwolnij” są łączone, a punkt danych „Wstrzymaj” pozostaje prawdziwy do momentu nadejścia zdarzenia „Zwolnij”.",
36
+ "Generate simple 'Move' and 'Stop' states": "Generuj proste stany „Przenieś” i „Zatrzymaj”.",
37
+ "When enabled, the 'Move' and 'Stop' states are combined and the 'Move' data point remains true until the 'Stop' event arrives.": "Po włączeniu stany „Przenieś” i „Zatrzymaj” są łączone, a punkt danych „Przenieś” pozostaje prawdziwy do momentu nadejścia zdarzenia „Zatrzymaj”.",
38
+ "State configurations": "Konfiguracje stanów",
39
+ "Generate simple 'Press' and 'Release' states": "Generuj proste stany „Naciśnij” i „Zwolnij”.",
40
+ "When enabled, the 'Press' and 'Release' states are combined and the 'Press' data point remains true until the 'Release' event arrives.": "Po włączeniu stany „Naciśnij” i „Zwolnij” są łączone, a punkt danych „Naciśnij” pozostaje prawdziwy do momentu pojawienia się zdarzenia „Zwolnij”.",
41
+ "If the size is later changed to a larger value, the images already downloaded must be deleted. <br> Please note that icons are stored in the object and should therefore not be unnecessarily large!": "Jeśli rozmiar zostanie później zmieniony na większy, już pobrane obrazy muszą zostać usunięte. <br> Należy pamiętać, że ikony są przechowywane w obiekcie i dlatego nie powinny być niepotrzebnie duże!"
33
42
  }
@@ -29,5 +29,14 @@
29
29
  "Scheme": "Esquema",
30
30
  "Use MQTT Credentials": "Usar credenciais MQTT",
31
31
  "MQTT Username": "Nome de usuário MQTT",
32
- "MQTT Password": "Senha do MQTT"
32
+ "MQTT Password": "Senha do MQTT",
33
+ "Download device images from Zigbee2Mqtt and use them as object icons.": "Baixe imagens de dispositivos do Zigbee2Mqtt e use-as como ícones de objetos.",
34
+ "Generate simple 'Hold' and 'Release' states": "Gerar estados simples 'Hold' e 'Release'",
35
+ "When enabled, the 'Hold' and 'Release' states are combined and the 'Hold' data point remains true until the 'Release' event arrives.": "Quando ativado, os estados 'Hold' e 'Release' são combinados e o ponto de dados 'Hold' permanece verdadeiro até que o evento 'Release' chegue.",
36
+ "Generate simple 'Move' and 'Stop' states": "Gerar estados simples 'Mover' e 'Parar'",
37
+ "When enabled, the 'Move' and 'Stop' states are combined and the 'Move' data point remains true until the 'Stop' event arrives.": "Quando ativado, os estados 'Mover' e 'Parar' são combinados e o ponto de dados 'Mover' permanece verdadeiro até que o evento 'Parar' chegue.",
38
+ "State configurations": "configurações de estado",
39
+ "Generate simple 'Press' and 'Release' states": "Gere estados simples de 'Pressionar' e 'Liberar'",
40
+ "When enabled, the 'Press' and 'Release' states are combined and the 'Press' data point remains true until the 'Release' event arrives.": "Quando ativado, os estados 'Press' e 'Release' são combinados e o ponto de dados 'Press' permanece verdadeiro até que o evento 'Release' chegue.",
41
+ "If the size is later changed to a larger value, the images already downloaded must be deleted. <br> Please note that icons are stored in the object and should therefore not be unnecessarily large!": "Se o tamanho for alterado posteriormente para um valor maior, as imagens já baixadas deverão ser excluídas. <br> Observe que os ícones são armazenados no objeto e, portanto, não devem ser desnecessariamente grandes!"
33
42
  }
@@ -29,5 +29,14 @@
29
29
  "Scheme": "Схема",
30
30
  "Use MQTT Credentials": "Используйте учетные данные MQTT",
31
31
  "MQTT Username": "Имя пользователя MQTT",
32
- "MQTT Password": "MQTT-пароль"
32
+ "MQTT Password": "MQTT-пароль",
33
+ "Download device images from Zigbee2Mqtt and use them as object icons.": "Загрузите изображения устройств с Zigbee2Mqtt и используйте их в качестве значков объектов.",
34
+ "Generate simple 'Hold' and 'Release' states": "Создавайте простые состояния «Hold» и «Release»",
35
+ "When enabled, the 'Hold' and 'Release' states are combined and the 'Hold' data point remains true until the 'Release' event arrives.": "Когда эта функция включена, состояния «Hold» и «Release» объединяются, а точка данных «Hold» остается истинной до тех пор, пока не наступит событие «Release».",
36
+ "Generate simple 'Move' and 'Stop' states": "Создавайте простые состояния «Переместить» и «Стоп»",
37
+ "When enabled, the 'Move' and 'Stop' states are combined and the 'Move' data point remains true until the 'Stop' event arrives.": "Когда эта функция включена, состояния «Перемещение» и «Стоп» объединяются, и точка данных «Перемещение» остается истинной до тех пор, пока не наступит событие «Стоп».",
38
+ "State configurations": "Конфигурации состояния",
39
+ "Generate simple 'Press' and 'Release' states": "Создавайте простые состояния «Нажмите» и «Отпустите».",
40
+ "When enabled, the 'Press' and 'Release' states are combined and the 'Press' data point remains true until the 'Release' event arrives.": "Если этот параметр включен, состояния «Нажатие» и «Отпуск» объединяются, и точка данных «Нажатие» остается истинной до тех пор, пока не произойдет событие «Отпуск».",
41
+ "If the size is later changed to a larger value, the images already downloaded must be deleted. <br> Please note that icons are stored in the object and should therefore not be unnecessarily large!": "Если размер позже будет изменен на большее значение, уже загруженные изображения необходимо удалить. <br> Обратите внимание, что значки хранятся в объекте и поэтому не должны быть излишне большими!"
33
42
  }
@@ -29,5 +29,14 @@
29
29
  "Scheme": "Схема",
30
30
  "Use MQTT Credentials": "Використовуйте облікові дані MQTT",
31
31
  "MQTT Username": "Ім'я користувача MQTT",
32
- "MQTT Password": "Пароль MQTT"
32
+ "MQTT Password": "Пароль MQTT",
33
+ "Download device images from Zigbee2Mqtt and use them as object icons.": "Завантажуйте зображення пристроїв із Zigbee2Mqtt і використовуйте їх як значки об’єктів.",
34
+ "Generate simple 'Hold' and 'Release' states": "Створюйте прості стани «Утримувати» та «Відпускати».",
35
+ "When enabled, the 'Hold' and 'Release' states are combined and the 'Hold' data point remains true until the 'Release' event arrives.": "Якщо ввімкнено, стани «Утримувати» та «Вивільнити» об’єднуються, а точка даних «Утримувати» залишається істинною, доки не надійде подія «Вивільнення».",
36
+ "Generate simple 'Move' and 'Stop' states": "Створення простих станів «Переміщення» та «Зупинка».",
37
+ "When enabled, the 'Move' and 'Stop' states are combined and the 'Move' data point remains true until the 'Stop' event arrives.": "Якщо ввімкнено, стани «Переміщення» та «Зупинити» поєднуються, а точка даних «Переміщення» залишається істинною, доки не надійде подія «Зупинити».",
38
+ "State configurations": "Конфігурації стану",
39
+ "Generate simple 'Press' and 'Release' states": "Створення простих станів «Натиснути» та «Випустити».",
40
+ "When enabled, the 'Press' and 'Release' states are combined and the 'Press' data point remains true until the 'Release' event arrives.": "Якщо ввімкнено, стани «Натиснути» та «Випустити» поєднуються, а точка даних «Натиснути» залишається істинною, доки не надійде подія «Випуск».",
41
+ "If the size is later changed to a larger value, the images already downloaded must be deleted. <br> Please note that icons are stored in the object and should therefore not be unnecessarily large!": "Якщо пізніше розмір буде змінено на більше, уже завантажені зображення необхідно видалити. <br> Зверніть увагу, що піктограми зберігаються в об'єкті, тому вони не повинні бути надмірно великими!"
33
42
  }
@@ -29,5 +29,14 @@
29
29
  "Scheme": "方案",
30
30
  "Use MQTT Credentials": "使用 MQTT 凭证",
31
31
  "MQTT Username": "MQTT 用户名",
32
- "MQTT Password": "MQTT 密码"
32
+ "MQTT Password": "MQTT 密码",
33
+ "Download device images from Zigbee2Mqtt and use them as object icons.": "从 Zigbee2Mqtt 下载设备图像并将其用作对象图标。",
34
+ "Generate simple 'Hold' and 'Release' states": "生成简单的“保持”和“释放”状态",
35
+ "When enabled, the 'Hold' and 'Release' states are combined and the 'Hold' data point remains true until the 'Release' event arrives.": "启用后,“保持”和“释放”状态会结合在一起,并且“保持”数据点保持为真,直到“释放”事件到达。",
36
+ "Generate simple 'Move' and 'Stop' states": "生成简单的“移动”和“停止”状态",
37
+ "When enabled, the 'Move' and 'Stop' states are combined and the 'Move' data point remains true until the 'Stop' event arrives.": "启用后,“移动”和“停止”状态将组合在一起,并且“移动”数据点保持为真,直到“停止”事件到达。",
38
+ "State configurations": "状态配置",
39
+ "Generate simple 'Press' and 'Release' states": "生成简单的“按下”和“释放”状态",
40
+ "When enabled, the 'Press' and 'Release' states are combined and the 'Press' data point remains true until the 'Release' event arrives.": "启用后,“按下”和“释放”状态将组合在一起,并且“按下”数据点保持为真,直到“释放”事件到达。",
41
+ "If the size is later changed to a larger value, the images already downloaded must be deleted. <br> Please note that icons are stored in the object and should therefore not be unnecessarily large!": "如果稍后将大小更改为更大的值,则必须删除已下载的图像。 <br> 请注意,图标存储在对象中,因此不应过大!"
33
42
  }
@@ -186,12 +186,30 @@
186
186
  "label": "Use Kelvin instead of mired for the color temps",
187
187
  "newLine": true
188
188
  },
189
- "otherHeader": {
189
+ "stateHeader": {
190
190
  "type": "header",
191
- "text": "Other configurations",
191
+ "text": "State configurations",
192
192
  "size": 2,
193
193
  "newLine": true
194
194
  },
195
+ "simpleHoldReleaseState": {
196
+ "type": "checkbox",
197
+ "label": "Generate simple 'Hold' and 'Release' states",
198
+ "help": "When enabled, the 'Hold' and 'Release' states are combined and the 'Hold' data point remains true until the 'Release' event arrives.",
199
+ "newLine": true
200
+ },
201
+ "simpleMoveStopState": {
202
+ "type": "checkbox",
203
+ "label": "Generate simple 'Move' and 'Stop' states",
204
+ "help": "When enabled, the 'Move' and 'Stop' states are combined and the 'Move' data point remains true until the 'Stop' event arrives.",
205
+ "newLine": true
206
+ },
207
+ "simplePressReleaseState": {
208
+ "type": "checkbox",
209
+ "label": "Generate simple 'Press' and 'Release' states",
210
+ "help": "When enabled, the 'Press' and 'Release' states are combined and the 'Press' data point remains true until the 'Release' event arrives.",
211
+ "newLine": true
212
+ },
195
213
  "brightnessMoveOnOff": {
196
214
  "type": "checkbox",
197
215
  "label": "Brightness move should also turn the light on or off",
@@ -202,6 +220,30 @@
202
220
  "label": "Brightness step should also turn the light on or off",
203
221
  "newLine": true
204
222
  },
223
+ "imageHeader": {
224
+ "type": "header",
225
+ "text": "Device image configurations",
226
+ "size": 2,
227
+ "newLine": true
228
+ },
229
+ "useDeviceIcons": {
230
+ "type": "checkbox",
231
+ "label": "Download device images from Zigbee2Mqtt and use them as object icons.",
232
+ "help": "If the size is later changed to a larger value, the images already downloaded must be deleted. <br> Please note that icons are stored in the object and should therefore not be unnecessarily large!",
233
+ "newLine": true
234
+ },
235
+ "deviceIconsSize": {
236
+ "type": "number",
237
+ "label": "Size of the object icons in pixels",
238
+ "min": 8,
239
+ "newLine": true
240
+ },
241
+ "otherHeader": {
242
+ "type": "header",
243
+ "text": "Other configurations",
244
+ "size": 2,
245
+ "newLine": true
246
+ },
205
247
  "proxyZ2MLogs": {
206
248
  "type": "checkbox",
207
249
  "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.10.1",
4
+ "version": "2.12.0",
5
5
  "news": {
6
+ "2.12.0": {
7
+ "en": "added option `Size of the object icons in pixels`",
8
+ "de": "zusätzliche Option ` Größe der Objektsymbole in Pixeln`",
9
+ "ru": "добавлена опция `Размер иконок объекта в пикселях`",
10
+ "pt": "opção adicionada `Tamanho dos ícones do objeto em pixels`",
11
+ "nl": "voegde optie van het object in pixels",
12
+ "fr": "option ajoutée ` Taille de l'objet icônes en pixels`",
13
+ "it": "opzione aggiunta `Size delle icone dell'oggetto in pixel`",
14
+ "es": "opción agregada `Tamaño de los iconos objeto en pixels`",
15
+ "pl": "dodano opcję `Size of the object icons in pixels'",
16
+ "uk": "додано опцію `Size іконок об’єкта у пікселях`",
17
+ "zh-cn": "添加了“白盔”的选项。"
18
+ },
19
+ "2.11.0": {
20
+ "en": "added automatic download of device image from zigbee2mqtt to meta-storage\nadded option `Download device images from Zigbee2Mqtt and use them as object icons.`\nfixed Hue_Move \nadded option `Generate simple 'Hold' and 'Release' states`\nadded option `Generate simple 'Move' and 'Stop' states`\nadded option `Generate simple 'Press' and 'Release' states`",
21
+ "de": "automatischer download des gerätebildes von zigbee2mqtt zu meta-storage\n` Gerätebilder von Zigbee2Mqtt herunterladen und als Objektsymbole verwenden. `\nhue_Move\nzusatzoption `Generieren Sie einfache Halte- und Freigabezustände `\nzusätzliche Option `Generieren Sie einfache Verschiebe- und Stopp-Zustände `\nzusätzliche Option `Generieren Sie einfache Presse- und Freigabezustände `",
22
+ "ru": "добавлена автоматическая загрузка изображения устройства от zigbee2mqtt до meta-storage\nдобавлена опция `Скачать изображения устройства от Zigbee2Mqtt и использовать их как иконки объекта. »\nфиксированный Hue_Move\nдобавлена опция `Generate simple Hold and Release состояния »\nдобавлена опция `Generate simple Move and Stop состояния`\nдобавлена опция `Generate simple Press and Release состояния »",
23
+ "pt": "adicionado download automático da imagem do dispositivo de zigbee2mqtt para meta-armazenagem\nopção adicionada `Baixar imagens de dispositivo de Zigbee2Mqtt e usá-las como ícones de objeto. \"\nfixo Hue_Move\nopção adicionada `Gerar simples Hold and Release states \"\nopção adicionada `Gerar simples Mover e parar estados`\nopção adicionada `Gerar estados simples de imprensa e lançamento \"",
24
+ "nl": "voegde automatische download van het apparaat van zigbee2mqt toe aan meta-storage\nvoegde optie 'Download apparatuur van Zigbee2Mqt toe en gebruik ze als object iconen. _\nvertaling:\nvoegde optie 'Generate Sim Hold and Release staten _\nvoegde optie \"Generate Sim Move and Stop states\"\nvoegde optie 'Generate Sim Press and Release staten _",
25
+ "fr": "téléchargement automatique de l'image de périphérique de zigbee2mqt à meta-storage\noption ajoutée `Télécharger les images de périphérique de Zigbee2Mqt et les utiliser comme des icônes d'objet. `\nhue_Move\noption ajoutée `Generate simple Hold and Release états `\noption ajoutée `Generate simple Déplacer et arrêter les états`\noption ajoutée `Generate simple Press et les états de publication `",
26
+ "it": "download automatico dell'immagine del dispositivo da zigbee2mqt a meta-storage\nopzione aggiunta `Scaricare le immagini del dispositivo da Zigbee2Mqt e usarle come icone dell'oggetto. #\nfisso Hue_Move\nopzione aggiunta `Generate simple Hold and Release stati #\nopzione aggiunta `Generate simple Move and Stop stati`\nopzione aggiunta `Generate simple Press and Release stati #",
27
+ "es": "añadido descarga automática de la imagen del dispositivo desde zigbee2mqt a meta-storage\nopción agregada `Descargar imágenes de dispositivo de Zigbee2Mqtt y utilizarlas como iconos de objetos. `\nhue_Move fijo\nopción agregada `Generate simple Hold and Release states `\nopción agregada `Generate simple Move and Stop states`\nopción agregada `Generate simple Estados de prensa y liberación `",
28
+ "pl": "dodał automatyczny pobranie obrazu zigbee2mqtt na meta-storage\ndodał dodatki do opcjonalnych zdjęć z Zigbee2Mqtt i używał ich jako ikon obiektowych. `\nugruntowany\ndodano opcjonalne stany Hold i Release. `\ndodano możliwość generowanego prostego Move'a i Stop states'\ndodał opcję \"Generate simple Press and Release states\". `",
29
+ "uk": "додано автоматичне завантаження зображення пристрою з zigbee2mqtt до мета-сторage\nдодано опцію `Завантажити зображення пристроїв з Zigbee2Mqtt і використовувати їх як іконки об'єкта. й\nфіксована Hue_Move\nдодано варіант `Generate simple Hold and Release State й\nдодано варіант `Generate Simple Move and Stop State`\nдодано варіант `Generate simple Press and Release State й",
30
+ "zh-cn": "加上自齐格贝德二米克特自动下载器图像\n添加了“Zigbee2Mqt的载荷装置图像”的备选办法,并将这些图像作为目标。 目 录\n固定的He_Move\n增加“简单的霍乱和释放国”的选择 目 录\n增加“简单的摩托和托儿”\n增加的“简单新闻”选择 目 录"
31
+ },
6
32
  "2.10.1": {
7
33
  "en": "fix type definitions (thx @arteck)",
8
34
  "de": "fix typdefinitionen (thx @arteck)",
@@ -67,32 +93,6 @@
67
93
  "pl": "dodano stan ostatni_seen:/time of last Zigbee message #131(https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/131)",
68
94
  "uk": "додано стан last_seen містить дату/час останнього повідомлення Zigbee [#131](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/131)",
69
95
  "zh-cn": "添加国家:见最后Zigbee信息的日期/时间[第131号](http://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/131)"
70
- },
71
- "2.7.4": {
72
- "en": "fix for Aqara presence detector FP1 `reset_nopresence_status`",
73
- "de": "fix für Aqara Präsenzmelder FP1 reset_nopresence_status",
74
- "ru": "фикс для Aqara детектор присутствия FP1 reset_nopresence_status",
75
- "pt": "correção para o detector de presença de Aqara FP1 reset_nopresence_status",
76
- "nl": "vertaling:",
77
- "fr": "fix pour détecteur de présence Aqara FP1 reset_nopresence_status",
78
- "it": "correzione per rilevatore di presenza Aqara FP1 reset_nopresence_status",
79
- "es": "fijado para el detector de presencia Aqara FP1 reset_nopresence_status",
80
- "pl": "reset_nopresence_status (ang.)",
81
- "uk": "фіксація для датчика присутності Aqara FP1 скидання_nopresence_status",
82
- "zh-cn": "fix Aqara存在探测器FP1 重新定位_nopreence_status"
83
- },
84
- "2.7.3": {
85
- "en": "hotfix for Aqara presence detector FP1",
86
- "de": "hotfix für Aqara Präsenzmelder FP1",
87
- "ru": "hotfix для детектора присутствия Aqara FP1",
88
- "pt": "hotfix para detector de presença Aqara FP1",
89
- "nl": "quality over Quanteur FP1",
90
- "fr": "hotfix pour détecteur de présence Aqara FP1",
91
- "it": "hotfix per rilevatore di presenza Aqara FP1",
92
- "es": "hotfix para detector de presencia Aqara FP1",
93
- "pl": "hotfix",
94
- "uk": "hotfix для датчика присутності Aqara FP1",
95
- "zh-cn": "aqara存在侦查员FP1"
96
96
  }
97
97
  },
98
98
  "messages": [
@@ -247,7 +247,12 @@
247
247
  "colorTempSyncColor": false,
248
248
  "brightnessMoveOnOff": false,
249
249
  "brightnessStepOnOff": false,
250
- "useEventInDesc": true
250
+ "useEventInDesc": true,
251
+ "useDeviceIcons": false,
252
+ "deviceIconsSize": 28,
253
+ "simpleHoldReleaseState": true,
254
+ "simpleMoveStopState": false,
255
+ "simplePressReleaseState": false
251
256
  },
252
257
  "protectedNative": [
253
258
  "externalMqttServerPassword",
@@ -303,6 +308,27 @@
303
308
  "def": ""
304
309
  },
305
310
  "native": {}
311
+ },
312
+ {
313
+ "_id": "",
314
+ "type": "meta",
315
+ "common": {
316
+ "name": {
317
+ "en": "File storage",
318
+ "de": "Dateispeicher",
319
+ "ru": "Хранение файлов",
320
+ "pt": "Armazenamento de arquivos",
321
+ "nl": "Veldopslag",
322
+ "fr": "Stockage de fichiers",
323
+ "it": "Archiviazione file",
324
+ "es": "Almacenamiento de archivos",
325
+ "pl": "Storage room",
326
+ "uk": "Зберігання файлів",
327
+ "zh-cn": "储存"
328
+ },
329
+ "type": "meta.user"
330
+ },
331
+ "native": {}
306
332
  }
307
333
  ]
308
334
  }
@@ -3,6 +3,7 @@ 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');
6
+ const ImageController = require('./imageController').ImageController;
6
7
 
7
8
  class DeviceController {
8
9
  constructor(adapter, deviceCache, groupCache, config, logCustomizations, createCache) {
@@ -12,9 +13,10 @@ class DeviceController {
12
13
  this.config = config;
13
14
  this.logCustomizations = logCustomizations;
14
15
  this.createCache = createCache;
16
+ this.imageController = new ImageController(adapter);
15
17
  }
16
18
 
17
- createDeviceDefinitions(devicesMessage) {
19
+ async createDeviceDefinitions(devicesMessage) {
18
20
  utils.clearArray(this.deviceCache);
19
21
  for (const devicesMessag of devicesMessage) {
20
22
  if (this.logCustomizations.debugDevices.includes(devicesMessag.ieee_address)) {
@@ -27,14 +29,14 @@ class DeviceController {
27
29
 
28
30
  if (devicesMessag.definition.exposes) {
29
31
  try {
30
- const newDevice = createDeviceFromExposes(devicesMessag, this.config);
32
+ const newDevice = await createDeviceFromExposes(devicesMessag, this.adapter);
33
+ newDevice.icon = await this.imageController.getDeviceIcon(devicesMessag);
31
34
  this.deviceCache.push(newDevice);
32
35
  } catch (err) {
33
36
  this.adapter.log.warn(`Cannot ${devicesMessag.friendly_name} create Device from Exposes!`);
34
37
  this.adapter.log.debug(JSON.stringify(devicesMessag));
35
38
  this.adapter.log.debug(err);
36
39
  }
37
-
38
40
  }
39
41
  }
40
42
  }
@@ -47,7 +49,7 @@ class DeviceController {
47
49
  const newDevice = {
48
50
  id: groupID,
49
51
  ieee_address: ieee_address,
50
- icon: undefined,
52
+ icon: undefined, // await imageController.getDeviceIcon(devicesMessag), device.definition.model
51
53
  optionsValues: {},
52
54
  states: [
53
55
  states.brightness,
@@ -239,6 +241,7 @@ class DeviceController {
239
241
  const deviceObj = {
240
242
  type: 'device',
241
243
  common: {
244
+ icon: device.icon,
242
245
  name: deviceName,
243
246
  desc: description,
244
247
  statusStates: { onlineId: '' }
package/lib/exposes.js CHANGED
@@ -171,9 +171,10 @@ function genState(expose, role, name, desc) {
171
171
  return state;
172
172
  }
173
173
 
174
- function createDeviceFromExposes(devicesMessag, config) {
174
+ async function createDeviceFromExposes(devicesMessag, adapter) {
175
175
  const states = [];
176
176
  let scenes = [];
177
+ const config = adapter.config;
177
178
  const deviceID = devicesMessag.friendly_name;
178
179
  const ieee_address = devicesMessag.ieee_address;
179
180
  const definition = devicesMessag.definition;
@@ -181,6 +182,7 @@ function createDeviceFromExposes(devicesMessag, config) {
181
182
  const disabled = devicesMessag.disabled && devicesMessag.disabled == true;
182
183
  const description = devicesMessag.description ? devicesMessag.description : undefined;
183
184
 
185
+
184
186
  function pushToStates(state, access) {
185
187
  if (state === undefined) {
186
188
  return 0;
@@ -663,17 +665,25 @@ function createDeviceFromExposes(devicesMessag, config) {
663
665
  break;
664
666
  }
665
667
 
666
- const hasHold = expose.values.find((actionName) => actionName.includes('hold'));
667
- const hasRelease = expose.values.find((actionName) => actionName.includes('release'));
668
-
669
668
  for (const actionName of expose.values) {
670
- // is release state ? - skip
671
- if (hasHold && hasRelease && actionName.includes('release')) {
669
+
670
+ // is release -> hold state? - skip
671
+ if (config.simpleHoldReleaseState == true && actionName.endsWith('release') && expose.values.find((x) => x == actionName.replace('release', 'hold'))) {
672
+ continue;
673
+ }
674
+
675
+ // is stop - move state? - skip
676
+ if (config.simpleMoveStopState == true && actionName.endsWith('stop') && expose.values.find((x) => x.includes(actionName.replace('stop', 'move')))) {
677
+ continue;
678
+ }
679
+
680
+ // is release -> press state? - skip
681
+ if (config.simplePressReleaseState == true && actionName.endsWith('release') && expose.values.find((x) => x == actionName.replace('release', 'press'))) {
672
682
  continue;
673
683
  }
674
684
 
675
- // is hold state ?
676
- if (hasHold && hasRelease && actionName.includes('hold')) {
685
+ // is hold -> release state ?
686
+ if (config.simpleHoldReleaseState == true && actionName.endsWith('hold') && expose.values.find((x) => x == actionName.replace('hold', 'release'))) {
677
687
  pushToStates({
678
688
  id: actionName.replace(/\*/g, ''),
679
689
  prop: 'action',
@@ -698,6 +708,52 @@ function createDeviceFromExposes(devicesMessag, config) {
698
708
  },
699
709
  }, expose.access);
700
710
  }
711
+ // is move -> stop state ?
712
+ else if (config.simpleMoveStopState == true && actionName.includes('move') && expose.values.find((x) => x == `${actionName.split('_')[0]}_stop`)) {
713
+ pushToStates({
714
+ id: actionName.replace(/\*/g, ''),
715
+ prop: 'action',
716
+ name: actionName,
717
+ icon: undefined,
718
+ role: 'button',
719
+ write: false,
720
+ read: true,
721
+ def: false,
722
+ type: 'boolean',
723
+ getter: (payload) => {
724
+ if (payload.action === actionName) {
725
+ return true;
726
+ }
727
+ if (payload.action === `${actionName.split('_')[0]}_stop`) {
728
+ return false;
729
+ }
730
+ return undefined;
731
+ },
732
+ }, expose.access);
733
+ }
734
+ // is press -> release state ?
735
+ else if (config.simplePressReleaseState == true && actionName.endsWith('press') && expose.values.find((x) => x == actionName.replace('press', 'release'))) {
736
+ pushToStates({
737
+ id: actionName.replace(/\*/g, ''),
738
+ prop: 'action',
739
+ name: actionName,
740
+ icon: undefined,
741
+ role: 'button',
742
+ write: false,
743
+ read: true,
744
+ def: false,
745
+ type: 'boolean',
746
+ getter: (payload) => {
747
+ if (payload.action === actionName) {
748
+ return true;
749
+ }
750
+ if (payload.action === actionName.replace('press', 'release')) {
751
+ return false;
752
+ }
753
+ return undefined;
754
+ },
755
+ }, expose.access);
756
+ }
701
757
  else if (actionName == 'color_temperature_move') {
702
758
  pushToStates({
703
759
  id: 'color_temperature_move',
@@ -810,32 +866,32 @@ function createDeviceFromExposes(devicesMessag, config) {
810
866
  }
811
867
  }, expose.access);
812
868
  }
813
- else if (actionName == 'hue_move') {
814
- pushToStates({
815
- id: 'hue_move',
816
- name: 'Hue move rate',
817
- icon: undefined,
818
- role: 'level.color.hue',
819
- write: false,
820
- read: true,
821
- type: 'number',
822
- min: 0,
823
- max: 360,
824
- def: 0,
825
- isEvent: true,
826
- getter: (payload) => {
827
- if (payload.action != 'hue_move') {
828
- return undefined;
829
- }
830
-
831
- if (payload.action_level) {
832
- return payload.action_rate;
833
- } else {
834
- return undefined;
835
- }
836
- }
837
- }, expose.access);
838
- }
869
+ // else if (actionName == 'hue_move') {
870
+ // pushToStates({
871
+ // id: 'hue_move',
872
+ // name: 'Hue move rate',
873
+ // icon: undefined,
874
+ // role: 'level.color.hue',
875
+ // write: false,
876
+ // read: true,
877
+ // type: 'number',
878
+ // min: 0,
879
+ // max: 360,
880
+ // def: 0,
881
+ // isEvent: true,
882
+ // getter: (payload) => {
883
+ // if (payload.action != 'hue_move') {
884
+ // return undefined;
885
+ // }
886
+
887
+ // if (payload.action_level) {
888
+ // return payload.action_level;
889
+ // } else {
890
+ // return undefined;
891
+ // }
892
+ // }
893
+ // }, expose.access);
894
+ // }
839
895
  else {
840
896
  pushToStates({
841
897
  id: actionName.replace(/\*/g, ''),
@@ -0,0 +1,111 @@
1
+ const axios = require('axios').default;
2
+ const sharp = require('sharp');
3
+
4
+ class ImageController {
5
+ constructor(adapter) {
6
+ this.adapter = adapter;
7
+ }
8
+
9
+ sanitizeModelIDForImageUrl(modelName) {
10
+ return modelName.replace('/', '_');
11
+ }
12
+
13
+ sanitizeZ2MDeviceName(deviceName) {
14
+ return deviceName ? deviceName.replace(/:|\s|\//g, '-') : 'NA';
15
+ }
16
+
17
+ getZ2mDeviceImage(device) {
18
+ if (device && device.definition && device.definition.model) {
19
+ return `https://www.zigbee2mqtt.io/images/devices/${this.sanitizeZ2MDeviceName(device.definition.model)}.jpg`;
20
+ }
21
+ }
22
+
23
+ getSlsDeviceImage(device) {
24
+ if (device && device.model_id) {
25
+ return `https://slsys.github.io/Gateway/devices/png/${this.sanitizeModelIDForImageUrl(device.model_id)}.png`;
26
+ }
27
+ }
28
+
29
+ async getDeviceIcon(device) {
30
+ if (this.adapter.config.useDeviceIcons == false) {
31
+ return '';
32
+ }
33
+
34
+ const imageSize = this.adapter.config.deviceIconsSize;
35
+
36
+ const z2mIconFileName = `${this.sanitizeZ2MDeviceName(device.definition.model)}.jpg`;
37
+ const slsIconFileName = `${this.sanitizeModelIDForImageUrl(device.model_id)}.png`;
38
+
39
+ let icon;
40
+ let iconFileName;
41
+ // Check whether an image has already been downloaded from Z2M.
42
+ if (await this.adapter.fileExistsAsync(this.adapter.namespace, z2mIconFileName)) {
43
+ iconFileName = z2mIconFileName;
44
+ }
45
+ // Check whether an image has already been downloaded from SLSys.
46
+ else if (await this.adapter.fileExistsAsync(this.adapter.namespace, slsIconFileName)) {
47
+ iconFileName = slsIconFileName;
48
+ }
49
+ // If not donwload image
50
+ else {
51
+ let iconUrl = this.getZ2mDeviceImage(device);
52
+ if (!iconUrl) {
53
+ iconUrl = this.getSlsDeviceImage(device);
54
+ }
55
+ this.adapter.log.info(`Download image for device model: ${device.definition.model}`);
56
+ await this.downloadIcon(this.adapter, iconUrl, this.adapter.namespace);
57
+ iconFileName = this.getFileNameWithExtension(iconUrl);
58
+ }
59
+
60
+ if ((await this.adapter.fileExistsAsync(this.adapter.namespace, iconFileName)) == false) {
61
+ this.adapter.log.warn(`No image for device model: ${device.definition.model} found!`);
62
+ return '';
63
+ }
64
+
65
+ try {
66
+ // Load image from the Meta-Store
67
+ icon = await this.adapter.readFileAsync(this.adapter.namespace, iconFileName);
68
+ // Load Image Metadata
69
+ const origIconMeta = await sharp(icon.file).metadata();
70
+ // Check whether the image needs to be resized
71
+ if ((origIconMeta.height && origIconMeta.height > imageSize) || (origIconMeta.width && origIconMeta.width > imageSize)) {
72
+ // Resize image to 28x28 pixel
73
+ this.adapter.log.info(`Resize image for device model ${device.definition.model} from: ${origIconMeta.width}x${origIconMeta.height} to ${imageSize}x${imageSize}`);
74
+ icon.file = await sharp(icon.file)
75
+ .resize({
76
+ width: imageSize,
77
+ height: imageSize,
78
+ fit: sharp.fit.cover,
79
+ position: sharp.strategy.entropy
80
+ })
81
+ .toBuffer();
82
+ // Replace the original image with the resize image.
83
+ await this.adapter.writeFileAsync(this.adapter.namespace, iconFileName, icon.file);
84
+ }
85
+ } catch (error) {
86
+ this.adapter.log.warn(error);
87
+ return '';
88
+ }
89
+ // Create and output Base64
90
+ return `data:image/png;base64,${icon.file.toString('base64')}`;
91
+
92
+ }
93
+ getFileNameWithExtension(url) {
94
+ const path = new URL(url).pathname;
95
+ const filename = path.split('/').pop();
96
+ return filename;
97
+ }
98
+
99
+ async downloadIcon(adapter, url, namespace) {
100
+ try {
101
+ const res = await axios.get(url, { responseType: 'arraybuffer' });
102
+ await adapter.writeFileAsync(namespace, this.getFileNameWithExtension(url), res.data);
103
+ }
104
+ catch (ex) {
105
+ adapter.log.warn(ex);
106
+ }
107
+ }
108
+ }
109
+ module.exports = {
110
+ ImageController,
111
+ };
package/lib/messages.js CHANGED
@@ -25,6 +25,14 @@ async function adapterInfo(config, log) {
25
25
  log.info(`|| Zigbee2MQTT Debug Log: ${config.debugLogEnabled ? 'activated' : 'deactivated'}`);
26
26
  log.info(`|| Proxy Zigbee2MQTT Logs to ioBroker Logs: ${config.proxyZ2MLogs ? 'activated' : 'deactivated'}`);
27
27
  log.info(`|| Use Kelvin: ${config.useKelvin ? 'yes' : 'no'}`);
28
+ log.info(`|| Use ColorTemperature ColorSync: ${config.colorTempSyncColor ? 'yes' : 'no'}`);
29
+ log.info(`|| Use BrightnessMove OnOff: ${config.brightnessMoveOnOff ? 'yes' : 'no'}`);
30
+ log.info(`|| Use BrightnessStep OnOff: ${config.brightnessStepOnOff ? 'yes' : 'no'}`);
31
+ log.info(`|| Use Event In Desc: ${config.useEventInDesc ? 'yes' : 'no'}`);
32
+ log.info(`|| Use Device Icons: ${config.useDeviceIcons ? 'yes' : 'no'}`);
33
+ log.info(`|| Use Simple Hold/Release State: ${config.simpleHoldReleaseState ? 'yes' : 'no'}`);
34
+ log.info(`|| Use Simple Move/Stop State: ${config.simpleMoveStopState ? 'yes' : 'no'}`);
35
+ log.info(`|| Use Simple Press/Release State: ${config.simplePressReleaseState ? 'yes' : 'no'}`);
28
36
  log.info('==================================================================================');
29
37
  }
30
38
 
@@ -61,7 +61,7 @@ class StatesController {
61
61
  if (state.prop && state.prop == 'action') {
62
62
  if (state.isEvent && state.isEvent == true) {
63
63
  if (state.type == 'boolean') {
64
- await this.setStateWithTimeoutAsync(stateName, state.getter(messageObj.payload), 300);
64
+ await this.setStateWithTimeoutAsync(stateName, state.getter(messageObj.payload), 450);
65
65
  }
66
66
  else {
67
67
  await this.setStateSafelyAsync(stateName, state.getter(messageObj.payload));
package/lib/utils.js CHANGED
@@ -88,24 +88,6 @@ function getAdId(adapter, id) {
88
88
  return adapter.namespace + '.' + id.split('.')[2]; // iobroker device id
89
89
  }
90
90
 
91
- function sanitizeImageParameter(parameter) {
92
- const replaceByDash = [/\?/g, /&/g, /[^a-z\d\-_./:]/gi, /[/]/gi];
93
- let sanitized = parameter;
94
- replaceByDash.forEach((r) => sanitized = sanitized.replace(r, '-'));
95
- return sanitized;
96
- }
97
-
98
- function getDeviceIcon(definition) {
99
- let icon = definition.icon;
100
- if (icon) {
101
- icon = icon.replace('${model}', sanitizeImageParameter(definition.model));
102
- }
103
- if (!icon) {
104
- icon = `https://www.zigbee2mqtt.io/images/devices/${sanitizeImageParameter(definition.model)}.jpg`;
105
- }
106
- return icon;
107
- }
108
-
109
91
  function clearArray(array) {
110
92
  while (array.length > 0) {
111
93
  array.pop();
@@ -142,7 +124,6 @@ module.exports = {
142
124
  decimalToHex,
143
125
  getZbId,
144
126
  getAdId,
145
- getDeviceIcon,
146
127
  clearArray,
147
128
  moveArray,
148
129
  isObject,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.zigbee2mqtt",
3
- "version": "2.10.1",
3
+ "version": "2.12.0",
4
4
  "description": "Zigbee2MQTT adapter for ioBroker",
5
5
  "author": {
6
6
  "name": "Dennis Rathjen",
@@ -22,8 +22,9 @@
22
22
  "@iobroker/adapter-core": "^3.0.3",
23
23
  "aedes": "^0.50.0",
24
24
  "aedes-persistence-nedb": "^2.0.3",
25
- "mqtt": "^5.0.2",
25
+ "mqtt": "^5.0.4",
26
26
  "net": "^1.0.2",
27
+ "sharp": "^0.32.5",
27
28
  "ws": "^8.13.0"
28
29
  },
29
30
  "devDependencies": {
@@ -37,21 +38,21 @@
37
38
  "@types/chai": "^4.3.5",
38
39
  "@types/chai-as-promised": "^7.1.5",
39
40
  "@types/mocha": "^10.0.1",
40
- "@types/node": "^20.4.10",
41
+ "@types/node": "^20.5.7",
41
42
  "@types/proxyquire": "^1.3.28",
42
43
  "@types/sinon": "^10.0.16",
43
44
  "@types/sinon-chai": "^3.2.9",
44
- "chai": "^4.3.7",
45
+ "chai": "^4.3.8",
45
46
  "chai-as-promised": "^7.1.1",
46
- "eslint": "^8.47.0",
47
+ "eslint": "^8.48.0",
47
48
  "eslint-config-prettier": "^9.0.0",
48
49
  "eslint-plugin-prettier": "^5.0.0",
49
50
  "mocha": "^10.2.0",
50
- "prettier": "^3.0.1",
51
+ "prettier": "^3.0.3",
51
52
  "proxyquire": "^2.1.3",
52
53
  "sinon": "^15.2.0",
53
54
  "sinon-chai": "^3.7.0",
54
- "typescript": "~5.1.6"
55
+ "typescript": "~5.2.2"
55
56
  },
56
57
  "main": "main.js",
57
58
  "files": [