iobroker.zigbee2mqtt 2.13.6 → 2.13.11

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
@@ -21,19 +21,30 @@ This adapter allows to control the data points of the devices of a Zigbee2MQTT i
21
21
 
22
22
  [Adapter Documentation](https://github.com/arteck/ioBroker.zigbee2mqtt/blob/main/docs/wiki.md)
23
23
 
24
+ ## Changelog
25
+ ### 2.13.11 (2024-10-17)
26
+ - (arteck) corr package.json
24
27
 
28
+ ### 2.13.10 (2024-09-05)
29
+ - (arteck) update dependecy
30
+ - (arteck) add available object for groups
25
31
 
26
- ## Changelog
32
+ ### 2.13.9 (2024-05-13)
33
+ - (arteck) fix lint
34
+ - (arteck) update dependecy
35
+
36
+ ### 2.13.9 (2024-05-13)
37
+ - (arteck) fix lint
38
+ - (arteck) update dependecy
39
+
40
+ ### 2.13.8 (2024-05-13)
41
+ - (arteck) fix icon path
42
+
43
+ ### 2.13.7 (2024-04-20)
44
+ - (arteck) core dependecy
45
+ - (arteck) update dependecy
46
+ - (pepp86) Enable occupancy to be always updated if true
27
47
 
28
- <!--
29
- https://github.com/AlCalzone/release-script#usage
30
- npm run release major -- -p iobroker license --all 0.9.8 -> 1.0.0
31
- npm run release minor -- -p iobroker license --all 0.9.8 -> 0.10.0
32
- npm run release patch -- -p iobroker license --all 0.9.8 -> 0.9.9
33
- npm run release prerelease beta -- -p iobroker license --all v0.2.1 -> v0.2.2-beta.0
34
- Placeholder for the next version (at the beginning of the line):
35
- ### **WORK IN PROGRESS**
36
- -->
37
48
  ### 2.13.6 (2024-03-11)
38
49
  - (arteck) update dependecy
39
50
 
@@ -308,6 +308,17 @@
308
308
  "type": "checkbox",
309
309
  "label": "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name.",
310
310
  "newLine": true
311
+ },
312
+ "expertHeader": {
313
+ "type": "header",
314
+ "text": "Expert Settings. Please only use if you know what you're doing",
315
+ "size": 2,
316
+ "newLine": true
317
+ },
318
+ "allwaysUpdateOccupancyState": {
319
+ "type": "checkbox",
320
+ "label": "Allways update state for occupancy when message arrives from zigbee2mqtt server (Only for true state). Increases load on ioBroker System",
321
+ "newLine": true
311
322
  }
312
323
  }
313
324
  }
