iobroker.zwavews 0.0.16 → 0.0.18

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
@@ -20,22 +20,29 @@ The `zwavews` adapter connects a [`zwave-js-ui`](https://zwave-js.github.io/zwav
20
20
 
21
21
  ## Adapter Documentation
22
22
 
23
- What is required is to install zwave-js-ui and activate WS communication.
24
- Switching from the zwave2 adapter is easy because all information is stored on the coordinator.
25
- You only need to wake up the battery-powered devices once so that zwave-js-ui can read them in again.
23
+ It is necessary to install zwave-js-ui (it is possible to migrate the zwave2 Devices to zwave-js-ui. Copy json cache file from /opt/iobroker/iobroker-data/zwave2/ into Z-Wave JS UI's store directory. then start zwave-js-ui) and activate WS communication. <br>
24
+ Switching from the zwave2 adapter is easy because all information is stored on the coordinator. <br>
25
+ You only need to wake up the battery-powered devices once so that zwave-js-ui can read them again or migrate it from zwave2. <br>
26
26
 
27
27
  <img width="1444" height="740" alt="grafik" src="https://github.com/user-attachments/assets/876a81d3-04ab-43c6-914e-86772d0188e1" />
28
28
  <p></p>
29
29
 
30
30
 
31
- Activate WS Server Settings in `zwave-js-ui` <br>
32
- we use the Home Assistant Settings for this:
31
+ Activate WS Server Settings in `zwave-js-ui` we use the Home Assistant Settings for this:
33
32
 
34
33
 
35
34
  <img width="1887" height="479" alt="grafik" src="https://github.com/user-attachments/assets/6ed8cf36-2d91-435f-91d7-86e430bb0c6c" />
36
35
 
37
36
 
38
37
  ## Changelog
38
+ ### 0.0.18 (2026-02-28)
39
+ * (arteck) add info.sendMessageAllowed object to allow sending the message to zwave-ui-js
40
+ * (arteck) add new checkbox to set info.sendMessageAllowed immediately after starting the adapter
41
+
42
+ ### 0.0.17 (2026-02-20)
43
+ * (arteck) fix adapter start
44
+ * (arteck) Dependencies have been updated
45
+
39
46
  ### 0.0.16 (2026-02-09)
40
47
  * (arteck) fix warning message
41
48
 
@@ -31,5 +31,8 @@
31
31
  "Always refresh node infos": "Node-Informationen immer aktualisieren",
32
32
  "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name": "Die Ereignisse wie 'Gerät entfernt' oder 'Deaktiviert' werden in der Beschreibung anstelle des Namens angezeigt",
33
33
  "Inform about wake up and sleep of battery devices in the log": "Über das Aufwachen und Schlafen von batteriebetriebenen Geräten im Protokoll informieren",
34
- "new Type event Warning in log": "neue Typ-Ereigniswarnung im Protokoll"
34
+ "new Type event Warning in log": "neue Typ-Ereigniswarnung im Protokoll",
35
+ "allow start send WS message directly after adapter start": "Erlaube das Senden von WS-Nachrichten direkt nach dem Adapterstart",
36
+ "This allows you to decide whether messages are sent immediately after the adapter starts. If the checkbox is false, the last status is taken from the info.sendMessageAllowed DP.": "damit kann man entscheiden ob die Nachrichten direkt nach adapter Start gesendet werden. Ist die checkbox false wird der letzte Status aus dem info.sendMessageAllowed DP genommen."
37
+
35
38
  }
@@ -31,6 +31,8 @@
31
31
  "Always refresh node infos": "Always refresh node infos",
32
32
  "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name": "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name",
33
33
  "Inform about wake up and sleep of battery devices in the log": "Inform about wake up and sleep of battery devices in the log",
34
- "new Type event Warning in log": "new Type event Warning in log"
34
+ "new Type event Warning in log": "new Type event Warning in log",
35
+ "allow start send WS message directly after adapter start": "allow start send WS message directly after adapter start",
36
+ "This allows you to decide whether messages are sent immediately after the adapter starts. If the checkbox is false, the last status is taken from the info.sendMessageAllowed DP.": "This allows you to decide whether messages are sent immediately after the adapter starts. If the checkbox is false, the last status is taken from the info.sendMessageAllowed DP."
35
37
 
36
38
  }
