iobroker.device-watcher 1.0.1 → 1.1.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
@@ -8,7 +8,7 @@
8
8
  [![GitHub license](https://img.shields.io/github/license/ciddi89/ioBroker.device-watcher)](https://github.com/ciddi89/ioBroker.device-watcher/blob/main/LICENSE)
9
9
  ![GitHub repo size](https://img.shields.io/github/repo-size/ciddi89/ioBroker.device-watcher)
10
10
  ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/ciddi89/ioBroker.device-watcher)
11
- ![GitHub commits since tagged version (branch)](https://img.shields.io/github/commits-since/ciddi89/ioBroker.device-watcher/v1.0.1)
11
+ ![GitHub commits since tagged version (branch)](https://img.shields.io/github/commits-since/ciddi89/ioBroker.device-watcher/v1.1.0)
12
12
  ![GitHub last commit](https://img.shields.io/github/last-commit/ciddi89/ioBroker.device-watcher)
13
13
  ![GitHub issues](https://img.shields.io/github/issues/ciddi89/ioBroker.device-watcher)
14
14
 
@@ -99,6 +99,12 @@ If you found a bug or you have an improvement suggestion, feel free to open an i
99
99
  Placeholder for the next version (at the beginning of the line):
100
100
  ### **WORK IN PROGRESS**
101
101
  -->
102
+ ### 1.1.0 (2022-10-03)
103
+ - removed indicatoren for daily sent messages
104
+ - changed selector for shelly devices
105
+ - added Zigbee2MQTT adapter
106
+ - added cron function to use own time for daily overview messages
107
+
102
108
  ### 1.0.1 (2022-09-30)
103
109
  - added WLED, Ikea Tradfri, Roomba, HmIp, Tado, Netatmo, Yeelight-2, Unifi, Nut and Meross adapter
104
110
  - fixed battery message
@@ -72,5 +72,10 @@
72
72
  "Daily overview of offline devices": "Tägliche Übersicht über Offline-Geräte",
73
73
  "Get daily an overview with all offline devices": "Erhalten Sie täglich einen Überblick mit allen Offline-Geräten",
74
74
  "Update-Interval": "Updateintervall",
75
- "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Hier können Sie das Aktualisierungsintervall für die Datenpunkte/Listen festlegen. Aus Leistungsgründen ist es nicht empfehlenswert, einen zu niedrigen Poll-Wert zu wählen. Kleiner als zwei Sekunden ist nicht wählbar."
75
+ "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Hier können Sie das Aktualisierungsintervall für die Datenpunkte/Listen festlegen. Aus Leistungsgründen ist es nicht empfehlenswert, einen zu niedrigen Poll-Wert zu wählen. Kleiner als zwei Sekunden ist nicht wählbar.",
76
+ "Overview of offline devices": "Übersicht der Offline-Geräte",
77
+ "Get an overview with all offline devices": "Verschaffen Sie sich einen Überblick mit allen Offline-Geräten",
78
+ "Choose the day(s) where you want to get the overview of offline devices:": "Wählen Sie die Tage aus, an denen Sie die Übersicht über Offline-Geräte erhalten möchten:",
79
+ "Choose the Time:": "Wählen Sie die Zeit:",
80
+ "Get a message with an overview all offline devices": "Erhalten Sie eine Nachricht mit einer Übersicht aller Offline-Geräte"
76
81
  }
@@ -69,5 +69,9 @@
69
69
  "Daily overview of offline devices": "Daily overview of offline devices",
70
70
  "Get daily an overview with all offline devices": "Get daily an overview with all offline devices",
71
71
  "Update-Interval": "Update-Interval",
72
- "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable."
72
+ "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.",
73
+ "Overview of offline devices": "Overview of offline devices",
74
+ "Choose the day(s) where you want to get the overview of offline devices:": "Choose the day(s) where you want to get the overview of offline devices:",
75
+ "Choose the Time:": "Choose the Time:",
76
+ "Get a message with an overview all offline devices": "Get a message with an overview all offline devices"
73
77
  }
@@ -72,5 +72,10 @@
72
72
  "Daily overview of offline devices": "Resumen diario de dispositivos fuera de línea",
73
73
  "Get daily an overview with all offline devices": "Obtenga diariamente una descripción general con todos los dispositivos fuera de línea",
74
74
  "Update-Interval": "Intervalo de actualización",
75
- "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Aquí puede definir el intervalo de actualización de los puntos de datos/listas. "
75
+ "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Aquí puede definir el intervalo de actualización de los puntos de datos/listas. ",
76
+ "Overview of offline devices": "Descripción general de los dispositivos fuera de línea",
77
+ "Get an overview with all offline devices": "Obtenga una descripción general con todos los dispositivos fuera de línea",
78
+ "Choose the day(s) where you want to get the overview of offline devices:": "Elija los días en los que desea obtener la descripción general de los dispositivos sin conexión:",
79
+ "Choose the Time:": "Elige la hora:",
80
+ "Get a message with an overview all offline devices": "Recibe un mensaje con una descripción general de todos los dispositivos fuera de línea"
76
81
  }
@@ -72,5 +72,10 @@
72
72
  "Daily overview of offline devices": "Aperçu quotidien des appareils hors ligne",
73
73
  "Get daily an overview with all offline devices": "Obtenez quotidiennement un aperçu de tous les appareils hors ligne",
74
74
  "Update-Interval": "Intervalle de mise à jour",
75
- "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Ici, vous pouvez définir l'intervalle de mise à jour des points de données/listes. "
75
+ "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Ici, vous pouvez définir l'intervalle de mise à jour des points de données/listes. ",
76
+ "Overview of offline devices": "Aperçu des appareils hors ligne",
77
+ "Get an overview with all offline devices": "Obtenez une vue d'ensemble avec tous les appareils hors ligne",
78
+ "Choose the day(s) where you want to get the overview of offline devices:": "Choisissez le(s) jour(s) où vous souhaitez obtenir l'aperçu des appareils hors ligne :",
79
+ "Choose the Time:": "Choisissez l'heure :",
80
+ "Get a message with an overview all offline devices": "Recevez un message avec un aperçu de tous les appareils hors ligne"
76
81
  }
@@ -72,5 +72,10 @@
72
72
  "Daily overview of offline devices": "Panoramica quotidiana dei dispositivi offline",
73
73
  "Get daily an overview with all offline devices": "Ottieni quotidianamente una panoramica di tutti i dispositivi offline",
74
74
  "Update-Interval": "Intervallo di aggiornamento",
75
- "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Qui è possibile definire l'intervallo di aggiornamento dei punti dati/elenchi. "
75
+ "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Qui è possibile definire l'intervallo di aggiornamento dei punti dati/elenchi. ",
76
+ "Overview of offline devices": "Panoramica dei dispositivi offline",
77
+ "Get an overview with all offline devices": "Ottieni una panoramica di tutti i dispositivi offline",
78
+ "Choose the day(s) where you want to get the overview of offline devices:": "Scegli i giorni in cui desideri ottenere la panoramica dei dispositivi offline:",
79
+ "Choose the Time:": "Scegli l'ora:",
80
+ "Get a message with an overview all offline devices": "Ricevi un messaggio con una panoramica di tutti i dispositivi offline"
76
81
  }
@@ -72,5 +72,10 @@
72
72
  "Daily overview of offline devices": "Dagelijks overzicht van offline apparaten",
73
73
  "Get daily an overview with all offline devices": "Krijg dagelijks een overzicht met alle offline apparaten",
74
74
  "Update-Interval": "Bijwerkingsonderbreking",
75
- "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Hier kunt u het update-interval van de datapunten/lijsten definiëren. "
75
+ "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Hier kunt u het update-interval van de datapunten/lijsten definiëren. ",
76
+ "Overview of offline devices": "Overzicht van offline apparaten",
77
+ "Get an overview with all offline devices": "Krijg een overzicht met alle offline apparaten",
78
+ "Choose the day(s) where you want to get the overview of offline devices:": "Kies de dag(en) waarop je het overzicht van offline apparaten wilt zien:",
79
+ "Choose the Time:": "Kies de tijd:",
80
+ "Get a message with an overview all offline devices": "Ontvang een bericht met een overzicht van alle offline apparaten"
76
81
  }