package/io-package.json CHANGED
@@ -1,8 +1,73 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "zigbee2mqtt",
4
- "version": "2.13.6",
4
+ "version": "2.13.11",
5
5
  "news": {
6
+ "2.13.11": {
7
+ "en": "corr package.json",
8
+ "de": "korr paket.json",
9
+ "ru": "коррек-пакет.json",
10
+ "pt": "corr pacote.json",
11
+ "nl": "corr package.json",
12
+ "fr": "c'est ce qu'il a dit",
13
+ "it": "pacchetto corr.json",
14
+ "es": "corr package.json",
15
+ "pl": "corr package.json",
16
+ "uk": "english, українська, français..",
17
+ "zh-cn": "corr 软件包.json"
18
+ },
19
+ "2.13.10": {
20
+ "en": "update dependecy\nadd available object for groups",
21
+ "de": "aktualisierung abhängigkeit\nobjekt für gruppen hinzufügen",
22
+ "ru": "обновление\nдобавить доступный объект для групп",
23
+ "pt": "atualização\nadicionar objeto disponível para grupos",
24
+ "nl": "afhankelijkheid bijwerken\nbeschikbaar object voor groepen toevoegen",
25
+ "fr": "mettre à jour la dépendance\najouter un objet disponible pour les groupes",
26
+ "it": "aggiornamento dipendenza\naggiungere oggetto disponibile per gruppi",
27
+ "es": "dependencia de actualización\nañadir objeto disponible para grupos",
28
+ "pl": "aktualizacja zależności\ndodaj dostępny obiekt dla grup",
29
+ "uk": "оновлення залежності\nдодати доступний об'єкт для груп",
30
+ "zh-cn": "更新依赖性\n为组添加可用对象"
31
+ },
32
+ "2.13.9": {
33
+ "en": "fix lint\nupdate dependecy",
34
+ "de": "lint zu entfernen\naktualisierung abhängigkeit",
35
+ "ru": "фиксация линта\nобновление",
36
+ "pt": "forro de correção\natualização",
37
+ "nl": "fix pluis\nafhankelijkheid bijwerken",
38
+ "fr": "fixer le lint\nmettre à jour la dépendance",
39
+ "it": "fissaggio lunetta\naggiornamento dipendenza",
40
+ "es": "\ndependencia de actualización",
41
+ "pl": "fix lint\naktualizacja zależności",
42
+ "uk": "засупу 10 ток\nоновлення залежності",
43
+ "zh-cn": "修正线\n更新依赖性"
44
+ },
45
+ "2.13.8": {
46
+ "en": "fix icon path",
47
+ "de": "iconpfad aktivieren",
48
+ "ru": "исправить значок",
49
+ "pt": "corrigir o caminho do ícone",
50
+ "nl": "pictogrampad herstellen",
51
+ "fr": "correction du chemin de l'icône",
52
+ "it": "corretto percorso icona",
53
+ "es": "fijar la ruta del icono",
54
+ "pl": "naprawić ścieżkę ikon",
55
+ "uk": "фіксувати шлях іконки",
56
+ "zh-cn": "修补图标路径"
57
+ },
58
+ "2.13.7": {
59
+ "en": "core dependecy\nupdate dependecy\nEnable occupancy to be always updated if true",
60
+ "de": "kernabhängigkeit\naktualisierung abhängigkeit\nErmöglichen Sie die Belegung immer aktualisieren, wenn zutreffend",
61
+ "ru": "основополагающая зависимость\nобновление\nВозможность всегда обновляться, если это правда",
62
+ "pt": "dependência do núcleo\natualização\nPermite que a ocupação seja sempre atualizada se for verdade",
63
+ "nl": "core afhankelijkheid\nafhankelijkheid bijwerken\nDe bezetting wordt altijd bijgewerkt indien deze waar is",
64
+ "fr": "dépendance du noyau\nmettre à jour la dépendance\nActiver l'occupation pour être toujours mis à jour si vrai",
65
+ "it": "core dipendenza\naggiornamento dipendenza\nAbilitare l'occupazione di essere sempre aggiornato se vero",
66
+ "es": "dependencia básica\ndependencia de actualización\nActivar ocupación para ser siempre actualizada si es verdad",
67
+ "pl": "zasadnicza zależność\naktualizacja zależności\nWłącz zawsze aktualizację obłożenia, jeśli jest prawdziwe",
68
+ "uk": "сердечник\nоновлення залежності\nУвімкнути можливість постійно оновлюватися, якщо правда",
69
+ "zh-cn": "核心依赖性\n更新依赖性\n启用若为真则总是更新占用"
70
+ },
6
71
  "2.13.6": {
7
72
  "en": "update dependecy",
8
73
  "de": "aktualisierung abhängigkeit",
@@ -28,71 +93,6 @@
28
93
  "pl": "stałe mqttClient.end ()",
29
94
  "uk": "фіксований mqttClient.end()",
30
95
  "zh-cn": "固定的 mqttClient.end ()"
31
- },
32
- "2.13.4": {
33
- "en": "fixed unnecessary warning for special value ([269](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/269))",
34
- "de": "feste unnötige Warnung für Sonderwert [269](https://github.com/arteck/ioBroker.zigbee2mqt/issues/269)",
35
- "ru": "фиксированное ненужное предупреждение для особенного значения [269](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/269)",
36
- "pt": "aviso desnecessário fixo para valor especial [269](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/269)",
37
- "nl": "onnodig gewaarschuwd voor speciale waarde voor speciale waarde [269)",
38
- "fr": "avertissement inutile fixe pour valeur spéciale [269](https://github.com/arteck/ioBroker.zigbee2mqt/issues/269)",
39
- "it": "[269](https://github.com/arteck/ioBroker.zigbee2mqt/issues/269)",
40
- "es": "fija innecesaria advertencia para valor especial [269](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/269)",
41
- "pl": "niepotrzebne ostrzeżenie dla specjalnej wartości (269)(https:/github.com/arteck/ioBroker.zigbee2mqtt/issues/269)",
42
- "uk": "виправлено непотрібне попередження про спеціальне значення [269] (https://github.com/arteck/ioBroker.zigbee2mqtt/issues/269)",
43
- "zh-cn": "(http://github.com/oshojo0o/ioBroker.zigbee2mqt/issues/269)"
44
- },
45
- "2.13.3": {
46
- "en": "fixed devices erroneous offline indication ([#255](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/255))",
47
- "de": "feste Geräte fehlerhafte Offline-Anzeige #[255](https://github.com/arteck/ioBroker.zigbee2mqt/issues/255)",
48
- "ru": "фиксированные устройства ошибочные оффлайн индикация #[255](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/255)",
49
- "pt": "dispositivos fixos errônea indicação offline #[255](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/255)",
50
- "nl": "quality over Quantity (QoQ) Releases Vertaling:",
51
- "fr": "signalisation erroneous offline #[255](https://github.com/arteck/ioBroker.zigbee2mqt/issues/255)",
52
- "it": "#[255](https://github.com/arteck/ioBroker.zigbee2mqt/issues/255)",
53
- "es": "dispositivos fijos erroneous offline indicating #[255](https://github.com/arteck/ioBroker.zigbee2mqt/issues/255)",
54
- "pl": "uruchomione urządzenia błędne, #255 (https:/github.com/arteck/ioBroker,zigbee2mqtt/issues/255)",
55
- "uk": "фіксовані пристрої erroneous офлайн показання # [255] (https://github.com/arteck/ioBroker.zigbee2mqtt/products/255)",
56
- "zh-cn": "固定装置随线标明编号[255](http://github.com/oshojo0o/ioBroker.zigbee2mqt/issues/255)"
57
- },
58
- "2.13.2": {
59
- "en": "fixed NULL values when HASS integration is enabled in zigbee2mqtt",
60
- "de": "feste NULL-Werte, wenn die HASS-Integration in zigbee2mqtt aktiviert ist",
61
- "ru": "фиксированные значения NULL, когда интеграция HASS включена в zigbee2mqtt",
62
- "pt": "valores NULL fixos quando a integração HASS é ativada em zigbee2mqtt",
63
- "nl": "gerepareerde NUll waarden wanneer HASS integratie in staat is in Zigbee2mqt",
64
- "fr": "valeurs NULL fixes lorsque l'intégration HASS est activée en zigbee2mqt",
65
- "it": "valori NULL fissi quando l'integrazione HASS è attivata in zigbee2mqtt",
66
- "es": "valores fijos NULL cuando la integración HASS está habilitada en zigbee2mqt",
67
- "pl": "zastawione wartości NULL, gdy integracja HASS jest dostępna w zigbee2mqtt",
68
- "uk": "виправлено значення NULL при інтеграції HASS у Zigbee2mqtt",
69
- "zh-cn": "当人道协调厅的一体化得以在齐格贝2mqtttt条件下实现固定的NULL数值。"
70
- },
71
- "2.13.1": {
72
- "en": "fixed storage name",
73
- "de": "fester speichername",
74
- "ru": "фиксированное имя хранения",
75
- "pt": "nome de armazenamento fixo",
76
- "nl": "vertaling:",
77
- "fr": "nom de stockage fixe",
78
- "it": "nome di archiviazione fisso",
79
- "es": "nombre de almacenamiento fijo",
80
- "pl": "nazwa pamięci stałej",
81
- "uk": "фіксована назва зберігання",
82
- "zh-cn": "固定储存名称"
83
- },
84
- "2.13.0": {
85
- "en": "added state `info.coordinator_check` ([#247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247))\nadded state `info.missing_routers` ([#247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247))\nadded state `info.missing_routers_count` ([#247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247))\nadded option `Automatic check for missing routers in the coordinator memory` ([#247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247))",
86
- "de": "zusätzlich state info.coordinator_check #[247](https://github.com/arteck/ioBroker.zigbee2mqt/issues/247)\nzusätzlich state info.missing_routers #[247](https://github.com/arteck/ioBroker.zigbee2mqt/issues/247)\nzusätzlich state info.missing_routers_count #[247](https://github.com/arteck/ioBroker.zigbee2mqt/issues/247)\nzusätzliche Option `Automatische Überprüfung fehlender Router im Koordinatorspeicher` #[247](https://github.com/arteck/ioBroker.zigbee2mqt/issues/247)",
87
- "ru": "добавлено состояние info.coordinator_check #[247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247)\nдобавлено состояние info.missing_routers #[247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247)\nдобавлено состояние info.missing_routers_count #[247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247)\nдобавлена опция `Автоматическая проверка для пропавших маршрутизаторов в памяти координатора` #[247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247)",
88
- "pt": "adicionado state info.coordinator_check #[247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247)\nadicionado state info.missing_routers #[247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247)\nadicionado state info.missing_routers_count #[247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247)\nopção adicionada `Verificação automática de roteadores ausentes na memória do coordenador #[247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247)",
89
- "nl": "quality over Quantity (QoQ) Releases Vertaling:\nquality over Quantity (QoQ) Releases Vertaling:\nvoegde staatsinformatie toe, mislukt jroutmount 47, httub,com/0shojoo/ioBroker\nvoegde optie 'Automatische cheque toe voor vermiste routers in de coördinator geheugen 47) (htttub,com/0hojoo/ioBroker",
90
- "fr": "infos supplémentaires.coordinator_check #[247](https://github.com/arteck/ioBroker.zigbee2mqt/issues/247)\ninfos supplémentaires.missing_routers #[247](https://github.com/arteck/ioBroker.zigbee2mqt/issues/247)\ninfo état ajoutée.missing_routers_count #[247](https://github.com/arteck/ioBroker.zigbee2mqt/issues/247)\noption ajoutée `Automatic check for missing routers in the Coordinator memory` #[247](https://github.com/arteck/ioBroker.zigbee2mqt/issues/247)",
91
- "it": "#[247](https://github.com/arteck/ioBroker.zigbee2mqt/issues/247)\n#[247](https://github.com/arteck/ioBroker.zigbee2mqt/issues/247)\naggiunto stato info.missing_routers_count #[247](https://github.com/arteck/ioBroker.zigbee2mqt/issues/247)\nopzione aggiuntiva `Controllo automatico dei router mancanti nella memoria coordinatore` #[247](https://github.com/arteck/ioBroker.zigbee2mqt/issues/247)",
92
- "es": "añadido información del estado.coordinator_check #[247](https://github.com/arteck/ioBroker.zigbee2mqt/issues/247)\nañadido información del estado.missing_routers #[247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247)\nañadido información del estado.missing_routers_count #[247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247)\nañadido la opción `Automatic check for missing routers in the coordinator memory` #[247](https://github.com/arteck/ioBroker.zigbee2mqt/issues/247)",
93
- "pl": "info.coordinator_check #247(https:/github.com/arteck/ioBroker.zigbee2mqtt/issues/247) (ang.)\ninfo.missing_routers #247(https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247) (ang.)\ninfo.missing_routers_count #247 (https:/github.com/arteck/ioBroker.zigbee2mqtt/issues/247) (ang.)\nautomatic check for missing routers in the coordinator memory` #247(https:/github.com/arteck/ioBroker.zigbee2mqtt/issues/247) (ang.)",
94
- "uk": "додано державну інформацію.coordinator_check #[247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247)\nдодано державну інформацію.missing_routers #[247](https://github.com/arteck/ioBroker.zigbee2mqtt/products/247)\nдодано державну інформацію.missing_routers_count #[247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247)\nдодано варіант `Автоматичний чек для відсутніх маршрутизаторів в зоні пам'яті координатора #[247](https://github.com/arteck/ioBroker.zigbee2mqtt/issues/247)",
95
- "zh-cn": "补充国家:控制编号[247](http://github.com/oshojo0o/ioBroker.zigbee2mqt/issues/247)\n添加以下国家:F.missing_routers #[247](http://github.com/oshojo0o/ioBroker.zigbee2mqt/issues/247)\n增列国家:F.missing_routers_count.[247](http://github.com/arteck/ioBroker.zigbee2mqt/issues/247)\n添加了“协调员记忆中的缺失路线者进行现场检查”的备选办法[247](http://github.com/arteck/ioBroker.zigbee2mqt/issues/247)。"
96
96
  }
97
97
  },