@@ -31,5 +31,7 @@
31
31
  "Always refresh node infos": "Actualizar siempre la información del nodo",
32
32
  "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name": "Los eventos como 'Dispositivo eliminado' o 'Deshabilitado' se muestran en la descripción en lugar de en el nombre",
33
33
  "Inform about wake up and sleep of battery devices in the log": "Informar sobre el despertar y el sueño de los dispositivos de batería en el registro",
34
- "new Type event Warning in log": "nuevo evento de tipo Advertencia en el registro"
34
+ "new Type event Warning in log": "nuevo evento de tipo Advertencia en el registro",
35
+ "allow start send WS message directly after adapter start": "permitir el envío de mensajes WS directamente después del inicio del adaptador",
36
+ "This allows you to decide whether messages are sent immediately after the adapter starts. If the checkbox is false, the last status is taken from the info.sendMessageAllowed DP.": "Esto te permite decidir si los mensajes se envían inmediatamente después de que el adaptador se inicie. Si la casilla de verificación es falsa, el último estado se toma del DP info.sendMessageAllowed."
35
37
  }
@@ -31,5 +31,7 @@
31
31
  "Always refresh node infos": "Toujours actualiser les informations sur le nœud",
32
32
  "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name": "Les événements tels que 'Appareil supprimé' ou 'Désactivé' sont affichés dans la description au lieu du nom",
33
33
  "Inform about wake up and sleep of battery devices in the log": "Informer sur le réveil et le sommeil des appareils alimentés par batterie dans le journal",
34
- "new Type event Warning in log": "nouvel avertissement d'événement de type dans le journal"
34
+ "new Type event Warning in log": "nouvel avertissement d'événement de type dans le journal",
35
+ "allow start send WS message directly after adapter start": "permettre l'envoi de messages WS directement après le démarrage de l'adaptateur",
36
+ "This allows you to decide whether messages are sent immediately after the adapter starts. If the checkbox is false, the last status is taken from the info.sendMessageAllowed DP.": "Cela vous permet de décider si les messages sont envoyés immédiatement après le démarrage de l'adaptateur. Si la case à cocher est fausse, le dernier statut est pris du DP info.sendMessageAllowed."
35
37
  }
@@ -31,5 +31,7 @@
31
31
  "Always refresh node infos": "Aggiorna sempre le informazioni sui nodi",
32
32
  "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name": "Gli eventi come 'Dispositivo rimosso' o 'Disabilitato' vengono visualizzati nella descrizione anziché nel nome",
33
33
  "Inform about wake up and sleep of battery devices in the log": "Informazioni sul risveglio e sul sonno dei dispositivi a batteria nel registro",
34
- "new Type event Warning in log": "nuovo avviso di evento di tipo nel registro"
34
+ "new Type event Warning in log": "nuovo avviso di evento di tipo nel registro",
35
+ "allow start send WS message directly after adapter start": "consentire l'invio di messaggi WS direttamente dopo l'avvio dell'adattatore",
36
+ "This allows you to decide whether messages are sent immediately after the adapter starts. If the checkbox is false, the last status is taken from the info.sendMessageAllowed DP.": "Questo ti permette di decidere se i messaggi vengono inviati immediatamente dopo l'avvio dell'adattatore. Se la casella di controllo è falsa, l'ultimo stato viene preso dal DP info.sendMessageAllowed."
35
37
  }
@@ -31,5 +31,7 @@
31
31
  "Always refresh node infos": "Ververs node-informatie altijd",
32
32
  "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name": "Evenementen zoals 'Apparaat verwijderd' of 'Uitgeschakeld' worden weergegeven in de beschrijving in plaats van in de naam",
33
33
  "Inform about wake up and sleep of battery devices in the log": "Informeer over het wakker worden en slapen van batterijapparaten in het logboek",