@@ -72,5 +72,10 @@
72
72
  "Daily overview of offline devices": "Codzienny przegląd urządzeń offline",
73
73
  "Get daily an overview with all offline devices": "Otrzymuj codziennie przegląd na wszystkich urządzeniach offline",
74
74
  "Update-Interval": "Interwał aktualizacji",
75
- "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Tutaj możesz zdefiniować interwał aktualizacji punktów danych/list. "
75
+ "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Tutaj możesz zdefiniować interwał aktualizacji punktów danych/list. ",
76
+ "Overview of offline devices": "Przegląd urządzeń offline",
77
+ "Get an overview with all offline devices": "Uzyskaj przegląd wszystkich urządzeń offline",
78
+ "Choose the day(s) where you want to get the overview of offline devices:": "Wybierz dni, w których chcesz uzyskać przegląd urządzeń offline:",
79
+ "Choose the Time:": "Wybierz czas:",
80
+ "Get a message with an overview all offline devices": "Otrzymaj wiadomość z przeglądem wszystkich urządzeń offline"
76
81
  }
@@ -72,5 +72,10 @@
72
72
  "Daily overview of offline devices": "Visão geral diária de dispositivos offline",
73
73
  "Get daily an overview with all offline devices": "Obtenha diariamente uma visão geral com todos os dispositivos offline",
74
74
  "Update-Interval": "Intervalo de atualização",
75
- "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Aqui você pode definir o intervalo de atualização dos pontos de dados/listas. "
75
+ "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Aqui você pode definir o intervalo de atualização dos pontos de dados/listas. ",
76
+ "Overview of offline devices": "Visão geral de dispositivos off-line",
77
+ "Get an overview with all offline devices": "Obtenha uma visão geral com todos os dispositivos offline",
78
+ "Choose the day(s) where you want to get the overview of offline devices:": "Escolha o(s) dia(s) em que deseja obter a visão geral dos dispositivos offline:",
79
+ "Choose the Time:": "Escolha o Horário:",
80
+ "Get a message with an overview all offline devices": "Receba uma mensagem com uma visão geral de todos os dispositivos offline"
76
81
  }
@@ -72,5 +72,10 @@
72
72
  "Daily overview of offline devices": "Ежедневный обзор автономных устройств",
73
73
  "Get daily an overview with all offline devices": "Получайте ежедневный обзор всех автономных устройств",
74
74
  "Update-Interval": "Интервал обновления",
75
- "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Здесь вы можете определить интервал обновления точек данных/списков. "
75
+ "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "Здесь вы можете определить интервал обновления точек данных/списков. ",
76
+ "Overview of offline devices": "Обзор автономных устройств",
77
+ "Get an overview with all offline devices": "Получите обзор всех автономных устройств",
78
+ "Choose the day(s) where you want to get the overview of offline devices:": "Выберите день (дни), когда вы хотите получить обзор автономных устройств:",
79
+ "Choose the Time:": "Выберите время:",
80
+ "Get a message with an overview all offline devices": "Получите сообщение с обзором всех автономных устройств"
76
81
  }
@@ -72,5 +72,10 @@
72
72
  "Daily overview of offline devices": "离线设备的每日概览",
73
73
  "Get daily an overview with all offline devices": "每天获取所有离线设备的概览",
