iobroker.zigbee2mqtt 2.7.5 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -32,6 +32,11 @@ 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.8.0 (2023-07-19)
36
+
37
+ - (o0shojo0o) added WSS support for websoket connection([#191](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/191))
38
+ - (o0shojo0o) small fixes
39
+
35
40
  ### 2.7.5 (2023-04-08)
36
41
 
37
42
  - (o0shojo0o) added state `last_seen` contains date/time of last Zigbee message ([#131](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/131))
@@ -38,10 +38,26 @@
38
38
  "text": "Configure your Zigbee2MQTT connection",
39
39
  "newLine": true
40
40
  },
41
+ "wsScheme": {
42
+ "type": "select",
43
+ "label": "Scheme",
44
+ "options": [
45
+ {
46
+ "label": "WS",
47
+ "value": "ws"
48
+ },
49
+ {
50
+ "label": "WSS (SSL)",
51
+ "value": "wss"
52
+ }
53
+ ],
54
+ "newLine": true,
55
+ "hidden": "data.connectionType != 'ws'"
56
+ },
41
57
  "wsServerIP": {
42
58
  "type": "text",
43
59
  "label": "Websocket IP-Address",
44
- "newLine": true,
60
+ "newLine": false,
45
61
  "hidden": "data.connectionType != 'ws'"
46
62
  },
47
63
  "wsServerPort": {
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "zigbee2mqtt",
4
- "version": "2.7.5",
4
+ "version": "2.8.0",
5
5
  "news": {
6
+ "2.8.0": {
7
+ "en": "added WSS support for websoket connection([#191](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/191))\nsmall fixes",
8
+ "de": "wSS-Unterstützung für Websoket-Verbindung([#191](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/191)\nkleine fixierungen",
9
+ "ru": "добавлена поддержка WSS для подключения к websoket([#191](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/191)\nнебольшие исправления",
10
+ "pt": "adicionado suporte WSS para conexão websoket([#191](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/191)\npequenas correções",
11
+ "nl": "voegde WSS steun toe voor websoket connectie\nkleine fixes",
12
+ "fr": "a ajouté le support WSS pour la connexion websoket([#191](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/191)\npetites corrections",
13
+ "it": "supporto WSS aggiunto per il collegamento websoket([#191](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/191)\npiccole correzioni",
14
+ "es": "añadido WSS support for websoket connection([#191](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/191)\npequeños accesorios",
15
+ "pl": "dodano obsługę stron internetowych (#191(https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/191)\ndrobne rozwiązanie",
16
+ "uk": "javaScript licenses API Веб-сайт Go1.13.8\nмаленькі кріплення",
17
+ "zh-cn": "增加了WSS支助网络联系([第191](http://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/191)\n小型配件"
18
+ },
6
19
  "2.7.5": {
7
20
  "en": "added state `last_seen` contains date/time of last Zigbee message ([#131](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/131))",
8
21
  "de": "add state last_seen enthält Datum/Zeit der letzten Zigbee-Nachricht [#131](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/131)",
@@ -80,19 +93,6 @@
80
93
  "pl": "dodano wsparcie dla działań na rzecz dzikich kart (eg. *_single) #116(https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/116)\ndodano optymalizację błędów (https:/github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1382038679)\nauth_token for websocket connection #112(https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/112)\nczas dostępu do stron internetowych wzrastał",
81
94
  "uk": "додана підтримка дій дикої картки (наприклад, *_single) [#116](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/116)\nдодано оптимізацію обробки помилок [більше](https://github.com/ioBroker/ioBroker.repositories/pull/1976#productcomment-1382038679)\nдодано опцію auth_token для підключення websocket [#112](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/112)\nwebsocket час",
82
95
  "zh-cn": "对野生卡行动(第 *_single)[第116](http://github.com/oshojo0o/ioBroker.zigbee2mqt/issues/116))的支持\n新增的错误处理优化[(http://github.com/ioBroker/ioBroker.reories/pull/1976#issuement-1382038679)\n添加以下选择:网站联系(第112号)(http://github.com/oshojo0o/ioBroker.zigbee2mqt/issues/112)\n网页"
83
- },
84
- "2.6.0": {
85
- "en": "added state `transition` for transition overwrite (-1 disabled overwrite) ([#101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101))\nconsideration of the description when creating the friendly name ([#105](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/105))\nadded state `effect` for groups ([#101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101))\nfix state contact\nadded handling for disabled devices",
86
- "de": "hinzugefügter Zustandsübergang für Übergangsüberschreiben -(1 behinderte Überschreiben) #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nberücksichtigung der Beschreibung bei der Erstellung des freundlichen Namens #[105](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/105)\nzusätzliche staatliche Wirkung für Gruppen #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/101)\nkontakt mit dem status\nzusätzliches handling für behinderte",
87
- "ru": "добавлен государственный переход для перехода переписать -(1 отключен перезапись) #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nрассмотрение описания при создании дружественного имени #[105](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/105)\nдобавлен государственный эффект для групп #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nисправить государственный контакт\nдобавлена обработка для инвалидов",
88
- "pt": "adicionado transição de estado para a transição sobreescrita -(1 sobreescrita desativada) #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nconsideração da descrição ao criar o nome amigável #[105](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/105)\nadicionado efeito estatal para grupos #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\ncorrigir contato estado\nmanuseio adicionado para dispositivos com deficiência",
89
- "nl": "voegde staatsoverschrijving toe voor overschrijving overschrijving - (1 gehandicapte overschrijving) (1) (1 gehandicapte overschrijving)\noverweeg de beschrijving als het creëren van de vriendelijke naam £10:\nvoegde toegevoegd staats effect voor groepen £101, httub.com/oshojoo/ioBroker\nvertaling:\nvoegde toegevoegd voor gehandicapte apparaten",
90
- "fr": "transition de l ' État pour la surécriture de transition -(1 surécriture désactivée) #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/101)\nexamen de la description lors de la création du nom amical #[105](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/105)\neffet d ' État ajouté pour les groupes #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/101)\ncontact étatique\nmanipulation supplémentaire pour les dispositifs handicapés",
91
- "it": "aggiunto passaggio di stato per overwrite di transizione -(1 overwrite disabilitato) #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/101)\nconsiderazione della descrizione quando si crea il nome amichevole #[105](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/105)\neffetto stato aggiunto per gruppi #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/101)\nfix contatto stato\nmanipolazione aggiuntiva per dispositivi disabili",
92
- "es": "añadida transición estatal para la sobreescritura de transición -(1 invalidez sobreescritura) #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nexamen de la descripción al crear el nombre amistoso #[105](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/105)\nañadido efecto estatal para los grupos #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\narreglar contacto estado\nmanejo añadido para dispositivos discapacitados",
93
- "pl": "dodano przejście stanowe na przepisanie -(1 disabled overwrite) #101(https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nrezultatem tego opisu było stworzenie przyjaznej nazwy #105 (https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/105)\ndodano efekt stanowy dla grup #101 (https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nkontakt państwowy\nobsługa urządzeń dla osób niepełnosprawnych",
94
- "uk": "додано державний перехід для переходу перезапису -(1 вимкнено перезапис) #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nрозгляд опису при створенні дружньої назви #[105](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/products/105)\nдодано державний ефект для груп #[101](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/101)\nфіксувати державний контакт\nдодана обробка для пристроїв відключення",
95
- "zh-cn": "此外,国家向过渡过渡的过渡——《残疾》第[101]号(http://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/101)\n在建立友好名称编号(http://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/105)时,审议说明\n第[101]号(http://github.com/oshojo0o/ioBroker.zigbee2mqt/issues/101)\nfix 国家联络点\nd. 增加处理残疾装置"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -183,6 +183,7 @@
183
183
  },
184
184
  "native": {
185
185
  "connectionType": "ws",
186
+ "wsScheme": "ws",
186
187
  "wsServerIP": "",
187
188
  "wsServerPort": 8080,
188
189
  "wsTokenEnabled": false,
package/lib/messages.js CHANGED
@@ -5,6 +5,7 @@ async function adapterInfo(config, log) {
5
5
  log.info(`|| Zigbee2MQTT Frontend Port: ${config.webUIPort}`);
6
6
  log.info(`|| Zigbee2MQTT Connection Type: ${config.connectionType}`);
7
7
  if (config.connectionType == 'ws') {
8
+ log.info(`|| Zigbee2MQTT Websocket Scheme: ${config.wsScheme}`);
8
9
  log.info(`|| Zigbee2MQTT Websocket Server: ${config.wsServerIP}`);
9
10
  log.info(`|| Zigbee2MQTT Websocket Port: ${config.wsServerPort}`);
10
11
  log.info(`|| Zigbee2MQTT Websocket Auth-Token: ${config.wsTokenEnabled ? 'use' : 'unused'}`);
@@ -13,13 +13,13 @@ class WebsocketController {
13
13
 
14
14
  initWsClient() {
15
15
  try {
16
- let wsURL = `ws://${this.adapter.config.wsServerIP}:${this.adapter.config.wsServerPort}/api`;
16
+ let wsURL = `${this.adapter.config.wsScheme}://${this.adapter.config.wsServerIP}:${this.adapter.config.wsServerPort}/api`;
17
17
 
18
18
  if (this.adapter.config.wsTokenEnabled == true) {
19
19
  wsURL += `?token=${this.adapter.config.wsToken}`;
20
20
  }
21
21
 
22
- wsClient = new WebSocket(wsURL);
22
+ wsClient = new WebSocket(wsURL), { rejectUnauthorized: false };
23
23
 
24
24
  wsClient.on('open', () => {
25
25
  // Send ping to server
package/main.js CHANGED
@@ -226,7 +226,9 @@ class Zigbee2mqtt extends core.Adapter {
226
226
  if (['exmqtt', 'intmqtt'].includes(this.config.connectionType)) {
227
227
  if (mqttClient && !mqttClient.closed) {
228
228
  try {
229
- mqttClient.close();
229
+ if (mqttClient) {
230
+ mqttClient.close();
231
+ }
230
232
  } catch (e) {
231
233
  this.log.error(e);
232
234
  }
@@ -235,7 +237,9 @@ class Zigbee2mqtt extends core.Adapter {
235
237
  // Internal or Dummy MQTT-Server
236
238
  if (this.config.connectionType == 'intmqtt' || this.config.dummyMqtt == true) {
237
239
  try {
238
- mqttServerController.closeServer();
240
+ if (mqttServerController) {
241
+ mqttServerController.closeServer();
242
+ }
239
243
  } catch (e) {
240
244
  this.log.error(e);
241
245
  }
@@ -243,26 +247,34 @@ class Zigbee2mqtt extends core.Adapter {
243
247
  // Websocket
244
248
  else if (this.config.connectionType == 'ws') {
245
249
  try {
246
- websocketController.closeConnection();
250
+ if (websocketController) {
251
+ websocketController.closeConnection();
252
+ }
247
253
  } catch (e) {
248
254
  this.log.error(e);
249
255
  }
250
256
  }
251
257
  // Set all device available states of false
252
258
  try {
253
- await statesController.setAllAvailableToFalse();
259
+ if (statesController) {
260
+ await statesController.setAllAvailableToFalse();
261
+ }
254
262
  } catch (e) {
255
263
  this.log.error(e);
256
264
  }
257
265
  // Clear all websocket timers
258
266
  try {
259
- await websocketController.allTimerClear();
267
+ if (websocketController) {
268
+ await websocketController.allTimerClear();
269
+ }
260
270
  } catch (e) {
261
271
  this.log.error(e);
262
272
  }
263
273
  // Clear all state timers
264
274
  try {
265
- await statesController.allTimerClear();
275
+ if (statesController) {
276
+ await statesController.allTimerClear();
277
+ }
266
278
  } catch (e) {
267
279
  this.log.error(e);
268
280
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.zigbee2mqtt",
3
- "version": "2.7.5",
3
+ "version": "2.8.0",
4
4
  "description": "Zigbee2MQTT adapter for ioBroker",
5
5
  "author": {
6
6
  "name": "Dennis Rathjen",
@@ -27,30 +27,31 @@
27
27
  "ws": "^8.13.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@alcalzone/release-script-plugin-iobroker": "^3.5.9",
30
+ "@alcalzone/release-script": "^3.6.0",
31
+ "@alcalzone/release-script-plugin-iobroker": "^3.6.0",
31
32
  "@alcalzone/release-script-plugin-license": "^3.5.9",
32
- "@alcalzone/release-script": "^3.5.9",
33
+ "@alcalzone/release-script-plugin-manual-review": "^3.5.9",
33
34
  "@iobroker/adapter-dev": "^1.2.0",
34
35
  "@iobroker/testing": "^4.1.0",
35
- "@tsconfig/node14": "^1.0.3",
36
- "@types/chai": "^4.3.4",
36
+ "@tsconfig/node14": "^14.1.0",
37
+ "@types/chai": "^4.3.5",
37
38
  "@types/chai-as-promised": "^7.1.5",
38
39
  "@types/mocha": "^10.0.1",
39
- "@types/node": "^18.15.11",
40
+ "@types/node": "^20.4.2",
40
41
  "@types/proxyquire": "^1.3.28",
41
- "@types/sinon": "^10.0.13",
42
+ "@types/sinon": "^10.0.15",
42
43
  "@types/sinon-chai": "^3.2.9",
43
44
  "chai": "^4.3.7",
44
45
  "chai-as-promised": "^7.1.1",
45
- "eslint": "^8.37.0",
46
+ "eslint": "^8.45.0",
46
47
  "eslint-config-prettier": "^8.8.0",
47
- "eslint-plugin-prettier": "^4.2.1",
48
+ "eslint-plugin-prettier": "^5.0.0",
48
49
  "mocha": "^10.2.0",
49
- "prettier": "^2.8.7",
50
+ "prettier": "^3.0.0",
50
51
  "proxyquire": "^2.1.3",
51
- "sinon": "^15.0.3",
52
+ "sinon": "^15.2.0",
52
53
  "sinon-chai": "^3.7.0",
53
- "typescript": "~5.0.3"
54
+ "typescript": "~5.1.6"
54
55
  },
55
56
  "main": "main.js",
56
57
  "files": [