98
98
  "messages": [
@@ -175,9 +175,11 @@
175
175
  "aqara",
176
176
  "tuya"
177
177
  ],
178
- "license": "MIT",
178
+ "licenseInformation": {
179
+ "license": "MIT",
180
+ "type": "free"
181
+ },
179
182
  "platform": "Javascript/Node.js",
180
- "main": "main.js",
181
183
  "icon": "zigbee2mqtt.png",
182
184
  "enabled": false,
183
185
  "extIcon": "https://raw.githubusercontent.com/arteck/ioBroker.zigbee2mqtt/main/admin/zigbee2mqtt.png",
@@ -219,7 +221,7 @@
219
221
  },
220
222
  "dependencies": [
221
223
  {
222
- "js-controller": ">=3.3.22"
224
+ "js-controller": ">= 5.0.19"
223
225
  }
224
226
  ],
225
227
  "globalDependencies": [
@@ -260,7 +262,8 @@
260
262
  "simplePressReleaseState": false,
261
263
  "coordinatorCheck": false,
262
264
  "coordinatorCheckLogLvl": "info",
263
- "coordinatorCheckCron": "0 3 * * *"
265
+ "coordinatorCheckCron": "0 3 * * *",
266
+ "allwaysUpdateOccupancyState": false
264
267
  },