74
74
  "Update-Interval": "更新间隔",
75
- "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "您可以在此处定义数据点/列表的更新间隔。"
75
+ "Here you can define the update interval of the datapoints/lists. For performance reasons, it is not recommended to select a poll value that is too low. Lower than two seconds is not selectable.": "您可以在此处定义数据点/列表的更新间隔。",
76
+ "Overview of offline devices": "离线设备概述",
77
+ "Get an overview with all offline devices": "了解所有离线设备",
78
+ "Choose the day(s) where you want to get the overview of offline devices:": "选择您想要获取离线设备概览的日期:",
79
+ "Choose the Time:": "选择时间:",
80
+ "Get a message with an overview all offline devices": "获取包含所有离线设备概览的消息"
76
81
  }
@@ -228,6 +228,13 @@
228
228
  "lg": 3,
229
229
  "label": "Zigbee"
230
230
  },
231
+ "zigbee2mqttDevices": {
232
+ "type": "checkbox",
233
+ "sm": 6,
234
+ "md": 6,
235
+ "lg": 3,
236
+ "label": "Zigbee2MQTT"
237
+ },
231
238
  "zwaveDevices": {
232
239
  "type": "checkbox",
233
240
  "sm": 6,
@@ -259,8 +266,77 @@
259
266
  "sm": 12,
260
267
  "md": 6,
261
268
  "lg": 3,
262
- "label": "Daily overview of offline devices",
263
- "help": "Get daily an overview with all offline devices"
269
+ "label": "Overview of offline devices",
270
+ "help": "Get a message with an overview all offline devices"
271
+ },
272
+ "_sendIntervallOfflineDay": {
273
+ "newLine": true,
274
+ "sm": 12,
275
+ "md": 12,
276
+ "lg": 6,
277
+ "hidden": "!data.checkSendOfflineMsgDaily",
278
+ "hideOnlyControl": true,
279
+ "items": {
280
+ "_textDays": {
281
+ "type": "staticText",
282
+ "text": "Choose the day(s) where you want to get the overview of offline devices:",
283
+ "style": {
284
+ "fontSize": 16,
285
+ "marginTop": 20
286
+ }
287
+ },
288
+ "checkOfflineMonday": {
289
+ "newLine": true,
290
+ "type": "checkbox",
291
+ "label": "Mon"
292
+ },
293
+ "checkOfflineTuesday": {
294
+ "type": "checkbox",
295
+ "label": "Tue"
296
+ },
297
+ "checkOfflineWednesday": {
298
+ "type": "checkbox",
299
+ "label": "Wed"
300
+ },
301
+ "checkOfflineThursday": {
302
+ "type": "checkbox",
303
+ "label": "Thu"
304
+ },
305
+ "checkOfflineFriday": {
306
+ "type": "checkbox",
307
+ "label": "Fri"
308
+ },
309
+ "checkOfflineSaturday": {
310
+ "type": "checkbox",
311
+ "label": "Sat"
312
+ },
313
+ "checkOfflineSunday": {
314
+ "type": "checkbox",
315
+ "label": "Sun"
316
+ }
317
+ }
318
+ },
319
+ "_sendIntervallOfflineTime": {
320
+ "sm": 12,
321
+ "md": 12,
322
+ "lg": 6,
323
+ "hidden": "!data.checkSendOfflineMsgDaily",
324
+ "hideOnlyControl": true,
325
+ "items": {
326
+ "_textTime": {
327
+ "type": "staticText",
328
+ "text": "Choose the Time:",
329
+ "style": {
330
+ "fontSize": 16,
331
+ "marginTop": 20
332
+ }
333
+ },
334
+ "checkSendOfflineTime": {
335
+ "newLine": true,
336
+ "type": "text",
337
+ "help": "Format hh:mm"
338
+ }
339
+ }
264
340
  },
265
341
  "trenner": {
266
342
  "newLine": true,
@@ -334,12 +410,34 @@
334
410
  }
335
411
  }
336
412
  },
413
+ "_checkSendBatteryTime": {
414
+ "sm": 12,
415
+ "md": 12,
416
+ "lg": 6,
417
+ "hidden": "!data.checkSendBatteryMsg",
418
+ "hideOnlyControl": true,
419
+ "items": {
420
+ "_textTime": {
421
+ "type": "staticText",
422
+ "text": "Choose the Time:",
423
+ "style": {
424
+ "fontSize": 16,
425
+ "marginTop": 20
426
+ }
427
+ },
428
+ "checkSendBatteryTime": {
429
+ "newLine": true,
430
+ "type": "text",
431
+ "help": "Format hh:mm"
432
+ }
433
+ }
434
+ },
337
435
  "_headerMSGservice": {
338
436
  "newLine": true,
339
437
  "type": "header",
340
438
  "text": "Notification Service",
341
439
  "size": 2,
342
- "hidden": "!data.checkSendBatteryMsg && !data.checkSendOfflineMsg",
440
+ "hidden": "!data.checkSendBatteryMsg && !data.checkSendOfflineMsgDaily && !data.checkSendOfflineMsg",
343
441
  "hideOnlyControl": false
344
442
  },
345
443
  "msgServiceText": {
@@ -349,7 +447,7 @@
349
447
  "fontSize": 16,
350
448
  "marginTop": 20
351
449
  },
352
- "hidden": "!data.checkSendBatteryMsg && !data.checkSendOfflineMsg",
450
+ "hidden": "!data.checkSendBatteryMsg && !data.checkSendOfflineMsgDaily && !data.checkSendOfflineMsg",
353
451
  "hideOnlyControl": false
354
452
  },
355
453
  "msgService": {
@@ -364,7 +462,7 @@
364
462
  {"label":"Jarvis", "value": "jarvis"},
365
463
  {"label":"Lovelace", "value": "lovelace"}],
