iobroker.zigbee 3.3.4 → 3.3.5

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
@@ -141,6 +141,11 @@ You can thank the authors by these links:
141
141
 
142
142
  -----------------------------------------------------------------------------------------------------
143
143
  ## Changelog
144
+ ### 3.3.5 (2026-01-30)
145
+ * Bugfix - Error on startup from onEvent
146
+ * fix: send_payload read with array of cluster
147
+ *
148
+
144
149
  ### 3.3.4 (2026-01-26)
145
150
  * ZHC 25.112.0
146
151
  * ZH 8.1.0
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "zigbee",
4
- "version": "3.3.4",
4
+ "version": "3.3.5",
5
5
  "news": {
6
+ "3.3.5": {
7
+ "en": "Bugfix - Error on startup from onEvent\nfix: send_payload read with array of cluster\n",
8
+ "de": "Bugfix - Fehler beim Start von onEvent\nfix: send_payload mit cluster-array gelesen\n",
9
+ "ru": "Bugfix - Ошибка при запуске с OnEvent\nисправить: send_payload read with array of cluster\n",
10
+ "pt": "Bugfix - Erro na inicialização do onEvent\ncorreção: send_payload lido com array de cluster\n",
11
+ "nl": "Bugfix - Fout bij opstarten van onEvent\nfix: send_payload gelezen met clusterreeks\n",
12
+ "fr": "Bugfix - Erreur au démarrage depuis onEvent\ncorrection : send_payload lu avec le tableau du cluster\n",
13
+ "it": "Bugfix - Errore all'avvio dall'evento\ncorrezione: send_payload letto con array di cluster\n",
14
+ "es": "Bugfix - Error en el inicio desde onEvent\nfix: send_payload read with array of cluster\n",
15
+ "pl": "Bugfix - Błąd podczas uruchamiania z onEvent\nfix: send _ payload read with array of klaster\n",
16
+ "uk": "Бугфікс - Помилка запуску від onEvent\nвиправити: send_payload читати з масивом кластера\n",
17
+ "zh-cn": "Bugfix - 从 Event 启动时出错\n固定: 随集群数组一起读取的发送_ 有效载荷\n"
18
+ },
6
19
  "3.3.4": {
7
20
  "en": "ZHC 25.112.0\nZH 8.1.0\nFix: Admin does not load com ports",
8
21
  "de": "ZHC 25.112.0\nZH 8.1.0\nFix: Admin lädt keine Com-Ports",
@@ -80,19 +93,6 @@
80
93
  "pl": "zmieniony setState for lasterror",
81
94
  "uk": "змінено setState for lasterror",
82
95
  "zh-cn": "更新的设置状态"
83
- },
84
- "3.2.4": {
85
- "en": "added missing state",
86
- "de": "fehlender zustand",
87
- "ru": "отсутствующее государство",
88
- "pt": "estado em falta adicionado",
89
- "nl": "ontbrekende status toevoegen",
90
- "fr": "état manquant ajouté",
91
- "it": "aggiunto stato mancante",
92
- "es": "estado desaparecido",
93
- "pl": "dodany brakujący stan",
94
- "uk": "додано відсутній стан",
95
- "zh-cn": "添加缺失状态"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -558,10 +558,22 @@ class StatesController extends EventEmitter {
558
558
  const json_value = JSON.parse(value);
559
559
  const payload = {device: deviceId.replace('0x', ''), payload: json_value, model:model, stateModel:stateModel, acknowledge:true};
560
560
  if (has_elevated_debug) this.emit('device_debug', { ID:debugID, data: { flag: '04' ,payload:value ,states:[{id:stateDesc.id, value:json_value, payload:'none'}], IO:false }});
561
-
562
- this.emit('send_payload', payload, debugID, has_elevated_debug);
561
+ if (Array.isArray(json_value.read)) {
562
+ for (const item of json_value.read) {
563
+ try {
564
+ this.emit('send_payload',{device: deviceId.replace('0x', ''), payload: {read: item}, model:model, stateModel:stateModel, acknowledge:true}, debugID, has_elevated_debug);
565
+ }
566
+ catch (error) {
567
+ if (has_elevated_debug) this.emit('device_debug', { ID:debugID, data: { error: 'EXSEND' ,states:[{id:stateDesc.id, value:value, payload:error.message}], IO:false }, message:message});
568
+ else this.error(error.message);
569
+ }
570
+ }
571
+ }
572
+ else {
573
+ this.emit('send_payload', payload, debugID, has_elevated_debug);
574
+ }
563
575
  } catch (error) {
564
- const message = `send_payload: ${value} does not parse as JSON Object : ${error.message}`;
576
+ const message = `send_payload: error sending ${value}: ${error.message}`;
565
577
  if (has_elevated_debug) this.emit('device_debug', { ID:debugID, data: { error: 'EXSEND' ,states:[{id:stateDesc.id, value:value, payload:error.message}], IO:false }, message:message});
566
578
  else this.error(message);
567
579
  return;
@@ -35,16 +35,15 @@ class DeviceEvent extends BaseExtension {
35
35
  }
36
36
 
37
37
  async deviceExposeChanged(device, mapped) {
38
- this.warn(`deviceExposeChanged called with ${JSON.stringify(device.ieeeAddr)} / ${JSON.stringify(mapped.model)}`);
38
+ this.warn(`deviceExposesChanged called with ${JSON.stringify(device.ieeeAddr)} / ${JSON.stringify(mapped.model)}`);
39
39
  }
40
40
 
41
41
  async callOnEvent(device, type, data, mappedDevice) {
42
- if (!mappedDevice) {
43
- mappedDevice = await zigbeeHerdsmanConverters.findByDevice(device);
44
- }
42
+
43
+ const md = mappedDevice ? mappedDevice : await zigbeeHerdsmanConverters.findByDevice(device);
45
44
  if (!device) return;
46
45
 
47
- const baseData = {device, deviceExposeChanged: function() { return; }, options: data.options || {}, state: data.state || {}}
46
+ const baseData = {device, deviceExposesChanged: function() { }, options: data.options || {}, state: data.state || {}}
48
47
  const eventData = {
49
48
  type,
50
49
  }
@@ -56,26 +55,29 @@ class DeviceEvent extends BaseExtension {
56
55
  case `deviceJoined`:
57
56
  {
58
57
  eventData.data = baseData;
59
- eventData.deviceExposeChanged = function() { this.deviceExposeChanged(device, mappedDevice) } ;
60
58
  break;
61
59
  }
62
60
  case 'stop':
63
- eventData.data = { ieeeAddr:device.ieeeAddr };
61
+ eventData.data = {ieeeAddr:device.ieeeAddr}
64
62
  break;
65
63
  case 'deviceInterview':
66
- eventData.data = {...baseData,status: data.status};
64
+ eventData.data = baseData;
65
+ eventData.data.status = data.status;
67
66
  break;
68
67
  case 'deviceOptionsChanged':
69
68
  // NOTE: This does not currently work. OptionsChange is not yet defined.
70
- eventData.data = {...baseData, from:data.from || {}, to:data.to || {}};
71
- eventData.data.options = data.to;
69
+ eventData.data = baseData;
70
+ eventData.data.from = data.from || {};
71
+ eventData.data.to = data.to || {};
72
+ eventData.data.options.to = data.to;
72
73
  break;
73
74
  }
74
75
 
75
76
 
76
- if (mappedDevice && mappedDevice.onEvent && eventData.data) {
77
+ if (md && md.onEvent && eventData.data) {
78
+ //this.warn(`calling onEvent for device ${data.device.ieeeAddr} with Event ${type}`);
77
79
  try {
78
- mappedDevice.onEvent(eventData);
80
+ md.onEvent(eventData);
79
81
  }
80
82
  catch (error) {
81
83
  this.warn(`Error in onEvent: ${error && error.message ? error.message : 'no message'}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.zigbee",
3
- "version": "3.3.4",
3
+ "version": "3.3.5",
4
4
  "author": {
5
5
  "name": "Kirov Ilya",
6
6
  "email": "kirovilya@gmail.com"