34
- "new Type event Warning in log": "nieuw Type gebeurtenis Waarschuwing in log"
34
+ "new Type event Warning in log": "nieuw Type gebeurtenis Waarschuwing in log",
35
+ "allow start send WS message directly after adapter start": "toestaan dat WS-berichten direct na het starten van de adapter worden verzonden",
36
+ "This allows you to decide whether messages are sent immediately after the adapter starts. If the checkbox is false, the last status is taken from the info.sendMessageAllowed DP.": "Hiermee kunt u beslissen of berichten onmiddellijk na het starten van de adapter worden verzonden. Als het selectievakje niet is geselecteerd, wordt de laatste status genomen van de info.sendMessageAllowed DP."
35
37
  }
@@ -31,6 +31,8 @@
31
31
  "Always refresh node infos": "Zawsze odświeżaj informacje o Node",
32
32
  "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name": "Zdarzenia takie jak 'Urządzenie usunięte' lub 'Wyłączone' są wyświetlane w opisie zamiast w nazwie",
33
33
  "Inform about wake up and sleep of battery devices in the log": "Informuj o wybudzaniu i usypianiu urządzeń bateryjnych w Logu",
34
- "new Type event Warning in log": "nowe ostrzeżenie zdarzenia typu w Logu"
34
+ "new Type event Warning in log": "nowe ostrzeżenie zdarzenia typu w Logu",
35
+ "allow start send WS message directly after adapter start": "zezwól na wysyłanie wiadomości WS bezpośrednio po uruchomieniu adaptera",
36
+ "This allows you to decide whether messages are sent immediately after the adapter starts. If the checkbox is false, the last status is taken from the info.sendMessageAllowed DP.": "Dzięki temu możesz zdecydować, czy wiadomości są wysyłane bezpośrednio po uruchomieniu adaptera. Jeśli pole wyboru jest fałszywe, ostatni status jest pobierany z info.sendMessageAllowed DP."
35
37
 
36
38
  }
@@ -31,5 +31,7 @@
31
31
  "Always refresh node infos": "Sempre atualizar informações do nó",
32
32
  "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name": "Os eventos como 'Dispositivo removido' ou 'Desativado' são exibidos na descrição em vez do nome",
33
33
  "Inform about wake up and sleep of battery devices in the log": "Informar sobre o despertar e o sono dos dispositivos de bateria no log",
34
- "new Type event Warning in log": "novo aviso de evento de tipo no log"
34
+ "new Type event Warning in log": "novo aviso de evento de tipo no log",
35
+ "allow start send WS message directly after adapter start": "permitir o envio de mensagens WS diretamente após o início do adaptador",
36
+ "This allows you to decide whether messages are sent immediately after the adapter starts. If the checkbox is false, the last status is taken from the info.sendMessageAllowed DP.": "Isso permite que você decida se as mensagens são enviadas imediatamente após o início do adaptador. Se a caixa de seleção for falsa, o último status é retirado do DP info.sendMessageAllowed."
35
37
  }
@@ -31,5 +31,7 @@
31
31
  "Always refresh node infos": "Всегда обновлять информацию о узлах",
32
32
  "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name": "События, такие как 'Устройство удалено' или 'Отключено', отображаются в описании, а не в имени",
33
33
  "Inform about wake up and sleep of battery devices in the log": "Информация о пробуждении и сне устройств на батарейках в журнале",
34
- "new Type event Warning in log": "новое предупреждение о событии типа в журнале"
34
+ "new Type event Warning in log": "новое предупреждение о событии типа в журнале",
35
+ "allow start send WS message directly after adapter start": "разрешить отправку WS-сообщения непосредственно после запуска адаптера",
36
+ "This allows you to decide whether messages are sent immediately after the adapter starts. If the checkbox is false, the last status is taken from the info.sendMessageAllowed DP.": "Это позволяет вам решить, отправляются ли сообщения сразу после запуска адаптера. Если флажок не установлен, последний статус берется из info.sendMessageAllowed DP."
35
37
  }