366
464
  "default": "none",
367
- "hidden": "!data.checkSendBatteryMsg && !data.checkSendOfflineMsg",
465
+ "hidden": "!data.checkSendBatteryMsg && !data.checkSendOfflineMsgDaily && !data.checkSendOfflineMsg",
368
466
  "hideOnlyControl": false
369
467
  },
370
468
  "_headerPushover": {
@@ -1096,6 +1194,18 @@
1096
1194
  "hidden": "!data.zigbeeDevices",
1097
1195
  "hideOnlyControl": false
1098
1196
  },
1197
+ "zigbee2mqttMaxMinutes": {
1198
+ "type": "number",
1199
+ "min": -1,
1200
+ "max": 100000,
1201
+ "sm": 6,
1202
+ "md": 6,
1203
+ "lg": 3,
1204
+ "label": "Zigbee2MQTT",
1205
+ "help": "in minutes",
1206
+ "hidden": "!data.zigbee2mqttDevices",
1207
+ "hideOnlyControl": false
1208
+ },
1099
1209
  "zwaveMaxMinutes": {
1100
1210
  "type": "number",
1101
1211
  "min": -1,
package/io-package.json CHANGED
@@ -1,8 +1,20 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "device-watcher",
4
- "version": "1.0.1",
4
+ "version": "1.1.0",
5
5
  "news": {
6
+ "1.1.0": {
7
+ "en": "removed indicatoren for daily sent messages\nchanged selector for shelly devices\nadded Zigbee2MQTT adapter\nadded cron function to use own time for daily overview messages",
8
+ "de": "entfernte anzeige für täglich gesendete nachrichten\ngeänderter selektor für shelly-geräte\nzigbee2MQTT Adapter hinzugefügt\nzusätzliche cron-funktion, um eigene zeit für tägliche übersichtsnachrichten zu verwenden",
9
+ "ru": "удаленный индикатор для ежедневных отправленных сообщений\nизменен селектор для оболочки устройств\nдобавлен адаптер Zigbee2MQTT\nдобавлена функция cron для использования собственного времени для ежедневного обзора сообщений",
10
+ "pt": "indicador removido para mensagens enviadas diárias\nseletor alterado para dispositivos shelly\nadicionado adaptador Zigbee2MQTT\nfunção cron adicionada para usar o próprio tempo para mensagens de visão geral diária",
11
+ "nl": "verwijderde indicatoren voor dagelijks verzonden berichten\nverschoonde selector voor shelly apparaten\nvoegde Zigbee2MQT adapter toe\nvoegde kroonfunctie toe om dagelijks overzicht te gebruiken",
12
+ "fr": "indicateur supprimé pour les messages envoyés quotidiennement\nsélecteur modifié pour les dispositifs shelly\nadaptateur Zigbee2MQTT\nfonction cron ajoutée pour utiliser son propre temps pour les messages d'aperçu quotidien",
13
+ "it": "indicatore rimosso per messaggi inviati giornalieri\nselettore modificato per dispositivi shelly\naggiunto adattatore Zigbee2MQTT\nfunzione di cron aggiunto per utilizzare il proprio tempo per i messaggi di visione quotidiana",
14
+ "es": "indicador eliminado para mensajes enviados diariamente\nselector cambiado para dispositivos de vaina\nadaptador Zigbee2MQTT\nfunción cron agregada para utilizar tiempo propio para mensajes de visión general diaria",
15
+ "pl": "usunąć wskaźniki do codziennego przesyłania wiadomości\nzmieniono wybór dla urządzeń ostrzałowych\nadapter Zigbee2MQTT\ndodała funkcję krona do codziennego użytku",
16
+ "zh-cn": "d. 每天发出的讯息的清除指标\n炮火装置的选择\n增加Zigbee2MQTT适应人员\nb. 利用自己的时间进行日常概览信息"
17
+ },
6
18
  "1.0.1": {
7
19
  "en": "added WLED, Ikea Tradfri, Roomba, HmIp, Tado, Netatmo, Yeelight-2, Unifi, Nut and Meross adapter\nfixed battery message\ncorrected and repaired some issues of last contact time \nadded support for old HM devices\nsome small refactoring of code\nchanged shelly selector from dp rssi to dp online",
8
20
  "de": "wLED, Ikea Tradfri, Roomba, HmIp, Tado, Netatmo, Yeelight-2, Unifi, Nut und Meross Adapter\nfeste batterienachricht\neinige probleme der letzten kontaktzeit korrigiert und repariert\nunterstützung für alte HM-Geräte\neinige kleine refactoring von code\ngewechselt shelly selector von dp rssi nach dp online",
@@ -74,18 +86,6 @@
74
86
  "es": "- traducciones fijas\n- centinela agregada\n- estado de batería de nuki añadido",
75
87
  "pl": "- poprawne tłumaczenia\n- dodanie\n- dodanie stanu nuki",
76
88
  "zh-cn": "- 固定翻译\n- 增派送\n- 增加电池国"
77
- },
78
- "0.2.1": {
79
- "en": "- removed test states",
80
- "de": "- entfernte testzustände",
81
- "ru": "- удаленные состояния тестов",
82
- "pt": "- estados de teste removidos",
83
- "nl": "verwijderde teststaat",
84
- "fr": "- états d ' essai enlevés",
85
- "it": "- stati di test rimossi",
86
- "es": "- estados de prueba eliminados",
87
- "pl": "- zlikwidowane państwa testowe",
88
- "zh-cn": "- 取消试验国"
89
89
  }
90
90
  },
91
91
  "titleLang": {
@@ -170,6 +170,7 @@
170
170
  "esphomeDevices": false,
171
171
  "enoceanDevices": false,
172
172
  "zigbeeDevices": false,
173
+ "zigbee2mqttDevices": false,
173
174
  "bleDevices": false,
174
175
  "sonoffDevices": false,
175
176
  "shellyDevices": false,
@@ -204,7 +205,16 @@
204
205
  "createHtmlList": false,
205
206
  "checkSendOfflineMsg": false,
206
207
  "checkSendOfflineMsgDaily": false,
208
+ "checkOfflineMonday": false,
209
+ "checkOfflineTuesday": false,
210
+ "checkOfflineWednesday": false,
211
+ "checkOfflineThursday": false,
212
+ "checkOfflineFriday": false,
213
+ "checkOfflineSaturday": false,
214
+ "checkOfflineSunday": false,
207
215
  "checkSendBatteryMsg": false,
216
+ "checkSendBatteryTime": "12:00",
217
+ "checkSendOfflineTime": "12:05",
208
218
  "minWarnBatterie": 35,
209
219
  "checkMonday": false,
210
220
  "checkTuesday": false,
@@ -262,6 +272,7 @@
262
272
  "wledMaxMinutes": -1,
263
273
  "yeelightMaxMinutes": -1,
264
274
  "zigbeeMaxMinutes": 300,
275
+ "zigbee2mqttMaxMinutes": -1,
265
276
  "zwaveMaxMinutes": -1
266
277
  },
267
278
  "objects": [],
@@ -518,62 +529,6 @@
518
529
  "write": false
519
530
  },
