iobroker.zigbee 1.6.14 → 1.6.17

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
@@ -126,10 +126,20 @@ You can thank the authors by these links:
126
126
  npm run release patch -- --all 0.9.8 -> 0.9.9
127
127
  npm run release prerelease beta -- --all v0.2.1 -> v0.2.2-beta.0
128
128
  Placeholder for the next version (at the beginning of the line):
129
- ### **WORK IN PROGRESS**
129
+
130
130
  -->
131
131
 
132
+
132
133
  ## Changelog
134
+ ### 1.6.16 (2022-02-16)
135
+ * (arteck) admin dep fix
136
+ * (arteck) colored objects for online/offline state
137
+
138
+
139
+ ### 1.6.15 (2022-02-08)
140
+ * (arteck) Battery status % calculation was changed for xiaomi devices
141
+
142
+
133
143
  ### 1.6.14 (2022-01)
134
144
  * (asgothian) OTA limitation
135
145
  - devices with the available state set to false are excluded from OTA updates (and the update check)
@@ -154,12 +164,10 @@ You can thank the authors by these links:
154
164
 
155
165
  * (kirovilya) update to Zigbee-Herdsman 0.14
156
166
 
157
-
158
167
  ### 1.6.12 (2022-01)
159
168
  * (asgothian) Groups were newly revised (read [here](https://github.com/ioBroker/ioBroker.zigbee/pull/1327) )
160
169
  - object device.groups is obsolet..the old one is no longer up to date
161
170
 
162
-
163
171
  ### 1.6.9 (2021-12)
164
172
  * (simatec) fix admin Dark-Mode
165
173
  * (asgothian) Expose Access Handling
@@ -171,21 +179,6 @@ You can thank the authors by these links:
171
179
  * (kirovilya) herdsman compatibility
172
180
 
173
181
  ### 1.6.0 (2021-08-09)
174
- ## Attention! Attention! Attention! Attention! Attention! Attention! Attention!
175
-
176
- After introducing a new z-stack startup procedure into zigbee-herdsman, we got some problems with our adapter in version 1.5.6.
177
- This was discussed [here](https://github.com/ioBroker/ioBroker.zigbee/issues/1110) and [here](https://github.com/Koenkk/zigbee-herdsman/issues/376)
178
-
179
- Unfortunately, not all user sticks were able to work successfully with this new init routine. This mainly affected the TI cc2538 based sticks with the 2019 year's firmware. All subsequent firmwares and sticks have no problems when starting the adapter or they can be fixed.
180
-
181
- At the moment, there is no working solution to this problem, except for updating the firmware of such sticks to a newer one.
182
- As a fallback, it is proposed to use the old version of zigbee-herdsman 0.13.93, but some of the devices and functionality may not work.
183
- Therefore, we made a separate version 1.6.0o especially for this case. It can be installed from github at https://github.com/ioBroker/ioBroker.zigbee/tarball/old_herdsman
184
-
185
- * Update to latest zigbee-herdsman and zigbee-herdsman-converters
186
- * (PeterVoronov) Update support composite exposes
187
- * (kirovilya) UI fixes
188
- * (kirovilya) Sentry support
189
182
 
190
183
  ### 1.5.6 (2021-05-26)
191
184
  * (kirovilya) new UI add
@@ -200,13 +193,11 @@ Therefore, we made a separate version 1.6.0o especially for this case. It can be
200
193
  ### 1.5.2 (2021-04-29)
201
194
  * (asgothian) Groups on dashboard
202
195
 
203
-
204
196
  ### 1.5.1 (2021-04-14)
205
197
  * (kirovilya) Dashboard
206
198
  * (asgothian) Groups (reworked)
207
199
  * [Experimental support EZSP protocol for EFR32 chips](https://github.com/Koenkk/zigbee-herdsman/issues/319) (zigbee-herdsman)
208
200
 
209
-
210
201
  ### 1.4.4 (2021-02-14)
211
202
  * (kirovilya) External converters https://www.zigbee2mqtt.io/information/configuration.html#external-converters-configuration
212
203
  * (asgothian) Enhancement ping process
@@ -214,7 +205,6 @@ Therefore, we made a separate version 1.6.0o especially for this case. It can be
214
205
  * (asgothian) State Cleanup button
215
206
  * (arteck) Setting to use exposes instead of internal device description
216
207
 
217
-
218
208
  ### 1.4.1 (2020-12)
219
209
  * (o0shojo0o) added a kelvin posibility into colortemp
220
210
  * (asgothian) Hue_calibration for exposed devices (Use requires PR on zigbee-herdsman-converters, PR is being worked on)
@@ -228,7 +218,6 @@ Therefore, we made a separate version 1.6.0o especially for this case. It can be
228
218
  * (asgothian) change in OTA: Message that a device does not respond for OTA query downgraded to "info" from "error"
229
219
  * (asgothian) new coordinator card
230
220
 
231
-
232
221
  ### 1.4.0 (2020-12)
233
222
  * Many new devices available
234
223
 
@@ -322,7 +311,6 @@ New devices:
322
311
  * (mar565) GUNNARP panel round
323
312
  * (Erdnuss3003) 4090531P7
324
313
 
325
-
326
314
  ### 1.1.1 (2020-04-17)
327
315
  * (kirovilya) Critical. Fixed error starting adapter if cc-chip was only flashed
328
316
  * (kirovilya) Nue/3A FNB56-ZSW02LX2.0
@@ -413,8 +401,6 @@ new Zigbee-herdsman features:
413
401
  * Some design update
414
402
  * Binding
415
403
 
416
-
417
-
418
404
  ## License
419
405
  The MIT License (MIT)
420
406
 
package/admin/admin.js CHANGED
@@ -31,7 +31,7 @@ const updateCardInterval = setInterval(updateCardTimer, 6000);
31
31
 
32
32
  const savedSettings = [
33
33
  'port', 'panID', 'channel', 'disableLed', 'countDown', 'groups', 'extPanID', 'precfgkey', 'transmitPower',
34
- 'adapterType', 'debugHerdsman', 'disablePing', 'external', 'startWithInconsistent',
34
+ 'adapterType', 'debugHerdsman', 'colorize', 'disablePing', 'external', 'startWithInconsistent',
35
35
  ];
36
36
 
37
37
  function getDeviceByID(ID) {
@@ -17,6 +17,7 @@
17
17
  <script type="text/javascript" src="../../js/adapter-settings.js"></script>
18
18
  <script type="text/javascript" src="words.js"></script>
19
19
 
20
+
20
21
  <script type="text/javascript" src="admin.js"></script>
21
22
  <script type="text/javascript" src="shuffle.min.js"></script>
22
23
  <script type="text/javascript" src="moment.min.js"></script>
@@ -55,11 +56,9 @@
55
56
  top: 0px;
56
57
  right: 0px;
57
58
  }
58
-
59
59
  .input-field.suffix a.active {
60
60
  color: #26a69a;
61
61
  }
62
-
63
62
  .input-field.suffix .select-wrapper {
64
63
  margin-right: 3rem;
65
64
  width: 92%;
@@ -576,10 +575,14 @@
576
575
  <label class="translate" for="disablePing">Disable active availability check</label>
577
576
  </div>
578
577
 
579
- <div class="input-field col s12 m6 l4 col-disableLed">
578
+ <div class="input-field col s12 m6 l4 col-debugHerdsman">
580
579
  <input id="debugHerdsman" type="checkbox" class="value" />
581
580
  <label class="translate" for="debugHerdsman">Zigbee-herdsman debug info</label>
582
581
  </div>
582
+ <div class="input-field col s12 m6 l4 col-colorize">
583
+ <input id="colorize" type="checkbox" class="value" />
584
+ <label class="translate" for="colorize">color available state</label>
585
+ </div>
583
586
  <div class="input-field col s12 m6 l6">
584
587
  <a id="reset-btn" class="waves-effect waves-light white-text btn-large translate">Reset...</a>
585
588
  </div>
@@ -591,7 +594,7 @@
591
594
  <label class="translate" for="external">Paths to files, semicolon (;) splitted</label>
592
595
  </div>
593
596
  </div>
594
- <div class="input-field col s12 m12 l12 col-disableLed">
597
+ <div class="input-field col s12 m12 l12 col-startWithInconsistent">
595
598
  <input id="startWithInconsistent" type="checkbox" class="value" />
596
599
  <label class="translate" for="startWithInconsistent">SettingsExclude</label>
597
600
  </div>
@@ -1067,7 +1070,7 @@
1067
1070
  <div class="row">
1068
1071
  <div class="col s9 input-field">
1069
1072
  <input id="unbind_from_coordinator" type="checkbox" class="value" />
1070
- <label class="translate" for="unbind_from_coordinator">Unbind remote from Coorinator (necessary for some remotes like HUE Dimmer Switch)</label>
1073
+ <label class="translate" for="unbind_from_coordinator">Unbind remote from Coordinator (necessary for some remotes like HUE Dimmer Switch)</label>
1071
1074
  </div>
1072
1075
  </div>
1073
1076
  </div>
package/admin/tab_m.html CHANGED
@@ -868,7 +868,7 @@
868
868
  <div class="col s9 input-field">
869
869
  <label>
870
870
  <input id="unbind_from_coordinator" type="checkbox" class="value" />
871
- <span class="translate" for="unbind_from_coordinator">Unbind remote from Coorinator (necessary for some remotes like HUE Dimmer Switch)</span>
871
+ <span class="translate" for="unbind_from_coordinator">Unbind remote from Coordinator (necessary for some remotes like HUE Dimmer Switch)</span>
872
872
  </label>
873
873
  </div>
874
874
  </div>
package/admin/words.js CHANGED
@@ -87,7 +87,7 @@ systemDictionary = {
87
87
  "Transport Key Text": { "en": "Transport Key is the network encryption key. Please choose a random key sequence <b>before</b> you pair your devices. Just enter 32 random hex character (a-f and 0-9). If you change the key later, you will have to repair your devices.", "de": "Transportschlüssel ist der Netzwerkverschlüsselungsschlüssel. Bitte wähle eine zufällige Schlüsselsequenz <b>bevor</b> du Geräte koppelst. Gib einfach 32 zufällige Hex-Zeichen ein (a-f und 0-9). Wenn du den Schlüssel später änderst, musst du alle Geräte neu koppeln.", "ru": "Транспортный ключ - это сетевой ключ шифрования. Пожалуйста, выберите случайную последовательность <b>перед</b> подключением устройств. Просто введите 32 случайных шестнадцатеричных символа (a-f и 0-9). Если вы поменяете ключ позже, вам придется снова спаривать свои устройства.", "pt": "Chave de transporte é a chave de criptografia da rede. ", "nl": "Transportsleutel is de netwerkversleutelingssleutel. Kies een willekeurige toetsenreeks <b> voordat </b> u uw apparaten koppelt. Voer gewoon 32 willekeurige hexadecimale tekens in (a-f en 0-9). Als u de sleutel later wijzigt, moet u alle apparaten opnieuw aanleren.", "fr": "La clé de transport est la clé de chiffrement du réseau. Choisissez s.v.p. une chaîne <b>avant</b> de coupler vos dispositifs. Entrez simplement 32 caractères hexadécimaux aléatoires (a-f et 0-9). Si vous changez la clé plus tard, vous devez re-coupler vos dispositifs.", "it": "La chiave di trasporto è la chiave di crittografia della rete. ", "es": "Transport Key es la clave de cifrado de red. ", "pl": "Klucz transportowy to sieciowy klucz szyfrowania.", "zh-cn": "传输密钥是网络加密密钥。"},
88
88
  "Transport Key": { "en": "Transport Key", "de": "Transportschlüssel", "ru": "Транспортный ключ", "pt": "Chave de transporte", "nl": "Transport sleutel", "fr": "Clé de transport", "it": "Chiave di trasporto", "es": "Transporte clave", "pl": "Klucz transportowy", "zh-cn": "运输钥匙"},
89
89
  "Type": { "en": "Type", "de": "Typ", "ru": "Тип", "pt": "Tipo", "nl": "Type", "fr": "Type", "it": "genere", "es": "Tipo", "pl": "Rodzaj", "zh-cn": "类型"},
90
- "Unbind remote from Coorinator (necessary for some remotes like HUE Dimmer Switch)": {"en": "Unbind remote from coordinator (necessary for some remotes like HUE Dimmer Switch)", "de": "Entkoppele die Fernbedienung vom Koordinator (erforderlich für einige Fernbedienungen wie HUE Dimmer Switch)", "ru": "Отсоедините пульт от Coorinator (необходим для некоторых пультов, таких как HUE Dimmer Switch)", "pt": "Desconecte o controle remoto do Coorinator (necessário para alguns controles remotos, como o HUE Dimmer Switch)", "nl": "Ontkoppel afstandsbediening van Coorinator (noodzakelijk voor sommige afstandsbedieningen zoals HUE Dimmer Switch)", "fr": "Dissocier la télécommande de coordination (nécessaire pour certaines télécommandes comme HUE Dimmer Switch)", "it": "Sblocca il telecomando da Coorinator (necessario per alcuni telecomandi come HUE Dimmer Switch)", "es": "Desvincule el control remoto del Coordinador (necesario para algunos controles remotos como HUE Dimmer Switch)", "pl": "Odłącz pilota od Coorinatora (niezbędny do niektórych pilotów, takich jak HUE Dimmer Switch)", "zh-cn": "从Coorinator取消绑定遥控器(对于某些遥控器,例如HUE Dimmer Switch,这是必需的)"},
90
+ "Unbind remote from Coordinator (necessary for some remotes like HUE Dimmer Switch)": {"en": "Unbind remote from coordinator (necessary for some remotes like HUE Dimmer Switch)", "de": "Entkoppele die Fernbedienung vom Koordinator (erforderlich für einige Fernbedienungen wie HUE Dimmer Switch)", "ru": "Отсоедините пульт от Coordinator (необходим для некоторых пультов, таких как HUE Dimmer Switch)", "pt": "Desconecte o controle remoto do Coordinator (necessário para alguns controles remotos, como o HUE Dimmer Switch)", "nl": "Ontkoppel afstandsbediening van Coordinator (noodzakelijk voor sommige afstandsbedieningen zoals HUE Dimmer Switch)", "fr": "Dissocier la télécommande de coordination (nécessaire pour certaines télécommandes comme HUE Dimmer Switch)", "it": "Sblocca il telecomando da Coordinator (necessario per alcuni telecomandi come HUE Dimmer Switch)", "es": "Desvincule el control remoto del Coordinador (necesario para algunos controles remotos como HUE Dimmer Switch)", "pl": "Odłącz pilota od Coordinatora (niezbędny do niektórych pilotów, takich jak HUE Dimmer Switch)", "zh-cn": "从Coordinator取消绑定遥控器(对于某些遥控器,例如HUE Dimmer Switch,这是必需的)"},
91
91
  "View config": { "en": "View config", "de": "Konfiguration anzeigen", "ru": "Посмотреть конфигурацию", "pt": "Ver configuração", "nl": "Bekijk configuratie", "fr": "Afficher la configuration", "it": "Visualizza config", "es": "Ver configuración", "pl": "Wyświetl config", "zh-cn": "查看配置"},
92
92
  "Waiting": { "en": "Waiting", "de": "Warten", "ru": "Ожидание", "pt": "Esperando", "nl": "Wachtende", "fr": "Attendre", "it": "In attesa", "es": "Esperando", "pl": "Czekaj", "zh-cn": "等候"},
93
93
  "Write Attribute": { "en": "Write attribute", "de": "Attribut schreiben", "ru": "Запись атрибута", "pt": "Gravar Atributo", "nl": "Schrijf attribuut", "fr": "Ecrire attribut", "it": "Scrivi attributo", "es": "Escribir atributo", "pl": "Napisz atrybut", "zh-cn": "写属性"},
@@ -105,4 +105,5 @@ systemDictionary = {
105
105
  "Excludes": { "en": "to exclude", "de": "ausschließen", "ru": "Исключить", "pl": "wyklucz"},
106
106
  "ExcludeTextTranslation": { "en": "Here you can add some devices that should be excluded from our description. They only use \"exposes\" from zigbee-herdsman-converter. After adding, please restart the adapter.", "de": "Sie können hier einige Geräte hinzufügen, die von unserer Verarbeitungausgeschlossen werden sollten. Sie verwenden dann nur exposes vom ZigBee-Herdsman-Converter. Nach dem Hinzufügen starten Sie bitte den Adapter neu.", "ru": "Здесь вы можете добавить устройства, для которых надо исключить представление заданное адаптером (iobroker.zigbee). В этом случае они будут использовать \"exposes\" из zigbee-herdsman-converter. После добавления перезапустите адаптер.", "pl": "Możesz dodać tutaj kilka urządzeń, które powinny zostać wyłączone z naszego opisu. Używasz tylko ekspozycji z zigbee-herdsman-converter. Po dodaniu zrestartuj adapter"},
107
107
  "SettingsExclude": { "en": "Force start adapter with inconsistent configuration (not recommended). Please update the adapter to compatible firmware and recreate your network as soon as possible.", "de": "Erzwingen Sie den Start des Adapters mit inkonsistenter Konfiguration (nicht empfohlen). Bitte aktualisieren Sie den Adapter auf kompatible Firmware und erstellen Sie Ihr Netzwerk so schnell wie möglich neu.", "pl": "Wystaruj Adapter bez zgodnej konfiguracji (uwaga). Zaktualizuj adapter i jak najszybciej odtwórz sieć."},
108
+ "color available state": { "en": "color available state", "de": "Farbe verfügbarer Zustand", "ru": "состояние доступности цвета", "pt": "estado de cor disponível", "nl": "kleur beschikbaar staat", "fr": "état de couleur disponible", "it": "stato disponibile colore", "es": "estado disponible del color", "pl": "kolor stanu", "zh-cn": "颜色可用状态"},
108
109
  };
package/io-package.json CHANGED
@@ -1,8 +1,18 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "zigbee",
4
- "version": "1.6.14",
4
+ "version": "1.6.17",
5
5
  "news": {
6
+ "1.6.16": {
7
+ "de": "admin dep fix",
8
+ "en": "admin dep fix",
9
+ "ru": "admin dep fix"
10
+ },
11
+ "1.6.15": {
12
+ "de": "Batterie Status wurde geändert",
13
+ "en": "Battery status was changed",
14
+ "ru": "Состояние батареи было изменено"
15
+ },
6
16
  "1.6.14": {
7
17
  "de": "Gruppen wurden überarbeitet 2",
8
18
  "en": "Groups were newly revised 2",
@@ -225,7 +235,17 @@
225
235
  "sentry": {
226
236
  "dsn": "https://c829e2ad996d45d1bdb2247805699883@o831057.ingest.sentry.io/5812498"
227
237
  }
228
- }
238
+ },
239
+ "globalDependencies": [
240
+ {
241
+ "admin": ">=5.1.25"
242
+ }
243
+ ],
244
+ "dependencies": [
245
+ {
246
+ "js-controller": ">=3.3.0"
247
+ }
248
+ ]
229
249
  },
230
250
  "native": {
231
251
  "port": "",
@@ -330,6 +350,18 @@
330
350
  "def": ""
331
351
  },
332
352
  "native": {}
353
+ },
354
+ {
355
+ "_id": "info.undefinedDevices",
356
+ "type": "state",
357
+ "common": {
358
+ "name": "Recorded undefined devices",
359
+ "type": "string",
360
+ "read": true,
361
+ "write": false,
362
+ "def": ""
363
+ },
364
+ "native": {}
333
365
  }
334
366
  ]
335
367
  }
package/lib/commands.js CHANGED
@@ -5,7 +5,7 @@ const statesMapping = require('./devices');
5
5
  const disallowedDashStates = [
6
6
  'link_quality', 'available', 'battery', 'groups', 'device_query',
7
7
  'hue_move', 'color_temp_move', 'satuation_move', 'brightness_move', 'brightness_step', 'hue_calibration',
8
- 'msg_from_zigbee',
8
+ 'msg_from_zigbee','send_payload'
9
9
  ];
10
10
 
11
11
  class Commands {
package/lib/devices.js CHANGED
@@ -118,9 +118,9 @@ const sync = {
118
118
  },
119
119
  };
120
120
 
121
- const lightStatesWithColortemp = [states.state, states.brightness, states.colortemp,states.brightness_move, states.transition_time];
122
- const lightStatesWithColor = [states.state, states.brightness, states.colortemp, states.color,states.brightness_move, states.transition_time];
123
- const lightStatesWithColor_hue = [states.state, states.brightness, states.colortemp, states.color,states.brightness_move, states.transition_time, states.effect_type_hue];
121
+ const lightStatesWithColortemp = [states.state, states.brightness, states.colortemp,states.brightness_move, states.colortemp_move, states.transition_time];
122
+ const lightStatesWithColor = [states.state, states.brightness, states.colortemp, states.color,states.brightness_move, states.colortemp_move, states.transition_time];
123
+ const lightStatesWithColor_hue = [states.state, states.brightness, states.colortemp, states.color,states.brightness_move, states.colortemp_move, states.hue_move, states.transition_time, states.effect_type_hue];
124
124
  const lightStatesWithColorNoTemp = [states.state, states.brightness, states.color, states.brightness_move, states.transition_time];
125
125
  const lightStates = [states.state, states.brightness, states.brightness_move, states.transition_time];
126
126
 
@@ -984,7 +984,7 @@ const devices = [
984
984
  syncStates: [sync.brightness],
985
985
  },
986
986
  {
987
- models: ['AC0251100NJ/AC0251700NJ'],
987
+ models: ['AC0251100NJ/AC0251600NJ/AC0251700NJ'],
988
988
  icon: 'img/lightify-switch.png',
989
989
  states: [states.switch_state, states.switch_circle, states.switch_hold, states.switch_release, states.battery],
990
990
  },
@@ -3043,29 +3043,29 @@ const devices = [
3043
3043
  icon: 'img/ICZB-RM11S.png',
3044
3044
  states: generator.icasa_remote,
3045
3045
  },
3046
-
3047
- /* images only for admin */
3046
+
3047
+ /* images only for admin */
3048
3048
  {
3049
3049
  models: ['E1812'],
3050
3050
  icon: 'img/ikea_E1812.png',
3051
- },
3052
- {
3051
+ },
3052
+ {
3053
3053
  models: ['WHD02'],
3054
3054
  icon: 'img/WHD02.png',
3055
3055
  },
3056
- {
3056
+ {
3057
3057
  models: ['R7060'],
3058
3058
  icon: 'img/R7060.png',
3059
3059
  },
3060
- {
3060
+ {
3061
3061
  models: ['929001821618'],
3062
3062
  icon: 'img/philips_hue_ambiance.png',
3063
3063
  },
3064
- {
3064
+ {
3065
3065
  models: ['14153905L'],
3066
3066
  icon: 'img/14153905L.png',
3067
3067
  },
3068
- {
3068
+ {
3069
3069
  models: ['HG06338'],
3070
3070
  icon: 'img/HG06338.png',
3071
3071
  },
@@ -3077,11 +3077,11 @@ const devices = [
3077
3077
  models: ['TI0001-cover'],
3078
3078
  icon: 'img/TI0001-cover.png',
3079
3079
  },
3080
- {
3080
+ {
3081
3081
  models: ['E1603/E1702/E1708'],
3082
3082
  icon: 'img/ikea_control_outlet.png',
3083
3083
  },
3084
-
3084
+
3085
3085
  ];
3086
3086
 
3087
3087
  const commonStates = [
@@ -3089,6 +3089,7 @@ const commonStates = [
3089
3089
  states.available,
3090
3090
  states.device_query,
3091
3091
  states.from_zigbee,
3092
+ states.send_payload,
3092
3093
  ];
3093
3094
 
3094
3095
  const groupStates = [states.brightness_step].concat(lightStatesWithColor);
package/lib/exposes.js CHANGED
@@ -302,6 +302,7 @@ function createFromExposes(model, def) {
302
302
  return {...options, transition: transitionTime};
303
303
  },
304
304
  epname: expose.endpoint,
305
+ setattr: 'color_temp',
305
306
  }, prop.access);
306
307
  pushToStates(statesDefs.colortemp_move, prop.access);
307
308
  break;
@@ -585,6 +586,13 @@ function createFromExposes(model, def) {
585
586
  case 'enum':
586
587
  switch (expose.name) {
587
588
  case 'action': {
589
+
590
+ // Ansatz:
591
+
592
+ // Action aufspalten in 2 Blöcke:
593
+ // Action (bekommt text ausser hold und release, auto reset nach 250 ms)
594
+ // Hold: wird gesetzt bei hold, gelöscht bei passendem Release
595
+
588
596
  if (!Array.isArray(expose.values)) break;
589
597
  const hasHold = expose.values.find((actionName) => actionName.includes('hold'));
590
598
  const hasRelease = expose.values.find((actionName) => actionName.includes('release'));
@@ -774,13 +782,17 @@ function applyExposes(mappedDevices, byModel, allExcludesObj) {
774
782
  const existsMap = byModel.get(strippedModel);
775
783
 
776
784
  if ((deviceDef.hasOwnProperty('exposes') && (!existsMap || !existsMap.hasOwnProperty('states'))) || allExcludesStr.indexOf(strippedModel) > 0) {
777
- const newDevice = createFromExposes(strippedModel, deviceDef);
778
- if (!existsMap) {
779
- mappedDevices.push(newDevice);
780
- byModel.set(strippedModel, newDevice);
781
- } else {
782
- existsMap.states = newDevice.states;
783
- existsMap.exposed = true;
785
+ try {
786
+ const newDevice = createFromExposes(strippedModel, deviceDef);
787
+ if (!existsMap) {
788
+ mappedDevices.push(newDevice);
789
+ byModel.set(strippedModel, newDevice);
790
+ } else {
791
+ existsMap.states = newDevice.states;
792
+ existsMap.exposed = true;
793
+ }
794
+ } catch (e) {
795
+ console.log(`Wrong expose devicedefinition ${deviceDef.vendor} ${deviceDef.model}` );
784
796
  }
785
797
  }
786
798
  }
@@ -788,4 +800,4 @@ function applyExposes(mappedDevices, byModel, allExcludesObj) {
788
800
 
789
801
  module.exports = {
790
802
  applyExposes: applyExposes,
791
- };
803
+ };
package/lib/states.js CHANGED
@@ -113,6 +113,15 @@ const states = {
113
113
  read: true,
114
114
  type: 'string',
115
115
  },
116
+ send_payload: {
117
+ id: 'send_payload',
118
+ name: 'Send to Device',
119
+ icon: undefined,
120
+ role: 'state',
121
+ write: true,
122
+ read: true,
123
+ type: 'string',
124
+ },
116
125
  checking: { // press button for checking
117
126
  id: 'checking',
118
127
  name: 'Start checking process',
@@ -18,10 +18,18 @@ class StatesController extends EventEmitter {
18
18
  this.debugDevices = undefined;
19
19
  let fn = adapter.expandFileName('dev_names.json');
20
20
  this.dev_names_fn = fn.replace('.', '_');
21
+ this.retTimeoutHandle = null;
21
22
  fs.readFile(this.dev_names_fn, (err, data) => {
22
- if (!err) {
23
- savedDeviceNames = JSON.parse(data);
24
- }
23
+ if (!err) {
24
+ try
25
+ {
26
+ savedDeviceNames = JSON.parse(data);
27
+ }
28
+ catch
29
+ {
30
+ savedDeviceNames = {};
31
+ };
32
+ }
25
33
  });
26
34
  }
27
35
 
@@ -47,12 +55,14 @@ class StatesController extends EventEmitter {
47
55
 
48
56
  retainDeviceNames()
49
57
  {
50
- fs.writeFile(this.dev_names_fn, JSON.stringify(savedDeviceNames, null, 2), (err) => {
51
- if (err)
52
- this.error('error saving device names: ' + JSON.Stringify(err));
53
- else
54
- this.debug('saved device names');
55
- });
58
+ clearTimeout(this.retTimeoutHandle);
59
+ this.retTimeoutHanlde = setTimeout(()=> {
60
+ fs.writeFile(this.dev_names_fn, JSON.stringify(savedDeviceNames, null, 2), (err) => {
61
+ if (err)
62
+ this.error('error saving device names: ' + JSON.Stringify(err));
63
+ else
64
+ this.debug('saved device names');
65
+ });},5000);
56
66
  }
57
67
 
58
68
  getDebugDevices() {
@@ -6,6 +6,7 @@ class BaseExtension {
6
6
  constructor(zigbee, options) {
7
7
  this.zigbee = zigbee;
8
8
  this.name = 'BaseExtension';
9
+ this.elevate_debug = false;
9
10
  }
10
11
 
11
12
  info(message, data) {
@@ -21,7 +22,10 @@ class BaseExtension {
21
22
  }
22
23
 
23
24
  debug(message, data) {
24
- this.zigbee.debug(this.name + ':' + message, data);
25
+ if (this.elevate_debug)
26
+ this.zigbee.warn('DE ' + this.name + ':' + message, data);
27
+ else
28
+ this.zigbee.debug(this.name + ':' + message, data);
25
29
  }
26
30
 
27
31
  sendError(error, message) {
@@ -52,6 +52,7 @@ class DeviceAvailability extends BaseExtension {
52
52
  this.startDevicePingTimeout = null; // handle for the timeout which empties the queue
53
53
  this.startDevicePingDelay = 200; // 200 ms delay between starting the ping timeout
54
54
  this.name = "DeviceAvailability";
55
+ this.elevate_debug = false;
55
56
  }
56
57
 
57
58
  setOptions(options) {
@@ -270,6 +271,8 @@ class DeviceAvailability extends BaseExtension {
270
271
  this.zigbee.emit('publish', ieeeAddr.substr(2), entity.mapped.model, payload);
271
272
  this.debug(`Publish LQ for ${ieeeAddr} = ${(available ? 10: 0)}`);
272
273
  this.zigbee.emit('publish', ieeeAddr.substr(2), entity.mapped.model, { linkquality: (available ? 10: 0) });
274
+
275
+ this.zigbee.emit('deviceStatusUpdate', ieeeAddr.substr(2), available);
273
276
  }
274
277
  // if (!available) {
275
278
  // this.debug(`Publish LQ for ${ieeeAddr} = 0`);
package/main.js CHANGED
@@ -197,6 +197,7 @@ class Zigbee extends utils.Adapter {
197
197
  this.zbController.on('event', this.onZigbeeEvent.bind(this));
198
198
  this.zbController.on('msg', this.onZigbeeEvent.bind(this));
199
199
  this.zbController.on('publish', this.publishToState.bind(this));
200
+ this.zbController.on('deviceStatusUpdate', this.onDeviceStatusUpdate.bind(this));
200
201
  this.zbController.configure(zigbeeOptions);
201
202
  await this.callPluginMethod('configure', [zigbeeOptions]);
202
203
 
@@ -507,6 +508,21 @@ class Zigbee extends utils.Adapter {
507
508
  const stateDesc = changedState.stateDesc;
508
509
  const value = changedState.value;
509
510
 
511
+ if (stateDesc.id == 'send_payload') {
512
+ try {
513
+ const json_value = JSON.parse(value);
514
+ const payload = { device:deviceId.replace('0x', ''), payload:json_value };
515
+ const result = await(this.SendPayload(payload));
516
+ if (result.hasOwnProperty('success') && result.success) {
517
+ this.acknowledgeState(deviceId, model, stateDesc, value);
518
+ }
519
+ } catch (error) {
520
+ this.log.warn(`send_payload: ${value} does not parse as JSON Object : ${error.message}`);
521
+ return;
522
+ }
523
+ return;
524
+ }
525
+
510
526
  if (stateDesc.isOption) {
511
527
  // acknowledge state with given value
512
528
  this.acknowledgeState(deviceId, model, stateDesc, value);
@@ -530,6 +546,7 @@ class Zigbee extends utils.Adapter {
530
546
  await converter.convertGet(entity.device.endpoints[0], ckey, {});
531
547
  } catch (error) {
532
548
  this.log.warn(`Failed to read state '${JSON.stringify(ckey)}'of '${entity.device.ieeeAddr}' after query with '${JSON.stringify(error)}'`);
549
+
533
550
  }
534
551
  }
535
552
  }
@@ -615,8 +632,6 @@ class Zigbee extends utils.Adapter {
615
632
  // not exposed as states. It serves as a wrapper function for "publishFromState" with
616
633
  // extended parameter checking
617
634
  //
618
- // This function is NEVER called from within the adapter itself. The entire structure
619
- // is built for end user use.
620
635
  // The payload can either be a JSON object or the string representation of a JSON object
621
636
  // The following keys are supported in the object:
622
637
  // device: name of the device. For a device zigbee.0.0011223344556677 this would be 0011223344556677
@@ -643,7 +658,6 @@ class Zigbee extends utils.Adapter {
643
658
  const isDevice = payload.device.indexOf('group_') == -1;
644
659
  const stateList = [];
645
660
  const devID = (isDevice ? `0x${payload.device}`:parseInt(payload.device.replace('group_', '')));
646
- this.log.warn(`A ${payload.device} ${devID}`);
647
661
 
648
662
  const entity = await this.zbController.resolveEntity(devID);
649
663
  if (!entity) {
@@ -741,6 +755,31 @@ class Zigbee extends utils.Adapter {
741
755
  }
742
756
  }
743
757
  }
758
+ async onDeviceStatusUpdate(deviceId, status) {
759
+ if (!deviceId) return;
760
+
761
+ this.log.debug(`onDeviceStatusUpdate: ${deviceId}: ${status}`);
762
+
763
+ try {
764
+ let colorIeee = '#46a100ff';
765
+
766
+ if (!status) {
767
+ colorIeee = '#ff0400ff'; // dev is offline
768
+ }
769
+
770
+ if (!this.config.colorize) {
771
+ colorIeee = null;
772
+ }
773
+
774
+ await this.extendObjectAsync(deviceId, {
775
+ common: {
776
+ color: colorIeee
777
+ }
778
+ });
779
+ } catch (e) {
780
+ this.log.error(e.toString());
781
+ }
782
+ }
744
783
 
745
784
  /**
746
785
  * @param {() => void} callback
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.zigbee",
3
- "version": "1.6.14",
3
+ "version": "1.6.17",
4
4
  "author": {
5
5
  "name": "Kirov Ilya",
6
6
  "email": "kirovilya@gmail.com"
@@ -18,24 +18,27 @@
18
18
  "node": ">=10"
19
19
  },
20
20
  "dependencies": {
21
- "zigbee-herdsman": "0.14.6",
22
- "zigbee-herdsman-converters": "14.0.397",
21
+ "zigbee-herdsman": "0.14.26",
22
+ "zigbee-herdsman-converters": "14.0.491",
23
23
  "@iobroker/adapter-core": "^2.4.0",
24
24
  "tar": "^6.0.5",
25
25
  "typescript": "^4.0.5"
26
26
  },
27
27
  "description": "Zigbee devices",
28
28
  "devDependencies": {
29
- "@alcalzone/release-script": "^2.2.0",
30
- "@iobroker/testing": "^2.5.1",
29
+ "@alcalzone/release-script": "~3.4.2",
30
+ "@iobroker/testing": "^2.5.4",
31
31
  "axios": "^0.21.1",
32
32
  "mixin-deep": "^1.3.2",
33
- "chai": "^4.2.0",
34
33
  "eslint": "^7.18.0",
35
34
  "eslint-config-google": "*",
36
- "gulp": "^4.0.0",
37
35
  "lint-diff": "*",
38
- "mocha": "^6.0.2"
36
+ "chai": "^4.3.4",
37
+ "chai-as-promised": "^7.1.1",
38
+ "gulp": "^4.0.2",
39
+ "gulp-jsdoc3": "^3.0.0",
40
+ "gulp-replace": "^1.1.3",
41
+ "mocha": "^9.1.3"
39
42
  },
40
43
  "homepage": "https://github.com/ioBroker/ioBroker.zigbee",
41
44
  "keywords": [
@@ -1,36 +0,0 @@
1
- // For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
2
- // https://github.com/microsoft/vscode-dev-containers/tree/v0.101.1/containers/docker-existing-docker-compose
3
- // If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
4
- {
5
- "name": "ioBroker Docker Compose",
6
-
7
- // Update the 'dockerComposeFile' list if you have more compose files or use different names.
8
- // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
9
- "dockerComposeFile": ["docker-compose.yml"],
10
-
11
- // The 'service' property is the name of the service for the container that VS Code should
12
- // use. Update this value and .devcontainer/docker-compose.yml to the real service name.
13
- "service": "iobroker",
14
-
15
- // The optional 'workspaceFolder' property is the path VS Code should open by default when
16
- // connected. This is typically a file mount in .devcontainer/docker-compose.yml
17
- "workspaceFolder": "/workspace",
18
-
19
- // Set *default* container specific settings.json values on container create.
20
- "settings": {},
21
-
22
- // Add the IDs of extensions you want installed when the container is created.
23
- "extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
24
-
25
- // Uncomment the next line if you want start specific services in your Docker Compose config.
26
- // "runServices": [],
27
-
28
- // Uncomment the next line if you want to keep your containers running after VS Code shuts down.
29
- // "shutdownAction": "none",
30
-
31
- // When creating the container, delete unnecessary adapters, disable error reporting, set the license as confirmed, and install/update this adapter
32
- "postCreateCommand": "iob del discovery && iob plugin disable sentry && iob object set system.config common.licenseConfirmed=true && NPM_PACK=$(npm pack) && iob url \"$(pwd)/$NPM_PACK\" --debug && rm \"$NPM_PACK\""
33
-
34
- // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
35
- //"remoteUser": "iobroker"
36
- }
@@ -1,51 +0,0 @@
1
- version: '3'
2
-
3
- services:
4
- iobroker:
5
- build: ./iobroker
6
- container_name: iobroker-zigbee-d
7
- hostname: iobroker-zigbee-d
8
- # This port is only internal, so we can work on this while another instance of ioBroker is running on the host
9
- expose:
10
- - 8081
11
- volumes:
12
- - ..:/workspace
13
- - iobrokerdata-zigbee-d:/opt/iobroker
14
- environment:
15
- - LANG=en_US.UTF-8
16
- - LANGUAGE=en_US:en
17
- - LC_ALL=en_US.UTF-8
18
- - TZ=Europe/Berlin
19
- - SETGID=1000
20
-
21
- parcel:
22
- container_name: parcel-i2c
23
- build: ./parcel
24
- expose:
25
- - 1234
26
- ports:
27
- - '1235:1235'
28
- volumes:
29
- - ..:/workspace
30
- environment:
31
- - CHOKIDAR_USEPOLLING=1
32
-
33
- # Reverse proxy to load up-to-date admin sources from the repo
34
- nginx:
35
- image: nginx:latest
36
- depends_on:
37
- - iobroker
38
- - parcel
39
- links:
40
- - iobroker
41
- - parcel
42
- container_name: nginx-dvlp
43
- volumes:
44
- - ./nginx/nginx.conf:/etc/nginx/nginx.conf
45
- - ..:/workspace
46
- ports:
47
- # Make the ioBroker admin available under http://localhost:8082
48
- - 8082:80
49
-
50
- volumes:
51
- iobrokerdata-zigbee-d:
@@ -1,2 +0,0 @@
1
- FROM buanet/iobroker:latest
2
- RUN ln -s /opt/iobroker/node_modules/ /root/.node_modules
@@ -1,33 +0,0 @@
1
-
2
- worker_processes 1;
3
- events { worker_connections 1024; }
4
-
5
- http {
6
- sendfile on;
7
- keepalive_timeout 65;
8
-
9
- server {
10
- listen 80;
11
-
12
- location / {
13
- proxy_redirect off;
14
- proxy_pass http://iobroker:8081;
15
- }
16
-
17
- location /socket.io/ {
18
- proxy_pass http://iobroker:8081;
19
- proxy_http_version 1.1;
20
- proxy_set_header Upgrade $http_upgrade;
21
- proxy_set_header Connection "Upgrade";
22
- }
23
-
24
- location /adapter/i2c/ {
25
- alias /workspace/admin/;
26
- }
27
-
28
- location /adapter/i2c/build/ {
29
- proxy_redirect off;
30
- proxy_pass http://parcel:1234/;
31
- }
32
- }
33
- }
@@ -1,9 +0,0 @@
1
- FROM node:12
2
-
3
- RUN mkdir -p /usr/app
4
-
5
- COPY *.sh /usr/app/
6
-
7
- RUN chmod +x /usr/app/*.sh
8
-
9
- CMD /bin/bash -c "/usr/app/run.sh"
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- cd /workspace
3
-
4
- echo "Installing all dependencies..."
5
- npm install
6
-
7
- npm run watch:parcel