@@ -31,5 +31,7 @@
31
31
  "Always refresh node infos": "Завжди оновлювати інформацію про вузли",
32
32
  "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name": "Події, такі як 'Пристрій видалено' або 'Вимкнено', відображаються в описі, а не в імені",
33
33
  "Inform about wake up and sleep of battery devices in the log": "Інформація про пробудження та сон пристроїв на батарейках у журналі",
34
- "new Type event Warning in log": "нове попередження про подію типу в журналі"
34
+ "new Type event Warning in log": "нове попередження про подію типу в журналі",
35
+ "allow start send WS message directly after adapter start": "дозволить отправлять WS-сообщение непосредственно после запуска адаптера",
36
+ "This allows you to decide whether messages are sent immediately after the adapter starts. If the checkbox is false, the last status is taken from the info.sendMessageAllowed DP.": "Это позволяет вам решить, отправляются ли сообщения сразу после запуска адаптера. Если флажок не установлен, последний статус берется из info.sendMessageAllowed DP."
35
37
  }
@@ -31,5 +31,7 @@
31
31
  "Always refresh node infos": "始终刷新节点信息",
32
32
  "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name": "诸如“设备已移除”或“已禁用”等事件显示在描述中,而不是名称中",
33
33
  "Inform about wake up and sleep of battery devices in the log": "在日志中通知电池设备的唤醒和休眠情况",
34
- "new Type event Warning in log": "日志中新类型事件警告"
34
+ "new Type event Warning in log": "日志中新类型事件警告",
35
+ "allow start send WS message directly after adapter start": "允许在适配器启动后直接发送 WS 消息",
36
+ "This allows you to decide whether messages are sent immediately after the adapter starts. If the checkbox is false, the last status is taken from the info.sendMessageAllowed DP.": "这允许您决定是否在适配器启动后立即发送消息。如果复选框为 false,则最后的状态将从 info.sendMessageAllowed DP 中获取。"
35
37
  }
@@ -305,6 +305,18 @@
305
305
  "type": "panel",
306
306
  "label": "Other configurations",