520
531
  "native": {}
521
- },
522
- {
523
- "_id": "info",
524
- "type": "channel",
525
- "common": {
526
- "name": "Information"
527
- },
528
- "native": {}
529
- },
530
- {
531
- "_id": "info.lastBatteryNotification",
532
- "type": "state",
533
- "common": {
534
- "name": {
535
- "en": "Indicator if last battery notification was send today.",
536
- "de": "Indikator, ob letzte Batterie-Benachrichtigung heute gesendet wurde.",
537
- "ru": "Индикатор если последнее уведомление батареи было отправлено сегодня.",
538
- "pt": "Indicador se a última notificação da bateria foi enviada hoje.",
539
- "nl": "Indicator als laatste accu-informatie vandaag werd verstuurd.",
540
- "fr": "Indicateur si la dernière notification de batterie a été envoyée aujourd'hui.",
541
- "it": "Indicatore se ultima notifica della batteria è stato inviato oggi.",
542
- "es": "Indicador si la última notificación de batería fue enviada hoy.",
543
- "pl": "Inskrypcjacyjna, jeśli ostatnia powiadomiona baterią została do dzisiaj.",
544
- "zh-cn": "如果最后一个电池的通知今天才发出,则不用说。."
545
- },
546
- "type": "boolean",
547
- "role": "indicator",
548
- "read": true,
549
- "write": false,
550
- "def": false
551
- },
552
- "native": {}
553
- },
554
- {
555
- "_id": "info.lastOfflineNotification",
556
- "type": "state",
557
- "common": {
558
- "name": {
559
- "en": "Indicator if last daily offline notification was send today.",
560
- "de": "Indikator, wenn letzte tägliche Offline-Benachrichtigung wurde heute gesendet.",
561
- "ru": "Индикатор, если последнее ежедневное уведомление оффлайн было отправлено сегодня.",
562
- "pt": "Indicador se última notificação off-line diária foi enviado hoje.",
563
- "nl": "Indicator als de laatste dagelijkse offline-informatie vandaag werd verstuurd.",
564
- "fr": "Indicateur si la dernière notification quotidienne hors ligne a été envoyée aujourd'hui.",
565
- "it": "Indicatore se ultima notifica offline giornaliera è stato inviato oggi.",
566
- "es": "Indicador si la última notificación diaria fuera de línea fue enviada hoy.",
567
- "pl": "Wskazuje się na to, że do dziś wysłano ostatni dzienne powiadomienie.",
568
- "zh-cn": "如果最后一天的无线通知今天才发出。."
569
- },
570
- "type": "boolean",
571
- "role": "indicator",
572
- "read": true,
573
- "write": false,
574
- "def": false
575
- },
576
- "native": {}
577
532
  }
578
533
  ]
579
534
  }
package/main.js CHANGED
@@ -6,6 +6,7 @@
6
6
 
7
7
  const utils = require('@iobroker/adapter-core');
8
8
  const adapterName = require('./package.json').name.split('.').pop();
9
+ const schedule = require('node-schedule');
9
10
 
10
11
  // Sentry error reporting, disable when testing code!
11
12
  const enableSendSentry = true;