265
268
  "protectedNative": [
266
269
  "externalMqttServerPassword",
package/lib/check.js CHANGED
@@ -3,10 +3,10 @@ function checkConfig(config, log) {
3
3
  legacy_api_enabled: config.advanced.legacy_api != false,
4
4
  legacy_availability_payload_enabled: config.advanced.legacy_availability_payload != false,
5
5
  device_legacy_enabled: config.device_options.legacy != false,
6
- payload_contains_not_json: (config.advanced.output != 'attribute_and_json' && config.advanced.output != 'json')
6
+ payload_contains_not_json: config.advanced.output != 'attribute_and_json' && config.advanced.output != 'json',
7
7
  };
8
8
 
9
- if (Object.values(checkAPIOptions).filter(x => x == true).length > 0) {
9
+ if (Object.values(checkAPIOptions).filter((x) => x == true).length > 0) {
10
10
  log.error('===================================================');
11
11
  log.error('===================================================');
12
12
  if (checkAPIOptions.legacy_api_enabled == true) {
@@ -17,20 +17,26 @@ function checkConfig(config, log) {
17
17
  log.error('');
18
18
  }
19
19
  if (checkAPIOptions.legacy_availability_payload_enabled == true) {
20
- log.error('Legacy Availability Payload is activated, thus the adapter cannot represent the availability of the devices!!!');
20
+ log.error(
21
+ 'Legacy Availability Payload is activated, thus the adapter cannot represent the availability of the devices!!!'
22
+ );
21
23
  log.error('Please add the following lines to your Zigbee2MQTT configuration.yaml:');
22
24
  log.error('advanced:');
23
25
  log.error('legacy_availability_payload: false');
24
26
  log.error('');
25
27
  }
26
28
  if (checkAPIOptions.device_legacy_enabled == true) {
27
- log.error('Device Legacy Payload is activated, therefore the adapter may process the states of the devices correctly!!!');
29
+ log.error(
30
+ 'Device Legacy Payload is activated, therefore the adapter may process the states of the devices correctly!!!'
31
+ );
28
32
  log.error('Please add the following lines to your Zigbee2MQTT configuration.yaml:');
29
33
  log.error('device_options:');
30
34
  log.error(' legacy: false');
31
35
  }
32
36
  if (checkAPIOptions.payload_contains_not_json == true) {
33
- log.error('MQTT output type must "attribute_and_json" or "json" , therefore the adapter may process the states of the devices correctly!!!');
37
+ log.error(
38
+ 'MQTT output type must "attribute_and_json" or "json" , therefore the adapter may process the states of the devices correctly!!!'
39
+ );
34
40
  log.error('Please add the following lines to your Zigbee2MQTT configuration.yaml:');
35
41
  log.error('advanced:');
36
42
  log.error(' output: json');
@@ -46,4 +52,4 @@ function checkConfig(config, log) {
46
52
 
47
53
  module.exports = {
48
54
  checkConfig: checkConfig,
49
- };
55
+ };
package/lib/colors.js CHANGED
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable no-prototype-builtins */
2
2
  'use strict';
3
3
 
4
-
5
4
  const namedColors = {
6
5
  mediumvioletred: {
7
6
  rgb: '#c71585',
@@ -432,16 +431,15 @@ function NamedColorToRGBstring(name) {
432
431
  }
433
432
 
434
433
  function ParseColor(rgbstring) {
435
- if (typeof (rgbstring) === 'string') {
434
+ if (typeof rgbstring === 'string') {
436
435
  const lowerName = rgbstring.toLowerCase();
437
- if (namedColors.hasOwnProperty(lowerName))
438
- rgbstring = namedColors[lowerName].rgb;
436
+ if (namedColors.hasOwnProperty(lowerName)) rgbstring = namedColors[lowerName].rgb;
439
437
  rgbstring = rgbstring.trim();
440
438
  if (rgbstring.startsWith('#')) rgbstring = rgbstring.slice(1);
441
439
  const val = parseInt('0x' + rgbstring);
442
440
  const oneColor = {};
443
441
  oneColor.r = Math.floor(val / (256 * 256));
444
- oneColor.g = Math.floor(val % (256 * 256) / 256);
442
+ oneColor.g = Math.floor((val % (256 * 256)) / 256);
445
443
  oneColor.b = val % 256;
446
444
  return oneColor;
447
445
  }
@@ -455,5 +453,5 @@ function NamedColorToRGB(name) {
455
453
  module.exports = {
456
454
  NamedColorToRGB,
457
455
  NamedColorToRGBstring,
458
- ParseColor
456
+ ParseColor,
459
457
  };
@@ -20,7 +20,9 @@ class DeviceController {
20
20
  utils.clearArray(this.deviceCache);
21
21
  for (const devicesMessag of devicesMessage) {
22
22
  if (this.logCustomizations.debugDevices.includes(devicesMessag.ieee_address)) {
23
- this.adapter.log.warn(`--->>> fromZ2M -> ${devicesMessag.ieee_address} exposes: ${JSON.stringify(devicesMessag)}`);
23
+ this.adapter.log.warn(
24
+ `--->>> fromZ2M -> ${devicesMessag.ieee_address} exposes: ${JSON.stringify(devicesMessag)}`
25
+ );
24
26
  }
25
27
 
26
28
  if (devicesMessag.definition != null) {
@@ -42,16 +44,18 @@ class DeviceController {
42
44
  }
43
45
  }
44
46
 
45
-
46
47
  async defineGroupDevice(groupID, ieee_address, scenes) {
47
- const brmPropName = this.adapter.config.brightnessMoveOnOff == true ? 'brightness_move_onoff' : 'brightness_move';
48
- const brsPropName = this.adapter.config.brightnessStepOnOff == true ? 'brightness_step_onoff' : 'brightness_step';
48
+ const brmPropName =
49
+ this.adapter.config.brightnessMoveOnOff == true ? 'brightness_move_onoff' : 'brightness_move';
50
+ const brsPropName =
51
+ this.adapter.config.brightnessStepOnOff == true ? 'brightness_step_onoff' : 'brightness_step';
49
52
  const newDevice = {
50
53
  id: groupID,
51
54
  ieee_address: ieee_address,
52
55
  icon: undefined, // await imageController.getDeviceIcon(devicesMessag), device.definition.model
53
56
  optionsValues: {},
54
57
  states: [
58
+ states.available,
55
59
  states.brightness,
56
60
  states.colortemp_move,
57
61
  states.transition,
@@ -66,8 +70,8 @@ class DeviceController {
66
70
  read: true,
67
71
  type: 'boolean',
68
72
  def: false,
69
- getter: payload => (payload.state === 'ON'),
70
- setter: (value) => (value) ? 'ON' : 'OFF',
73
+ getter: (payload) => payload.state === 'ON',
74
+ setter: (value) => (value ? 'ON' : 'OFF'),
71
75
  },
72
76
  {
73
77
  id: 'brightness_move',
@@ -80,7 +84,7 @@ class DeviceController {
80
84
  type: 'number',
81
85
  min: -50,
82
86
  max: 50,
83
- def: 0
87
+ def: 0,
84
88
  },
85
89
  {
86
90
  id: 'brightness_step',
@@ -93,7 +97,7 @@ class DeviceController {
93
97
  type: 'number',
94
98
  min: -255,
95
99
  max: 255,
96
- def: 0
100
+ def: 0,
97
101
  },
98
102
  {
99
103
  id: 'color',
@@ -112,16 +116,21 @@ class DeviceController {
112
116
  xy = rgb.rgb_to_cie(rgbcolor.r, rgbcolor.g, rgbcolor.b);
113
117
  return {
114
118
  x: xy[0],
115
- y: xy[1]
119
+ y: xy[1],
116
120
  };
117
121
  },
118
- getter: payload => {
122
+ getter: (payload) => {
119
123
  if (payload.color_mode != 'xy' && this.config.colorTempSyncColor == false) {
120
124
  return undefined;
121
125
  }
122
126
  if (payload.color && payload.color.x && payload.color.y) {
123
127
  const colorval = rgb.cie_to_rgb(payload.color.x, payload.color.y);
124
- return '#' + utils.decimalToHex(colorval[0]) + utils.decimalToHex(colorval[1]) + utils.decimalToHex(colorval[2]);
128
+ return (
129
+ '#' +
130
+ utils.decimalToHex(colorval[0]) +
131
+ utils.decimalToHex(colorval[1]) +
132
+ utils.decimalToHex(colorval[2])
133
+ );
125
134
  } else {
126
135
  return undefined;
127
136
  }
@@ -166,7 +175,7 @@ class DeviceController {
166
175
  type: 'boolean',
167
176
  setattr: 'state',
168
177
  def: true,
169
- setter: (value) => (value) ? 'TOGGLE' : undefined
178
+ setter: (value) => (value ? 'TOGGLE' : undefined),
170
179
  },
171
180
  {
172
181
  id: 'effect',
@@ -178,7 +187,14 @@ class DeviceController {
178
187
  read: true,
179
188
  type: 'string',
180
189
  def: '',
181
- states: { blink: 'blink', breathe: 'breathe', okay: 'okay', channel_change: 'channel_change', finish_effect: 'finish_effect', stop_effect: 'stop_effect' }
190
+ states: {
191
+ blink: 'blink',
192
+ breathe: 'breathe',
193
+ okay: 'okay',
194
+ channel_change: 'channel_change',
195
+ finish_effect: 'finish_effect',
196
+ stop_effect: 'stop_effect',
197
+ },
182
198
  },
183
199
  ],
184
200
  };
@@ -195,7 +211,7 @@ class DeviceController {
195
211
  read: true,
196
212
  def: true,
197
213
  type: 'boolean',
198
- setter: (value) => (value) ? scene.id : undefined
214
+ setter: (value) => (value ? scene.id : undefined),
199
215
  };
200
216
  // @ts-ignore
201
217
  newDevice.states.push(sceneSate);
@@ -230,37 +246,40 @@ class DeviceController {
230
246
  if (device.disabled && device.disabled == true) {
231
247
  if (this.config.useEventInDesc == true) {
232
248
  description = 'Device is disabled!';
233
- }
234
- else {
249
+ } else {
235
250
  deviceName = `[Disabled] ${deviceName}`;
236
251
  }
237
-
238
252
  }
239
253
 
240
- if (!this.createCache[device.ieee_address] || this.createCache[device.ieee_address].name != deviceName || this.createCache[device.ieee_address].description != description) {
254
+ if (
255
+ !this.createCache[device.ieee_address] ||
256
+ this.createCache[device.ieee_address].name != deviceName ||
257
+ this.createCache[device.ieee_address].description != description
258
+ ) {
241
259
  const deviceObj = {
242
260
  type: 'device',
243
261
  common: {
244
262
  icon: device.icon,
245
263
  name: deviceName,
246
264
  desc: description,
247
- statusStates: { onlineId: '' }
265
+ statusStates: { onlineId: '' },
248
266
  },
249
267
  native: {
250
268
  deviceRemoved: false,
251
- groupDevice: false
252
- }
269
+ groupDevice: false,
270
+ },
253
271
  };
254
272
 
255
273
  // Group Device
256
274
  if (device.ieee_address.includes('group_')) {
257
275
  deviceObj.native.groupDevice = true;
276
+ deviceObj.common.statusStates.onlineId = `${this.adapter.name}.${this.adapter.instance}.${device.ieee_address}.available`;
258
277
  }
259
278
  // Disabled Device
260
279
  else if (device.disabled || device.disabled == true) {
261
280
  // Placeholder for possible later logic
262
281
  }
263
- // Only the onlineId is set if the device is not disabled and is not a group
282
+ // Only the onlineId is set if the device is not disabled
264
283
  else {
265
284
  deviceObj.common.statusStates.onlineId = `${this.adapter.name}.${this.adapter.instance}.${device.ieee_address}.available`;
266
285
  }
@@ -276,13 +295,17 @@ class DeviceController {
276
295
  const sceneIDs = Object.keys(sceneStates);
277
296
  for (const sceneID of sceneIDs) {
278
297
  const stateID = sceneID.split('.')[3];
279
- if (device.states.find(x => x.id == stateID) == null) {
298
+ if (device.states.find((x) => x.id == stateID) == null) {
280
299
  this.adapter.delObject(sceneID);
281
300
  }
282
301
  }
283
302
 
284
303
  for (const state of device.states) {
285
- if (state && (!this.createCache[device.ieee_address][state.id] || this.createCache[device.ieee_address][state.id].name != state.name)) {
304
+ if (
305
+ state &&
306
+ (!this.createCache[device.ieee_address][state.id] ||
307
+ this.createCache[device.ieee_address][state.id].name != state.name)
308
+ ) {
286
309
  const iobState = {
287
310
  type: 'state',
288
311
  common: await this.copyAndCleanStateObj(state),
@@ -297,7 +320,9 @@ class DeviceController {
297
320
  }
298
321
 
299
322
  async renameDeviceInCache(messageObj) {
300
- const renamedDevice = this.groupCache.concat(this.deviceCache).find(x => x.id == messageObj.payload.data.from);
323
+ const renamedDevice = this.groupCache
324
+ .concat(this.deviceCache)
325
+ .find((x) => x.id == messageObj.payload.data.from);
301
326
  if (renamedDevice) {
302
327
  renamedDevice.id = messageObj.payload.data.to;
303
328
  }
@@ -308,31 +333,30 @@ class DeviceController {
308
333
  let deviceName = '';
309
334
  let iobDevices = await this.adapter.getDevicesAsync();
310
335
  // Do not consider devices already marked as "deviceRemoved"
311
- iobDevices = iobDevices.filter(x => x.native.deviceRemoved == false);
336
+ iobDevices = iobDevices.filter((x) => x.native.deviceRemoved == false);
312
337
  // Do not consider groups
313
- iobDevices = iobDevices.filter(x => x.native.groupDevice == false);
338
+ iobDevices = iobDevices.filter((x) => x.native.groupDevice == false);
314
339
 
315
340
  for (const iobDevice of iobDevices) {
316
341
  const ieee_address = iobDevice._id.split('.')[2];
317
342
  //Check whether the devices found from the object tree are also available in the DeviceCache
318
- if (!this.deviceCache.find(x => x.ieee_address == ieee_address)) {
343
+ if (!this.deviceCache.find((x) => x.ieee_address == ieee_address)) {
319
344
  deviceName = iobDevice.common.name;
320
345
 
321
346
  if (this.config.useEventInDesc == true) {
322
347
  description = 'Device was removed!';
323
- }
324
- else {
348
+ } else {
325
349
  deviceName = `[Removed] ${deviceName}`;
326
350
  }
327
351
 
328
352
  this.adapter.extendObject(`${ieee_address}`, {
329
353
  common: {
330
354
  name: deviceName,
331
- desc: description
355
+ desc: description,
332
356
  },
333
357
  native: {
334
- deviceRemoved: true
335
- }
358
+ deviceRemoved: true,
359
+ },
336
360
  });
337
361
  this.adapter.setStateChangedAsync(`${ieee_address}.available`, false, true);
338
362
 
@@ -342,7 +366,7 @@ class DeviceController {
342
366
  }
343
367
 
344
368
  removeDeviceByIeee(devices, ieee_address) {
345
- const idx = devices.findIndex(x => x.ieee_address == ieee_address);
369
+ const idx = devices.findIndex((x) => x.ieee_address == ieee_address);
346
370
  if (idx > -1) {
347
371
  devices.splice(idx, 1);
348
372
  }
@@ -384,9 +408,10 @@ class DeviceController {
384
408
  this.adapter.setState('info.missing_routers_count', missingRoutersCount, true);
385
409
 
386
410
  if (missingRoutersCount > 0) {
387
- this.adapter.log[this.config.coordinatorCheckLogLvl](`Coordinator check: ${missingRoutersCount} missing routers were found, please check the data point 'zigbee2mqtt.x.info.missing_routers'!`);
388
- }
389
- else {
411
+ this.adapter.log[this.config.coordinatorCheckLogLvl](
412
+ `Coordinator check: ${missingRoutersCount} missing routers were found, please check the data point 'zigbee2mqtt.x.info.missing_routers'!`
413
+ );
414
+ } else {
390
415
  this.adapter.log.info('Coordinator check: No missing router was found.');
391
416
  }
392
417
  }
@@ -394,5 +419,5 @@ class DeviceController {
394
419
  }
395
420
 
396
421
  module.exports = {
397
- DeviceController
398
- };
422
+ DeviceController,
423
+ };