307
307
  "items": {
308
+ "wsOnStart": {
309
+ "type": "checkbox",
310
+ "label": "allow start send WS message directly after adapter start",
311
+ "default": true,
312
+ "help": "This allows you to decide whether messages are sent immediately after the adapter starts. If the checkbox is false, the last status is taken from the info.sendMessageAllowed DP.",
313
+ "xs": 12,
314
+ "sm": 12,
315
+ "md": 12,
316
+ "lg": 12,
317
+ "xl": 12,
318
+ "newLine": true
319
+ },
308
320
  "showNodeInfoMessage": {
309
321
  "type": "checkbox",
310
322
  "label": "Show Node Info messages to ioBroker log",
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "zwavews",
4
- "version": "0.0.16",
4
+ "version": "0.0.18",
5
5
  "news": {
6
+ "0.0.18": {
7
+ "en": "add info.sendMessageAllowed object to allow sending the message to zwave-ui-js\nadd new checkbox to set info.sendMessageAllowed immediately after starting the adapter",
8
+ "de": "add info.sendMessageAllowed object to let send the message to zwave-ui-js\nneue Checkbox hinzufügen, um info.sendMessage einzustellen Sofort nach dem Start des Adapters zugelassen",
9
+ "ru": "добавить info.sendMessageРазрешенный объект для отправки сообщения на zwave-ui-js\nдобавить новый флажок для установки info.sendMessage Допускается сразу после запуска адаптера",
10
+ "pt": "add info.sendMessagePermitido objeto para permitir o envio da mensagem para zwave-ui-js\nadicionar nova caixa de seleção para definir info.sendMessage Permitido imediatamente após iniciar o adaptador",
11
+ "nl": "info.sendMessageToegewezen object om het bericht naar zwave-ui-js te versturen\nnieuwe selectievakje toevoegen om info.sendMessage in te stellen Onmiddellijk na het starten van de adapter toegestaan",
12
+ "fr": "ajouter info.sendMessageObjet autorisé pour permettre l'envoi du message à zwave-ui-js\najouter une nouvelle case à cocher pour définir info.sendMessage Autorisé immédiatement après le démarrage de l'adaptateur",
13
+ "it": "aggiungere info.sendMessageAllowed oggetto per consentire l'invio del messaggio a zwave-ui-js\naggiungere nuova casella di controllo per impostare info.sendMessage Consentito subito dopo l'avvio dell'adattatore",
14
+ "es": "añadir info.sendMessagePropósito permitido enviar el mensaje a zwave-ui-js\nañadir nueva casilla para configurar información.sendMessage Permitido inmediatamente después de iniciar el adaptador",
15
+ "pl": "dodaj info.sendMessageDopuszczalny obiekt, aby umożliwić wysyłanie wiadomości do zwave- ui- js\ndodaj nową opcję do ustawienia info.sendMessage Dozwolone bezpośrednio po uruchomieniu adaptera",
16
+ "uk": "додайте інформацію.sendMessageВсього об'єкту, щоб дозволити надсилати повідомлення на zwave-ui-js\nдодати нову прапорець, щоб встановити інформацію.sendMessage Допускається відразу після запуску адаптера",
17
+ "zh-cn": "添加信息. sendMessage Allowed 对象允许将消息发送到 zwave- ui- js\n添加新复选框以设置信息. sendMessage 启动适配器后立即允许"
18
+ },
19
+ "0.0.17": {
20
+ "en": "fix adapter start\nDependencies have been updated",
21
+ "de": "befestigungsadapter start\nAbhängigkeiten wurden aktualisiert",
22
+ "ru": "запуск адаптера\nЗависимости были обновлены",
23
+ "pt": "corrigir o início do adaptador\nAs dependências foram atualizadas",
24
+ "nl": "fix adapter start\nAfhankelijkheden zijn bijgewerkt",
25
+ "fr": "fixer le démarrage de l'adaptateur\nLes dépendances ont été actualisées",
26
+ "it": "avvio dell'adattatore\nLe dipendenze sono state aggiornate",
27
+ "es": "adaptador de fijación\nSe han actualizado las dependencias",
28
+ "pl": "uruchomić adapter\nZaktualizowano zależności",
29
+ "uk": "запуск адаптера\nЗалежність було оновлено",
30
+ "zh-cn": "固定适配器启动\n依赖关系已更新"
31
+ },
6
32
  "0.0.16": {
7
33
  "en": "fix warning message",
8
34
  "de": "warnmeldung aktivieren",
@@ -67,32 +93,6 @@
67
93
  "pl": "typo\nfix dp nazwa kanału\ndodać punkt końcowy > 0 do wartości, jeśli istnieje",
68
94
  "uk": "типи\nзафіксувати ім'я каналів dp\nдодати кінцеву точку > 0 до значення, якщо існує",
69
95
  "zh-cn": "类型\n修复 dp 频道名称\n添加终点 > 0 到数值( 如果存在)"
70
- },
71
- "0.0.11": {
72
- "en": "fix dp types",
73
- "de": "dp-typen",
74
- "ru": "фиксировать типы dp",
75
- "pt": "corrigir tipos dp",
76
- "nl": "fix dp types",
77
- "fr": "correction des types dp",
78
- "it": "corretti i tipi dp",
79
- "es": "arreglos tipo dp",
80
- "pl": "fix dp types",
81
- "uk": "фіксувати типи dp",
82
- "zh-cn": "固定 dp 类型"
83
- },
84
- "0.0.10": {
85
- "en": "event value added",
86
- "de": "event-wertschöpfung",
87
- "ru": "добавленная стоимость",
88
- "pt": "valor acrescentado do evento",
89
- "nl": "gebeurteniswaarde toegevoegd",
90
- "fr": "valeur ajoutée événement",
91
- "it": "valore aggiunto",
92
- "es": "valor añadido del evento",
93
- "pl": "wartość dodana zdarzenia",
94
- "uk": "додано вартість заходу",
95
- "zh-cn": "事件增加值"
96
96
  }
97
97
  },
98
98
  "messages": [],
@@ -183,7 +183,8 @@
183
183
  {
184
184
  "admin": ">=7.6.17"
185
185
  }
186
- ]
186
+ ],
187
+ "installedFrom": "arteck/ioBroker.zwavews#notrigger"
187
188
  },