@@ -43,6 +44,8 @@ class DeviceWatcher extends utils.Adapter {
43
44
  // Interval timer
44
45
  this.refreshDataTimeout = null;
45
46
 
47
+ this.devices = new Map();
48
+
46
49
  // Information for dev: add ' 0_userdata.0. ' to selector for testing with own datapoints.
47
50
  /*
48
51
  This is the main template:
@@ -224,7 +227,7 @@ class DeviceWatcher extends utils.Adapter {
224
227
  'id': '.device.name'
225
228
  },
226
229
  shelly: {
227
- 'Selektor': 'shelly.*.online',
230
+ 'Selektor': 'shelly.*.uptime',
228
231
  'adapter': 'shelly',
229
232
  'rssiState': '.rssi',
230
233
  'battery': '.sensor.battery',
@@ -303,6 +306,13 @@ class DeviceWatcher extends utils.Adapter {
303
306
  'reach': '.available',
304
307
  'isLowBat': '.battery_low'
305
308
  },
309
+ zigbee2mqtt: {
310
+ 'Selektor': 'zigbee2mqtt.*.link_quality',
311
+ 'adapter': 'zigbee2MQTT',
312
+ 'battery': '.battery',
313
+ 'reach': '.available',
314
+ 'isLowBat': '.battery_low'
315
+ },
306
316
  zwave: {
307
317
  'Selektor': 'zwave2.*.ready',
308
318
  'adapter': 'zwave',
@@ -313,7 +323,7 @@ class DeviceWatcher extends utils.Adapter {
313
323
  };
314
324
 
315
325
  this.on('ready', this.onReady.bind(this));
316
- // this.on('stateChange', this.onStateChange.bind(this));
326
+ this.on('stateChange', this.onStateChange.bind(this));
317
327
  // this.on('objectChange', this.onObjectChange.bind(this));
318
328
  // this.on('message', this.onMessage.bind(this));
319
329
  this.on('unload', this.onUnload.bind(this));
@@ -359,6 +369,7 @@ class DeviceWatcher extends utils.Adapter {
359
369
  wled: this.config.wledDevices,
360
370
  yeelight: this.config.yeelightDevices,
361
371
  zigbee: this.config.zigbeeDevices,
372
+ zigbee2mqtt: this.config.zigbee2mqttDevices,
362
373
  zwave: this.config.zwaveDevices,
363
374
  };
364
375
 
@@ -417,12 +428,42 @@ class DeviceWatcher extends utils.Adapter {
417
428
  // update data in interval
418
429
  await this.refreshData();
419
430
 
431
+ // send overview for low battery devices
432
+ if (this.config.checkSendBatteryMsg) await this.sendBatteryNotifyShedule();
433
+
434
+ // send overview of offline devices
435
+ if (this.config.checkSendOfflineMsgDaily) await this.sendOfflineNotificationsShedule();
436
+
420
437
  } catch (error) {
421
438
  this.errorReporting('[onReady]', error);
422
439
  this.terminate ? this.terminate(15) : process.exit(15);
423
440
  }
441
+
442
+ /*
443
+ this.devices.forEach((value, key) => {
444
+ this.log.warn(`${key}: ${value}`);
445
+ this.subscribeStates(value);
446
+ this.onStateChange(key, value);
447
+ });
448
+ */
424
449
  } // <-- onReady end
425
450
 
