iobroker.zigbee2mqtt 2.4.5 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022 Dennis Rathjen <dennis.rathjen@outlook.de>
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,12 @@ 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
+
35
41
  ### 2.4.5 (2022-12-20)
36
42
 
37
43
  - (o0shojo0o) extend 'text' for 'action' ([#84](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/84))
@@ -135,7 +141,7 @@ This adapter allows to control the data points of the devices of a Zigbee2MQTT i
135
141
 
136
142
  MIT License
137
143
 
138
- Copyright (c) 2022 Dennis Rathjen <dennis.rathjen@outlook.de>
144
+ Copyright (c) 2023 Dennis Rathjen <dennis.rathjen@outlook.de>
139
145
 
140
146
  Permission is hereby granted, free of charge, to any person obtaining a copy
141
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
  }
@@ -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,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "zigbee2mqtt",
4
- "version": "2.4.5",
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
+ },
6
19
  "2.4.5": {
7
20
  "en": "extend 'text' for 'action' ([#84](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/84))",
8
21
  "de": "text für die Aktion #[84](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/84)",
@@ -80,19 +93,6 @@
80
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).",
81
94
  "uk": "виправлення для пристроїв з декількома кінцевими точками [#57](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/57).\nдоданий варіант `Брайтний рух також повинен перетворювати світло або вимкнути`\nдодано державний контроль за групами\nбільш динамічний при створенні точки даних [#48](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/48).",
82
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)."
83
- },
84
- "2.3.0": {
85
- "en": "added support for the `toggle` of states that support this.\nadded correct handling of `color_move` and `color_temperature_move`",
86
- "de": "zusätzliche unterstützung für den kippen von staaten, die dies unterstützen.\nkorrekte handhabung von color_move und color_temperature_move",
87
- "ru": "добавлена поддержка в отношении государств, которые поддерживают это.\nдобавлена правильная обработка color_move и color_temperature_move",
88
- "pt": "acrescentou apoio para o conjunto de estados que apoiam isso.\nadicionado manuseio correto de color_move e color_temperature_move",
89
- "nl": "steun toegevoegd voor de toggle van staten die dit ondersteunen.\nvoegde de juiste kleding en kleurtemperatuur toe",
90
- "fr": "a ajouté un soutien pour la lutte des etats qui appuient cela.\nla manipulation correcte de color_move et color_temperature_move",
91
- "it": "ha aggiunto il sostegno per la lotta di stati che sostengono questo.\naggiunto corretto trattamento di colore_move e colore_temperature_move",
92
- "es": "agregó apoyo para la lucha de estados que apoyan esto.\nañadido correcto manejo de color_move y color_temperature_move",
93
- "pl": "dodał wsparcie dla porozumień stanów, które to wspierają.\ndodano poprawne zachowanie koloru i kolor_temperature_move",
94
- "uk": "додана підтримка для тягових станів, які підтримують це.\nдодано правильну обробку кольором_move та color_ infrastructure_move",
95
- "zh-cn": "此外,还支持支持这一国家。.\n· 删除白色、流血和色色色色色彩。"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -196,7 +196,8 @@
196
196
  "proxyZ2MLogs": true,
197
197
  "useKelvin": false,
198
198
  "colorTempSyncColor": false,
199
- "brightnessMoveOnOff": false
199
+ "brightnessMoveOnOff": false,
200
+ "brightnessStepOnOff": false
200
201
  },
201
202
  "objects": [],
202
203
  "instanceObjects": [
@@ -38,7 +38,8 @@ class DeviceController {
38
38
 
39
39
 
40
40
  async defineGroupDevice(groupID, ieee_address, scenes) {
41
- const propName = this.adapter.config.brightnessMoveOnOff == true ? 'brightness_move_onoff' : 'brightness_move';
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: propName,
53
- name: 'Dimming',
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
@@ -341,11 +341,11 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
341
341
  },
342
342
  }, prop.access);
343
343
  // brightnessMoveOnOff
344
- const propName = config.brightnessMoveOnOff == true ? `${stateName}_move_onoff` : `${stateName}_move`;
344
+ const brmPropName = config.brightnessMoveOnOff == true ? `${stateName}_move_onoff` : `${stateName}_move`;
345
345
  pushToStates({
346
346
  id: `${stateName}_move`,
347
- prop: propName,
348
- name: 'Dimming',
347
+ prop: brmPropName,
348
+ name: 'Increases or decreases the brightness by X units per second',
349
349
  icon: undefined,
350
350
  role: 'state',
351
351
  write: true,
@@ -354,7 +354,22 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
354
354
  min: -50,
355
355
  max: 50,
356
356
  def: 0
357
- }, prop.access);
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);
358
373
  break;
359
374
  }
360
375
  case 'color_temp': {
@@ -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
- // Is an action
39
- if (Object.keys(messageObj.payload).includes('action')) {
40
- const states = device.states.filter(x => (x.prop && x.prop == 'action'));
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
- if (state.isEvent && state.isEvent == true) {
58
- if (state.type == 'boolean') {
59
- await this.setStateWithTimeoutAsync(stateName, state.getter(messageObj.payload), 300);
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.setStateSafelyAsync(stateName, state.getter(messageObj.payload));
71
+ await this.setStateChangedSafelyAsync(stateName, state.getter(messageObj.payload));
63
72
  }
64
73
  }
74
+ // Is not an action
65
75
  else {
66
- await this.setStateChangedSafelyAsync(stateName, state.getter(messageObj.payload));
67
- }
68
- } catch (err) {
69
- incStatsQueue[incStatsQueue.length] = messageObj;
70
- this.adapter.log.debug(`Can not set ${stateName}, queue state in incStatsQueue!`);
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
  }
@@ -46,6 +46,10 @@ class WebsocketController {
46
46
  }
47
47
 
48
48
  send(message) {
49
+ if (wsClient.readyState !== WebSocket.OPEN) {
50
+ this.adapter.log.warn('Cannot set State, no websocket connection to Zigbee2MQTT!');
51
+ return;
52
+ }
49
53
  wsClient.send(message);
50
54
  }
51
55
 
@@ -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.4.5",
3
+ "version": "2.5.0",
4
4
  "description": "Zigbee2MQTT adapter for ioBroker",
5
5
  "author": {
6
6
  "name": "Dennis Rathjen",
@@ -36,13 +36,13 @@
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.17",
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.30.0",
45
+ "eslint": "^8.31.0",
46
46
  "eslint-config-prettier": "^8.5.0",
47
47
  "eslint-plugin-prettier": "^4.2.1",
48
48
  "mocha": "^10.2.0",