188
189
  "native": {
189
190
  "connectionType": "ws",
@@ -207,7 +208,8 @@
207
208
  "showNodeInfoMessage": true,
208
209
  "useEventInDesc": false,
209
210
  "wakeUpInfo": false,
210
- "newTypeEvent": true
211
+ "newTypeEvent": true,
212
+ "wsOnStart": true
211
213
  },
212
214
  "protectedNative": [
213
215
  "externalMqttServerPassword",
@@ -291,6 +293,19 @@
291
293
  "def": ""
292
294
  },
293
295
  "native": {}
296
+ },
297
+ {
298
+ "_id": "info.sendMessageAllowed",
299
+ "type": "state",
300
+ "common": {
301
+ "role": "state",
302
+ "name": "send message is allowed",
303
+ "type": "boolean",
304
+ "read": true,
305
+ "write": true,
306
+ "def": true
307
+ },
308
+ "native": {}
294
309
  }
295
310
  ]
296
311
  }
package/lib/constants.js CHANGED
@@ -10,6 +10,7 @@ const noInfoDP = [
10
10
  "rfRegions",
11
11
  "Scene Actuator Configuration",
12
12
  "dimmingDuration",
13
+ "paramInformation",
13
14
  ];
14
15
  const mixedType = [
15
16
  "interviewStage",
package/lib/helper.js CHANGED
@@ -63,6 +63,7 @@ class Helper {
63
63
 
64
64
  const valuesOnly = element.values ?? null;
65
65
  delete element.values;
66
+
66
67
  await this.parse(`${nodeId}.info`, element);
67
68
 
68
69
  if (valuesOnly != null && typeof valuesOnly === "object" && valuesOnly.length > 0) {
@@ -158,15 +159,14 @@ class Helper {
158
159
  common,
159
160
  native,
160
161
  });
161
-
162
+
162
163
  if (common.write === true) {
163
164
  this.adapter.subscribeStates(parsePath);
164
165
  }
165
166
 
166
- this.alreadyCreatedObjects[parsePath] = { };
167
-
168
- this.adapter.setState(parsePath, valDp, true);
167
+ this.adapter.setStateChanged(parsePath, valDp, true);
169
168
 
169
+ this.alreadyCreatedObjects[parsePath] = {};
170
170
  }
171
171
  }
172
172
  } catch (error) {
@@ -222,7 +222,7 @@ class Helper {
222
222
  }
223
223
  }
224
224
 
225
- this.adapter.setState(parsePath, valDp, true);
225
+ this.adapter.setStateChanged(parsePath, valDp, true);
226
226
  return;
227
227
  }
228
228
  options.channelName = utils.getLastSegment(parsePath);
@@ -271,6 +271,11 @@ class Helper {
271
271
  continue;
272
272
  }
273
273
 
274
+ // überspringe bestimmte DP Namen
275
+ if (constant.noInfoDP.includes(key)) {
276
+ continue;
277
+ }
278
+
274
279
  const isObj = this.isObject(valDP);
275
280
 