451
+ /**
452
+ * Is called if a subscribed state changes
453
+ * @param {string} id
454
+ * @param {ioBroker.State | null | undefined} state
455
+ */
456
+ async onStateChange(id, state) {
457
+ if (state) {
458
+ // The state was changed
459
+ this.log.warn(`state ${id} changed: ${state.val} (ack = ${state.ack})`);
460
+ // await this.main();
461
+ } else {
462
+ // The state was deleted
463
+ this.log.warn(`state ${id} deleted`);
464
+ }
465
+ }
466
+
426
467
  async refreshData() {
427
468
  const nextTimeout = this.config.updateinterval * 1000;
428
469
 
@@ -608,6 +649,14 @@ class DeviceWatcher extends utils.Adapter {
608
649
  const shortDeviceBatteryState = await this.getInitValue(shortCurrDeviceString + this.arrDev[i].battery);
609
650
  const shortDeviceBatteryState2 = await this.getInitValue(shortCurrDeviceString + this.arrDev[i].battery2);
610
651
 
652
+ this.devices.set(deviceName, currDeviceString + this.arrDev[i].reach);
653
+ // List all entries
654
+ //let text = '';
655
+ //this.devices.forEach (function(value, key) {
656
+ // text += key + ' : ' + value;
657
+ // });
658
+ // this.log.warn(text);
659
+
611
660
  // Get link quality
612
661
  let deviceQualityState;
613
662
  let linkQuality;
@@ -1171,6 +1220,17 @@ class DeviceWatcher extends utils.Adapter {
1171
1220
  await pushOfflineDevice();
1172
1221
  }
1173
1222
  break;
1223
+ case 'zigbee2MQTT':
1224
+ if (this.config.zigbee2mqttMaxMinutes === -1) {
1225
+ if (!deviceUnreachState) {
1226
+ deviceState = 'Offline'; //set online state to offline
1227
+ await pushOfflineDevice();
1228
+ }
1229
+ } else if (lastContact > this.config.zigbee2mqttMaxMinutes) {
1230
+ deviceState = 'Offline'; //set online state to offline
1231
+ await pushOfflineDevice();
1232
+ }
1233
+ break;
1174
1234
  case 'zwave':
1175
1235
  if (this.config.zwaveMaxMinutes === -1) {
1176
1236
  if (!deviceUnreachState) {
@@ -1427,10 +1487,11 @@ class DeviceWatcher extends utils.Adapter {
1427
1487
  }
1428
1488
  }
1429
1489
 
1430
- if (this.config.checkSendOfflineMsg) await this.sendOfflineNotifications(); // send message if new devices are offline
1431
- if (this.config.checkSendOfflineMsgDaily) await this.sendDailyOfflineNotifications(); // send daily overview of offline devices
1432
- if (this.config.checkSendBatteryMsg) await this.sendBatteryNotifications(); // send message for low battery devices
1433
- await this.writeDatapoints(); // fill the datapoints
1490
+ // send message if new devices are offline
1491
+ if (this.config.checkSendOfflineMsg) await this.sendOfflineNotifications();
1492
+
1493
+ // fill the datapoints
1494
+ await this.writeDatapoints();
1434
1495
  } catch (error) {
1435
1496
  this.errorReporting('[createDataOfAllAdapter]', error);
1436
1497
  }
@@ -1560,6 +1621,53 @@ class DeviceWatcher extends utils.Adapter {
1560
1621
  }
1561
1622
  } // <-- End of sendNotification function
1562
1623
 
1624
+ async sendBatteryNotifyShedule() {
1625
+ // send message for low battery devices
1626
+
1627
+ const time = (this.config.checkSendBatteryTime).split(':');
1628
+
1629
+ const checkDays = []; // list of selected days
1630
+
1631
+ // push the selected days in list
1632
+ if (this.config.checkMonday) checkDays.push(1);
1633
+ if (this.config.checkTuesday) checkDays.push(2);
1634
+ if (this.config.checkWednesday) checkDays.push(3);
1635
+ if (this.config.checkThursday) checkDays.push(4);
1636
+ if (this.config.checkFriday) checkDays.push(5);
1637
+ if (this.config.checkSaturday) checkDays.push(6);
1638
+ if (this.config.checkSunday) checkDays.push(0);
1639
+
1640
+ if (checkDays.length >= 1) { // check if an day is selected
1641
+ this.log.debug(`Number of selected days for daily battery message: ${checkDays.length}. Send Message on: ${(checkDays).join(', ')} ...`);
1642
+ } else {
1643
+ this.log.warn(`No days selected for daily battery message. Please check the instance configuration!`);
1644
+ return; // cancel function if no day is selected
1645
+ }
1646
+
1647
+ if (!isUnloaded) {
1648
+ const cron = '10 ' + time[1] + ' ' + time[0] + ' * * ' + checkDays;
1649
+ schedule.scheduleJob(cron, () => {
1650
+ try {
1651
+ let msg = '';
1652
+
1653
+ for (const id of this.batteryLowPowered) {
1654
+ msg = `${msg}\n${id['Device']} (${id['Battery']})`;
1655
+ }
1656
+
1657
+ if (this.lowBatteryPoweredCount > 0) {
1658
+ this.log.info(`Niedrige Batteriezustände: ${msg}`);
1659
+ this.setStateAsync('lastNotification', `Niedrige Batteriezustände: ${msg}`, true);
1660
+
1661
+ this.sendNotification(`Niedriege Batteriezustände: ${msg}`);
1662
+
1663
+ }
1664
+
1665
+ } catch (error) {
1666
+ this.errorReporting('[sendBatteryNotifyShedule]', error);
1667
+ }
1668
+ });
1669
+ }
1670
+ } //<--End of battery notification
1563
1671
 
1564
1672
  async sendOfflineNotifications() {
1565
1673
  // send message if an device is offline
@@ -1593,107 +1701,52 @@ class DeviceWatcher extends utils.Adapter {
1593
1701
  this.log.debug(`Finished the function: ${this.sendOfflineNotifications.name}`);
1594
1702
  }//<--End of offline notification
1595
1703
 
1596
- async sendDailyOfflineNotifications() {
1704
+ async sendOfflineNotificationsShedule() {
1597
1705
  // send daily an overview with offline devices
1598
1706
 
1599
- this.log.debug(`Start the function: ${this.sendDailyOfflineNotifications.name}`);
1600
-
1601
- try {
1602
- // Check if the daily message for offline devices was already sent today
1603
- const lastOfflineNotifyIndicator = await this.getOwnInitValue('info.lastOfflineNotification');
1604
- const now = new Date(); // get date
1707
+ const time = (this.config.checkSendOfflineTime).split(':');
1605
1708
 
1606
- // set indicator for send message first to 'false', after sending to 'true'
1607
- if (now.getHours() < 11) await this.setStateAsync('info.lastOfflineNotification', false, true);
1608
-
1609
- // if time is > 11 (12:00 pm create message for offline devices devices)
1610
- if ((now.getHours() > 11) && (!lastOfflineNotifyIndicator)) {
1611
- let msg = '';
1612
-
1613
- for (const id of this.offlineDevices) {
1614
- msg = `${msg}\n${id['Device']} (${id['Last contact']})`;
1615
- }
1709
+ const checkDays = []; // list of selected days
1616
1710
 
1617
- if (this.offlineDevicesCount > 0) {
1618
- this.log.info(`Geräte Offline: ${msg}`);
1619
- await this.setStateAsync('lastNotification', `Geräte Offline: ${msg}`, true);
1711
+ // push the selected days in list
1712
+ if (this.config.checkOfflineMonday) checkDays.push(1);
1713
+ if (this.config.checkOfflineTuesday) checkDays.push(2);
1714
+ if (this.config.checkOfflineWednesday) checkDays.push(3);
1715
+ if (this.config.checkOfflineThursday) checkDays.push(4);
1716
+ if (this.config.checkOfflineFriday) checkDays.push(5);
1717
+ if (this.config.checkOfflineSaturday) checkDays.push(6);
1718
+ if (this.config.checkOfflineSunday) checkDays.push(0);
1620
1719
 
1621
- await this.sendNotification(`Geräte Offline: ${msg}`);
1622
-
1623
- await this.setStateAsync('info.lastOfflineNotification', true, true);
1624
- }
1625
- }
1626
- } catch (error) {
1627
- this.errorReporting('[sendDailyOfflineNotifications]', error);
1720
+ if (checkDays.length >= 1) { // check if an day is selected
1721
+ this.log.debug(`Number of selected days for daily offline message: ${checkDays.length}. Send Message on: ${(checkDays).join(', ')} ...`);
1722
+ } else {
1723
+ this.log.warn(`No days selected for daily offline message. Please check the instance configuration!`);
1724
+ return; // cancel function if no day is selected
1628
1725
  }
1629
- this.log.debug(`Finished the function: ${this.sendDailyOfflineNotifications.name}`);
1630
- }//<--End of daily offline notification
1631
-
1632
- async sendBatteryNotifications() {
1633
- // send message for low battery devices
1634
1726
 
1635
- this.log.debug(`Start the function: ${this.sendBatteryNotifications.name}`);
1636
-
1637
- try {
1638
-
1639
- const now = new Date(); // get date
1640
- const today = now.getDay();
1641
- const checkDays = []; // list of selected days
1642
- let checkToday; // indicator if selected day is today
1643
-
1644
- // push the selected days in list
1645
- if (this.config.checkMonday) checkDays.push(1);
1646
- if (this.config.checkTuesday) checkDays.push(2);
1647
- if (this.config.checkWednesday) checkDays.push(3);
1648
- if (this.config.checkThursday) checkDays.push(4);
1649
- if (this.config.checkFriday) checkDays.push(5);
1650
- if (this.config.checkSaturday) checkDays.push(6);
1651
- if (this.config.checkSunday) checkDays.push(0);
1652
-
1653
- //Check if the message should be send today
1654
- checkDays.forEach(object => {
1655
- if ((object >= 0) && today == object) {
1656
- checkToday = true;
1657
- }
1658
- });
1659
-
1660
- if (checkDays.length >= 1) { // check if an day is selected
1661
- this.log.debug(`Number of selected days: ${checkDays.length}. Send Message on: ${(checkDays).join(', ')} ...`);
1662
- } else {
1663
- this.log.warn(`No days selected. Please check the instance configuration!`);
1664
- return; // cancel function if no day is selected
1665
- }
1666
-
1667
- // Check if the message for low battery was already sent today
1668
- const lastBatteryNotifyIndicator = await this.getOwnInitValue('info.lastBatteryNotification');
1669
-
1670
- // set indicator for send message first to 'false', after sending to 'true'
1671
- if (now.getHours() < 11) await this.setStateAsync('info.lastBatteryNotification', false, true);
1672
-
1673
- // if time is > 11 (12:00 pm create message for low battery devices)
1674
- if ((now.getHours() > 11) && (!lastBatteryNotifyIndicator) && (checkToday != undefined)) {
1675
- let msg = '';
1727
+ if (!isUnloaded) {
1728
+ const cron = '10 ' + time[1] + ' ' + time[0] + ' * * ' + checkDays;
1729
+ schedule.scheduleJob(cron, () => {
1730
+ try {
1731
+ let msg = '';
1676
1732
 
1677
- for (const id of this.batteryLowPowered) {
1678
- msg = `${msg}\n${id['Device']} (${id['Battery']})`;
1679
- }
1733
+ for (const id of this.offlineDevices) {
1734
+ msg = `${msg}\n${id['Device']} (${id['Last contact']})`;
1735
+ }
1680
1736
 
1681
- if (this.lowBatteryPoweredCount > 0) {
1682
- this.log.info(`Niedrige Batteriezustände: ${msg}`);
1683
- await this.setStateAsync('lastNotification', `Niedrige Batteriezustände: ${msg}`, true);
1737
+ if (this.offlineDevicesCount > 0) {
1738
+ this.log.info(`Geräte Offline: ${msg}`);
1739
+ this.setStateAsync('lastNotification', `Geräte Offline: ${msg}`, true);
1684
1740
 
1685
- await this.sendNotification(`Niedriege Batteriezustände: ${msg}`);
1741
+ this.sendNotification(`Geräte Offline: ${msg}`);
1742
+ }
1686
1743
 
1687
- await this.setStateAsync('info.lastBatteryNotification', true, true);
1744
+ } catch (error) {
1745
+ this.errorReporting('[sendOfflineNotificationsShedule]', error);
1688
1746
  }
1689
- }
1690
- } catch (error) {
1691
- this.errorReporting('[sendOfflineMessage]', error);
1747
+ });
1692
1748
  }
1693
-
1694
- this.log.debug(`Finished the function: ${this.sendBatteryNotifications.name}`);
1695
- }//<--End of battery notification
1696
-
1749
+ }//<--End of daily offline notification
1697
1750
 
1698
1751
  async resetVars() {
1699
1752
  //Reset all arrays and counts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.device-watcher",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Watchdog for devices",
5
5
  "author": {
6
6
  "name": "Christian Behrends",
@@ -22,29 +22,31 @@
22
22
  "url": "https://github.com/ciddi89/ioBroker.device-watcher"
23
23
  },
24
24
  "dependencies": {
25
- "@iobroker/adapter-core": "^2.6.0"
25
+ "@iobroker/adapter-core": "^2.6.6"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@alcalzone/release-script": "^3.5.9",
29
29
  "@alcalzone/release-script-plugin-iobroker": "^3.5.9",
30
30
  "@alcalzone/release-script-plugin-license": "^3.5.9",
31
- "@iobroker/adapter-dev": "^1.0.1",
31
+ "@iobroker/adapter-dev": "^1.1.0",
32
32
  "@iobroker/testing": "^4.1.0",
33
33
  "@types/chai": "^4.3.3",
34
34
  "@types/chai-as-promised": "^7.1.5",
35
- "@types/mocha": "^9.1.1",
36
- "@types/node": "^18.7.14",
35
+ "@types/mocha": "^10.0.0",
36
+ "@types/node": "^18.7.23",
37
+ "@types/node-schedule": "^2.1.0",
37
38
  "@types/proxyquire": "^1.3.28",
38
39
  "@types/sinon": "^10.0.13",
39
40
  "@types/sinon-chai": "^3.2.8",
40
41
  "chai": "^4.3.6",
41
42
  "chai-as-promised": "^7.1.1",
42
- "eslint": "^8.23.0",
43
+ "eslint": "^8.24.0",
43
44
  "mocha": "^10.0.0",
45
+ "node-schedule": "^2.1.0",
44
46
  "proxyquire": "^2.1.3",
45
47
  "sinon": "^14.0.0",
46
48
  "sinon-chai": "^3.7.0",
47
- "typescript": "~4.8.2"
49
+ "typescript": "~4.8.4"
48
50
  },
49
51
  "main": "main.js",
50
52
  "files": [