276
281
  if (isObj) {
@@ -327,13 +332,13 @@ class Helper {
327
332
 
328
333
  try {
329
334
  if (valDP !== undefined) {
330
- this.adapter.setState(fullPath, valDP, true);
335
+ this.adapter.setStateChanged(fullPath, valDP, true);
331
336
 
332
337
  if (fullPath.endsWith('ready') ) {
333
338
  valDP = element['status'];
334
339
  if (utils.isNumeric(valDP) && valDP == 3) {
335
340
  fullPath = fullPath.replace(".status", ".ready");
336
- this.adapter.setState(fullPath, false, true);
341
+ this.adapter.setStateChanged(fullPath, false, true);
337
342
  }
338
343
  }
339
344
  }
package/main.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ 'use strict';
2
2
 
3
3
  const core = require("@iobroker/adapter-core");
4
4
  const mqtt = require("mqtt");
@@ -14,7 +14,6 @@ const MqttServerController = require("./lib/mqttServerController").MqttServerCon
14
14
 
15
15
  let mqttClient;
16
16
  let deviceCache = {};
17
- let nodeCache = {};
18
17
  const logCustomizations = { debugDevices: "", logfilter: [] };
19
18
 
20
19
  let websocketController;
@@ -24,6 +23,7 @@ let helper;
24
23
  let messageParseMutex = Promise.resolve();
25
24
  let options = {};
26
25
  let startListening = false;
26
+ let allNodesCreated = false;
27
27
 
28
28
  let driver;
29
29
  let controller;
@@ -48,7 +48,7 @@ class zwavews extends core.Adapter {
48
48
  // Initialize your adapter here
49
49
  adapterInfo(this.config, this.log);
50
50
 
51
- this.setState("info.connection", false, true);
51
+ this.setStateChanged("info.connection", false, true);
52
52
  await statesController.setAllAvailableToFalse();
53
53
 
54
54
  helper = new Helper(this, deviceCache);
@@ -59,7 +59,13 @@ class zwavews extends core.Adapter {
59
59
  debugDevicesState.val.toLowerCase(),
60
60
  );
61
61
  }
62
- this.setState("info.debugmessages", "", true);
62
+
63
+ if (this.config.wsOnStart) {
64
+ this.setStateChanged("info.sendMessageAllowed", true, true);
65
+ }
66
+
67
+ this.nodeCache = {};
68
+ this.setStateChanged("info.debugmessages", "", true);
63
69
 
64
70
  // MQTT
65
71
  if (["exmqtt", "intmqtt"].includes(this.config.connectionType)) {
@@ -112,7 +118,7 @@ class zwavews extends core.Adapter {
112
118
  // MQTT Client
113
119
  mqttClient.on("connect", () => {
114
120
  this.log.info(`Connect to zwavews over ${this.config.connectionType == "exmqtt" ? "external mqtt" : "internal mqtt"} connection.`);
115
- this.setState("info.connection", true, true);
121
+ this.setStateChanged("info.connection", true, true);
116
122
  });
117
123
 
118
124
  mqttClient.subscribe(`${this.config.baseTopic}/#`);
@@ -132,7 +138,7 @@ class zwavews extends core.Adapter {
132
138
  if (this.config.dummyMqtt == true) {
133
139
  mqttServerController = new MqttServerController(this);
134
140
  await mqttServerController.createDummyMQTTServer();
135
- this.setState("info.connection", true, true);
141
+ this.setStateChanged("info.connection", true, true);
136
142
  await this.delay(1500);
137
143
  }
138
144
 
@@ -160,7 +166,7 @@ class zwavews extends core.Adapter {
160
166
  await statesController.setAllAvailableToFalse();
161
167
  startListening = false;
162
168
  deviceCache = [];
163
- nodeCache = [];
169
+ this.nodeCache = [];
164
170
  this.log.info('Websocket connection closed. Attempting to reconnect...');
165
171
  });
166
172
  }
@@ -197,6 +203,10 @@ class zwavews extends core.Adapter {
197
203
  break;
198
204
  }
199
205
 
206
+ if (allNodesCreated) { // wird manchmal doppelt geschickt
207
+ break;
208
+ }
209
+
200
210
  driver = messageObj.result.state.driver;
201
211
  controller = messageObj.result.state.controller;
202
212
  allNodes = messageObj.result.state.nodes;
@@ -208,15 +218,20 @@ class zwavews extends core.Adapter {
208
218
  this.log.warn(`--->>> fromZ2W_RAW2-> ${JSON.stringify(nodeData)}` );
209
219
  }
210
220
 
211
- if (!nodeCache[nodeId]) {
221
+ if (!this.nodeCache[nodeId]) {
212
222
  if (this.config.showNodeInfoMessage) {
213
223
  this.log.info(`Node Info Update for ${nodeId}`);
214
224
  }
215
- nodeCache[nodeId] = {nodeId: nodeId};
225
+ this.nodeCache[nodeId] = {nodeData};
216
226
  }
217
- await helper.createNode(`${nodeId}`, nodeData, options);
227
+ await helper.createNode(nodeId, nodeData, options);
218
228
  }
229
+
230
+ allNodesCreated = true;
219
231
 
232
+ if (this.config.showNodeInfoMessage) {
233
+ this.log.info(`all Nodes are ready`);
234
+ }
220
235
  if (startListening) {
221
236
  websocketController.send(JSON.stringify({command: "start_listening"}));
222
237
  startListening = false;
@@ -392,16 +407,20 @@ class zwavews extends core.Adapter {
392
407
  this.log.error(e);
393
408
  }
394
409
 
395
- this.setState("info.connection", false, true);
410
+ this.setStateChanged("info.connection", false, true);
396
411
 
397
412
  callback();
398
413
  }
399
414
 
400
415
  async onStateChange(id, state) {
416
+ if (!allNodesCreated) { // wenn alle nodes angelegt sind, erst dann horchen auf target
417
+ return;
418
+ }
419
+
401
420
  if (state && state.ack == false) {
402
421
  if (id.endsWith("info.debugId")) {
403
422
  logCustomizations.debugDevices = state.val.toLowerCase();
404
- this.setState(id, state.val, true);
423
+ this.setStateChanged(id, state.val, true);
405
424
  return;
406
425
  }
407
426
 
@@ -419,13 +438,17 @@ class zwavews extends core.Adapter {
419
438
  nodeId: nodeId,
420
439
  valueId: nativeObj.valueId,
421
440
  value: state.val
422
- }
423
- }
424
- this.setStateChanged('info.debugmessages', JSON.stringify(message), true);
441
+ };
442
+
443
+ const sendMessageAllowed = await this.getStateAsync("info.sendMessageAllowed");
425
444
 
426
- this.log.debug(`<zwavews> error message ${message}`);
445
+ if (sendMessageAllowed.val) {
446
+ websocketController.send(JSON.stringify(message));
447
+ }
427
448
 
428
- websocketController.send(JSON.stringify(message));
449
+ this.setStateChanged('info.debugmessages', JSON.stringify(message), true);
450
+ this.log.debug(`<zwavews> message onStateChange ${message}`);
451
+ }
429
452
  }
430
453
  }
431
454
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.zwavews",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "zwavews adapter for ioBroker",
5
5
  "author": {
6
6
  "name": "Dennis Rathjen and Arthur Rupp",
@@ -26,25 +26,25 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@iobroker/adapter-core": "^3.3.2",
29
- "@iobroker/dm-utils": "^1.0.16",
29
+ "@iobroker/dm-utils": "^2.0.1",
30
30
  "aedes": "^0.51.3",
31
31
  "aedes-persistence-nedb": "^2.0.3",
32
- "mqtt": "^5.14.1",
32
+ "mqtt": "^5.15.0",
33
33
  "net": "^1.0.2",
34
34
  "node-schedule": "^2.1.1",
35
35
  "sharp": "^0.34.5",
36
36
  "ws": "^8.19.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@alcalzone/release-script": "^5.0.0",
39
+ "@alcalzone/release-script": "^5.1.1",
40
40
  "@alcalzone/release-script-plugin-iobroker": "^4.0.0",
41
- "@alcalzone/release-script-plugin-license": "^4.0.0",
41
+ "@alcalzone/release-script-plugin-license": "^5.1.1",
42
42
  "@alcalzone/release-script-plugin-manual-review": "^4.0.0",
43
43
  "@iobroker/adapter-dev": "^1.5.0",
44
44
  "@iobroker/testing": "^5.2.2",
45
45
  "@iobroker/eslint-config": "^2.2.0",
46
46
  "@tsconfig/node14": "^14.1.8",
47
- "@types/node": "^25.0.9",
47
+ "@types/node": "^25.2.3",
48
48
  "@types/node-schedule": "^2.1.8",
49
49
  "typescript": "~5.9.2"
50
50
  },