iobroker.device-watcher 2.8.4 → 2.9.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 +11 -0
- package/admin/jsonConfig.json +39 -9
- package/io-package.json +31 -27
- package/lib/arrApart.js +25 -0
- package/main.js +204 -68
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -189,6 +189,17 @@ It's possible to select:
|
|
|
189
189
|
Placeholder for the next version (at the beginning of the line):
|
|
190
190
|
### **WORK IN PROGRESS**
|
|
191
191
|
-->
|
|
192
|
+
### 2.9.0 (2023-04-26)
|
|
193
|
+
|
|
194
|
+
- (ciddi89) Fixed: Deactivated instances were not displayed in the daily message about deactivated instances
|
|
195
|
+
- (ciddi89) Added: Viessmann devices, Homekit-Controller devices
|
|
196
|
+
- (ciddi89) Improvements: Text of overview messages
|
|
197
|
+
|
|
198
|
+
### 2.8.5 (2023-04-20)
|
|
199
|
+
|
|
200
|
+
- (ciddi89) Fixed: Error that instances can not be added to the blacklist because of the popup message [#172](https://github.com/ciddi89/ioBroker.device-watcher/issues/172)
|
|
201
|
+
- (ciddi89) Fixed: That messages have been sent when the instance has briefly jumped from Enabled to Disabled and back to Enabled [#173](https://github.com/ciddi89/ioBroker.device-watcher/issues/173)
|
|
202
|
+
|
|
192
203
|
### 2.8.4 (2023-04-16)
|
|
193
204
|
|
|
194
205
|
- (ciddi89) Fixed: Functions for instance status completely renewed ([#170](https://github.com/ciddi89/ioBroker.device-watcher/issues/170))
|
package/admin/jsonConfig.json
CHANGED
|
@@ -142,6 +142,13 @@
|
|
|
142
142
|
"lg": 3,
|
|
143
143
|
"label": "Home Connect"
|
|
144
144
|
},
|
|
145
|
+
"homekitControllerDevices": {
|
|
146
|
+
"type": "checkbox",
|
|
147
|
+
"sm": 6,
|
|
148
|
+
"md": 6,
|
|
149
|
+
"lg": 3,
|
|
150
|
+
"label": "Homekit-Controller"
|
|
151
|
+
},
|
|
145
152
|
"hs100Devices": {
|
|
146
153
|
"type": "checkbox",
|
|
147
154
|
"sm": 6,
|
|
@@ -352,6 +359,13 @@
|
|
|
352
359
|
"lg": 3,
|
|
353
360
|
"label": "Unifi"
|
|
354
361
|
},
|
|
362
|
+
"viessmannDevices": {
|
|
363
|
+
"type": "checkbox",
|
|
364
|
+
"sm": 6,
|
|
365
|
+
"md": 6,
|
|
366
|
+
"lg": 3,
|
|
367
|
+
"label": "Viessmann"
|
|
368
|
+
},
|
|
355
369
|
"wledDevices": {
|
|
356
370
|
"type": "checkbox",
|
|
357
371
|
"sm": 6,
|
|
@@ -1389,15 +1403,7 @@
|
|
|
1389
1403
|
"sort": false,
|
|
1390
1404
|
"jsonData": "{\"instanceID\":\"${globalData.instanceID}\",\"adapter\":\"${globalData.adapter}\"}",
|
|
1391
1405
|
"command": "instancesList",
|
|
1392
|
-
"width": "60%"
|
|
1393
|
-
"confirm": {
|
|
1394
|
-
"condition": "_alive",
|
|
1395
|
-
"title": "Attention!",
|
|
1396
|
-
"text": "This selection is only possible with a running instance!",
|
|
1397
|
-
"ok": "Got it!",
|
|
1398
|
-
"cancel": "cancel",
|
|
1399
|
-
"type": "warning"
|
|
1400
|
-
}
|
|
1406
|
+
"width": "60%"
|
|
1401
1407
|
},
|
|
1402
1408
|
{
|
|
1403
1409
|
"type": "checkbox",
|
|
@@ -1883,6 +1889,18 @@
|
|
|
1883
1889
|
"hidden": "!data.homeconnectDevices",
|
|
1884
1890
|
"hideOnlyControl": false
|
|
1885
1891
|
},
|
|
1892
|
+
"homekitControllerMaxMinutes": {
|
|
1893
|
+
"type": "number",
|
|
1894
|
+
"min": -1,
|
|
1895
|
+
"max": 100000,
|
|
1896
|
+
"sm": 6,
|
|
1897
|
+
"md": 6,
|
|
1898
|
+
"lg": 3,
|
|
1899
|
+
"label": "Homekit-Controller",
|
|
1900
|
+
"help": "in minutes",
|
|
1901
|
+
"hidden": "!data.homekitControllerDevices",
|
|
1902
|
+
"hideOnlyControl": false
|
|
1903
|
+
},
|
|
1886
1904
|
"hs100MaxMinutes": {
|
|
1887
1905
|
"type": "number",
|
|
1888
1906
|
"min": 1,
|
|
@@ -2255,6 +2273,18 @@
|
|
|
2255
2273
|
"hidden": "!data.unifiDevices",
|
|
2256
2274
|
"hideOnlyControl": false
|
|
2257
2275
|
},
|
|
2276
|
+
"viessmannMaxMinutes": {
|
|
2277
|
+
"type": "number",
|
|
2278
|
+
"min": -1,
|
|
2279
|
+
"max": 100000,
|
|
2280
|
+
"sm": 6,
|
|
2281
|
+
"md": 6,
|
|
2282
|
+
"lg": 3,
|
|
2283
|
+
"label": "Viessmann",
|
|
2284
|
+
"help": "in minutes",
|
|
2285
|
+
"hidden": "!data.viessmannDevices",
|
|
2286
|
+
"hideOnlyControl": false
|
|
2287
|
+
},
|
|
2258
2288
|
"wledMaxMinutes": {
|
|
2259
2289
|
"type": "number",
|
|
2260
2290
|
"min": -1,
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "device-watcher",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.9.0",
|
|
5
5
|
"news": {
|
|
6
|
+
"2.9.0": {
|
|
7
|
+
"en": "Fixed: Deactivated instances were not displayed in the daily message about deactivated instances\nAdded: Viessmann devices, Homekit-Controller devices\nImprovements: Text of overview messages",
|
|
8
|
+
"de": "Behoben: Deaktivierte Instanzen wurden nicht in den Übersichtnachrichten über deaktivierte Instanzen angezeigt\nHinzugefügt: Viessmann Geräte, Homekit-Controller Geräte\nVerbesserungen: Text der Übersichtsnachrichten",
|
|
9
|
+
"ru": "Исправлено: Отключенные экземпляры не отображались в ежедневном сообщении о деактивированных инстанциях\nДобавлены: Viessmann устройства, Homekit-Controller устройства\nУлучшения: Текст обзорных сообщений",
|
|
10
|
+
"pt": "Corrigido: As instâncias desativadas não foram exibidas na mensagem diária sobre instâncias desativadas\nAdicionado: dispositivos Viessmann, dispositivos Homekit-Controller\nMelhorias: Texto de mensagens de visão geral",
|
|
11
|
+
"nl": "Gedeactiveerde instanties werden niet getoond in de dagelijkse boodschap over gedeactiveerde instanties\nVertaling:\nImprovementen: Text of overzicht berichten",
|
|
12
|
+
"fr": "Correction : Les instances désactivées n'ont pas été affichées dans le message quotidien concernant les instances désactivées\nAjouté: Appareils Viessmann, Dispositifs Homekit-Controller\nAméliorations : Texte des messages d ' aperçu",
|
|
13
|
+
"it": "Risolto: Le istanze disattivate non sono state visualizzate nel messaggio quotidiano sulle istanze disattivate\nAggiunto: dispositivi Viessmann, dispositivi Homekit-Controller\nMiglioramenti: Testo dei messaggi di panoramica",
|
|
14
|
+
"es": "Fijo: No se mostraron casos desactivados en el mensaje diario sobre casos desactivados\nAñadido: dispositivos Viessmann, dispositivos Homekit-Controller\nMejoras: Texto de los mensajes de visión general",
|
|
15
|
+
"pl": "Na przykładzie uaktywniono: Zdeaktywowane instancje nie były wyświetlane w codziennym wiadomości o deaktywowanych instancjach\nAdded: urządzenia Viessmanna\nPoprawa: Tekst overview",
|
|
16
|
+
"uk": "Виправлено: Деактивовані екземпляри не відображалися в щоденному повідомленні про деактивовані екземпляри\nДодано: пристрої Viessmann, пристрої Homekit-Controller\nУдосконалення: Текст повідомлення",
|
|
17
|
+
"zh-cn": "Fixed:Deactiving cases的每日信息未显示有关违犯事件的报道。\n增 编:维斯曼装置、家里克特-Controller装置\n改进: 总讯案文"
|
|
18
|
+
},
|
|
19
|
+
"2.8.5": {
|
|
20
|
+
"en": "Fixed: Error that instances can not be added to the blacklist because of the popup message [#172](https://github.com/ciddi89/ioBroker.device-watcher/issues/172)\nFixed: That messages have been sent when the instance has briefly jumped from Enabled to Disabled and back to Enabled [#173](https://github.com/ciddi89/ioBroker.device-watcher/issues/173)",
|
|
21
|
+
"de": "Behoben: Fehler, dass Instanzen aufgrund der Popup-Nachricht nicht zur Blacklist hinzugefügt werden können [#172](https://github.com/ciddi89/ioBroker.device-watcher/issues/172)\nBehoben: Das Meldungen gesendet wurden, wenn die Instanz kurz von Aktiviert auf Deaktiviert und zurück zu Aktiviert gesprungen ist [#173](https://github.com/ciddi89/ioBroker.device-watcher/issues/173)",
|
|
22
|
+
"ru": "Исправлено: Ошибка, которую нельзя добавить в черный список из-за всплывающего сообщения [#172](https://github.com/ciddi89/ioBroker.device-watcher/issues/172)\nИсправлено: Эти сообщения были отправлены, когда экземпляр кратко перепрыгнул из Enabled в Disabled и обратно в Enabled [#173](https://github.com/ciddi89/ioBroker.device-watcher/issues/173)",
|
|
23
|
+
"pt": "Corrigido: Erro que as instâncias não podem ser adicionadas à lista negra por causa da mensagem pop-up [#172](https://github.com/ciddi89/ioBroker.device-watcher/issues/172)\nCorrigido: Essas mensagens foram enviadas quando a instância saltou brevemente de Enabled para Disabled e de volta para Enabled [#173](https://github.com/ciddi89/ioBroker.device-watcher/issues/173)",
|
|
24
|
+
"nl": "Dat kan niet worden toegevoegd aan de blacklist vanwege de popup-bericht\nVertaling: Die berichten zijn verstuurd toen het instituut kort van Enabled naar Disabled en terug naar Enabled 173: jittps, /ciddi89-Brokerdewadet-17",
|
|
25
|
+
"fr": "Correction : Erreur que les instances ne peuvent pas être ajoutées à la liste noire en raison du message popup [#172](https://github.com/ciddi89/ioBroker.device-watcher/issues/172)\nCorrection : Ces messages ont été envoyés lorsque l ' instance a brièvement sauté de Enabled à Disabled et de retour à Enabled [#173](https://github.com/ciddi89/ioBroker.device-watcher/issues/173)",
|
|
26
|
+
"it": "Risolto: Errore che le istanze non possono essere aggiunte alla lista nera a causa del messaggio popup [#172](https://github.com/ciddi89/ioBroker.device-watcher/issues/172)\nRisolto: Tali messaggi sono stati inviati quando l'istanza è saltata brevemente da Enabled a disabilitare e di nuovo a Enabled [#173](https://github.com/ciddi89/ioBroker.device-watcher/issues/173)",
|
|
27
|
+
"es": "Corregido: Error de que los casos no se pueden agregar a la lista negra debido al mensaje popup [#172](https://github.com/ciddi89/ioBroker.device-watcher/issues/172)\nArreglado: Esos mensajes se han enviado cuando el caso ha saltado brevemente de Enabled a Disabled y de regreso a Enabled [#173](https://github.com/ciddi89/ioBroker.device-watcher/issues/173)",
|
|
28
|
+
"pl": "Error, że instancje nie mogą być dodane do czarnej listy z powodu popupu #172(https:/github.com/ciddi89/ioBroker.device-watcher/issues/172)\nFixed: Wiadomości te zostały wysłane, gdy instancja przeskakuje z Enabled do Disabled #173 (https:/github.com/ciddi89/ioBroker.device-watcher/issues/173)",
|
|
29
|
+
"uk": "Виправлено: помилка, що екземпляри не можуть бути додані в чорний список через повідомлення електронної пошти [#172] (https://github.com/ciddi89/ioBroker.device-watcher/issues/172)\nВиправлено: Що повідомлення було відправлено, коли екземпляр коротко стрибнув з Увімкненого і назад до Увімкненого [#173] (https://github.com/ciddi89/ioBroker.device-watcher/issues/173)",
|
|
30
|
+
"zh-cn": "固定:由于人口信息[第172号](http://github.com/ciddi89/ioBroker.device-watcher/issues/172)而无法增加黑名单。\n固定: 这一信息是在以下情况下发出的:从便携起降到残疾人,回到了可居住的[第173号](http://github.com/ciddi89/ioBroker.device-watcher/issues/173)。"
|
|
31
|
+
},
|
|
6
32
|
"2.8.4": {
|
|
7
33
|
"en": "Fixed: Functions for instance status completely renewed ([#170](https://github.com/ciddi89/ioBroker.device-watcher/issues/170))\nAdded: Popup message when the instance is not running and the user tries to select a device/instance in the settings tables ([#170](https://github.com/ciddi89/ioBroker.device-watcher/issues/170))",
|
|
8
34
|
"de": "Behoben: Funktionen für Instanzen Status vollständig erneuert [#170](https://github.com/ciddi89/ioBroker.device-watcher/issues/170)\nHinzugefügt: Popup-Nachricht, wenn die Instanz nicht läuft und der Benutzer versucht ein Gerät/Instance in den Einstellungstabellen auszuwählen [#170](https://github.com/ciddi89/ioBroker.device-watcher/issues/170)",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "Added: wsparcie dla LOQED Smart Lock\nAdded: Option to add user/group api key\nAdded: Option, aby wysłać powiadomienie, czy instancja została zatrzymana\nAdded: Option to send castule notification with overview of a zatrzymane instancje\nFixed: Wydanie, jeśli powiadomienia zostały wysłane z przerwy, ale opcja nie została wybrana\nFixed: Ignore akumulatory 0%, jeśli nie były one mniejsze niż 5% przed rozpoczęciem budowy",
|
|
68
94
|
"uk": "Доданий: Підтримка LOQED Смарт блокування\nДодано: Параметри, щоб додати ключ користувача / групи Api для Pushover\nДоданий: Опція надсилати повідомлення, якщо було припинено\nДодано: Опція для відправки повідомлень про скидання з оглядом припинених екземплярів\nВиправлено: Питання, якщо повідомлення було відправлено припинено, але варіант не був обраний\nВиправлено: значення Ignore батареї 0%, якщо вони не менше 5% до",
|
|
69
95
|
"zh-cn": "增加:支持LOQED Smart Lock\n增 编:增加用户/集群的备选办法\n增加:如果某一例子被停止,可发出通知。\n增 编:发出简写通知,概述停止事件\nIxed:如果发出通知被阻止,但选择是选择的。\n固定:Ignore电池数值.0%"
|
|
70
|
-
},
|
|
71
|
-
"2.7.1": {
|
|
72
|
-
"en": "Added: Support for Ecovacs-Deebot\nUpdated: Dependencies\nImprovements: Small fixes",
|
|
73
|
-
"de": "Hinzugefügt: Unterstützung für Ecovacs-Deebot\nAktualisiert: Abhängigkeiten\nVerbesserungen: Kleine Verbesserungen",
|
|
74
|
-
"ru": "Добавлена: Поддержка Ecovacs-Deebot\nОбновлено: зависимости\nУлучшения: Небольшие исправления",
|
|
75
|
-
"pt": "Adicionado: Suporte para Ecovacs-Deebot\nAtualizado: Dependências\nMelhorias: Pequenas correções",
|
|
76
|
-
"nl": "Vertaling:\nOpgepast\nImprovementen: Kleine fixes",
|
|
77
|
-
"fr": "Ajouté: Soutien à Ecovacs-Deebot\nActualisé : dépenses\nAméliorations : Petites corrections",
|
|
78
|
-
"it": "Aggiunto: Supporto per Ecovacs-Deebot\nAggiornato: Dipendenze\nMiglioramenti: Piccole correzioni",
|
|
79
|
-
"es": "Añadido: Apoyo para Ecovacs-Deebot\nActualizado: Dependencias\nMejoras: Arreglos pequeños",
|
|
80
|
-
"pl": "Wsparcie dla Ecovac-Deebota\nZastrzeżenie: Zależność\nPoprawa: drobne rozwiązanie",
|
|
81
|
-
"uk": "Додано: Підтримка Ecovacs-Deebot\nОновлено: Залежності\nУдосконалення: Маленькі кріплення",
|
|
82
|
-
"zh-cn": "增加:支持Ecovacs-Deebot\n更新:属地\n改进: 小型配件"
|
|
83
|
-
},
|
|
84
|
-
"2.7.0": {
|
|
85
|
-
"en": "Added: Fully-MQTT\nAdded: Notification Service Matrix\nAdded: List and number of active instances\nAdded: HTML lists for instances/adapters\nAdded: HM-RPC device update pending datapoint\nAdded: User can define reporting time for error instances\nFixed: Send notification about adapter updates only if there are new ones\nImprovements: Hide notification services only if no instance is choosen\nImprovements: Some small code changes to avoid error messages",
|
|
86
|
-
"de": "Hinzugefügt: Fully-MQTT\nHinzugefügt: Notification Service Matrix\nHinzugefügt: Liste und Anzahl der aktiven Instanzen\nHinzugefügt: HTML-Listen für Instanzen/Adapter\nHinzugefügt: HM-RPC Geräteupdate Datenpunkt\nHinzugefügt: Benutzer kann Berichtszeit für Fehlerinstanzen definieren\nBehoben: Sende Benachrichtigung über Adapter-Updates nur, wenn es neue gibt\nVerbesserungen: Ausblenden von Benachrichtigungsdiensten nur, wenn keine Instanz davon gewählt wurde\nVerbesserungen: Einige kleine Codeänderungen, um Fehlermeldungen zu vermeiden",
|
|
87
|
-
"ru": "Добавлена: Fully-MQTT\nДобавлена: Notification Service Matrix\nДобавлена: Список и количество активных инстанций\nДобавлены: HTML списки для инстанций/адаптеров\nДобавлена: HM-RPC обновление устройства в ожидании данных\nДобавлена: Пользователь может определить отчетное время для ошибок\nИсправлено: Отправьте уведомление об обновлениях адаптера только если есть новые\nУлучшения: Скрыть услуги уведомлений только если не выбрано\nУлучшения: Некоторые небольшие изменения кода, чтобы избежать сообщений об ошибках",
|
|
88
|
-
"pt": "Adicionado: Fully-MQTT\nAdicionado: Notification Service Matrix\nAdicionado: Lista e número de instâncias ativas\nAdicionado: listas HTML para instâncias/adapters\nAdicionado: HM-RPC dispositivo atualização pendente datapoint\nAdicionado: O usuário pode definir tempo de relatório para instâncias de erro\nCorrigido: Enviar notificação sobre atualizações do adaptador somente se houver novos\nMelhorias: Ocultar serviços de notificação apenas se nenhuma instância for escolhida\nMelhorias: Algumas pequenas alterações de código para evitar mensagens de erro",
|
|
89
|
-
"nl": "Vertaling:\nVertaling:\nVertaling:\nVertaling:\nVertaling:\nUser kan de tijd definiëren voor foute instanties\nVerwittiging over updates als er nieuwe zijn\nImprovementen: Verberg de inlichtingendienst alleen als er geen voorkeur wordt gekozen\nImprovementen: Een kleine code verandert om foute berichten te vermijden",
|
|
90
|
-
"fr": "Ajouté : Fully-MQTT\nAjouté: Service de notification Matrix\nAjouté : Liste et nombre de cas actifs\nAjouté: Listes HTML pour les instances/adaptateurs\nAjouté : Mise à jour du dispositif HM-RPC en attendant le point de données\nAjouté: L'utilisateur peut définir le temps de déclaration des instances d'erreur\nCorrection : Envoyez une notification sur les mises à jour de l'adaptateur seulement s'il y en a de nouveaux\nAméliorations : Cacher les services de notification seulement si aucune instance n'est choisie\nAméliorations : Quelques petits changements de code pour éviter les messages d'erreur",
|
|
91
|
-
"it": "Aggiunto: Fully-MQTT\nAggiunto: Servizio di notifica Matrix\nAggiunto: Lista e numero di istanze attive\nAggiunto: liste HTML per istanze / adattatori\nAggiunto: HM-RPC dispositivo aggiornamento in sospeso datapoint\nAggiunto: L'utente può definire il tempo di reporting per le istanze di errore\nFisso: Invia la notifica sugli aggiornamenti dell'adattatore solo se ci sono nuovi\nMiglioramenti: Nascondi i servizi di notifica solo se non si sceglie un'istanza\nMiglioramenti: Alcuni piccoli cambiamenti di codice per evitare messaggi di errore",
|
|
92
|
-
"es": "Añadido: Fully-MQTT\nAñadido: Matriz de servicio de notificación\nAñadido: Lista y número de casos activos\nAñadido: listas HTML para casos/adapteros\nAñadido: Actualización del dispositivo HM-RPC hasta el punto de datos\nAñadido: El usuario puede definir el tiempo de presentación de informes para casos de error\nFijo: Enviar notificación sobre actualizaciones de adaptador solamente si hay nuevas\nMejoras: Ocultar los servicios de notificación sólo si no se elige ningún caso\nMejoras: Algunos cambios de código pequeño para evitar mensajes de error",
|
|
93
|
-
"pl": "Oficjalna strona Fully-MQTT\nStrona oficjalna\nW: Lista i liczba aktywnych instancji\nAdded: lista HTML dla przykładów/adaptatorów\nAdded: HM-RPC (ang.)\nAdded: Użytkownicy mogą zdefiniować czas błędu\nFixed: Send notification about adapter updates (ang.)\nPoprawa: Usługi Hide nie tylko wtedy, gdy żadna instancja nie jest wybierana\nPoprawa: Niektóre małe zmiany kodu pozwalają uniknąć błędu",
|
|
94
|
-
"uk": "Доданий: Повністю-MQTT\nДодано: Notification Service Matrix\nДодано: Список та кількість активних екземплярів\nДодано: Списки HTML для екземплярів/адептиків\nДодано: HM-RPC оновлення завантажувальної точки даних\nДодано: Користувач може визначити час звіту для екземплярів помилок\nВиправлено: Надіслати повідомлення про оновлення адаптера тільки якщо є нові\nУдосконалення: Прихильники, які не вибирають\nУдосконалення: Деякі невеликі зміни коду, щоб уникнути повідомлення про помилки",
|
|
95
|
-
"zh-cn": "增 编:\n增 编:通知处\n增 编:积极事例清单和数目\n增 编:HTML案/招待人员名单\n添加:HM-RPC装置在数据点前更新\n增 编:用户可以确定报告错误时间\n九. 固定:关于适应性更新的通知,只有有新的资料才有更新。\n改进: 通知服务只不过是没有选择的。\n改进: 避免错误信息的一些小守则变化"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
|
@@ -234,6 +234,8 @@
|
|
|
234
234
|
"hmrpcMaxMinutes": 0,
|
|
235
235
|
"homeconnectDevices": false,
|
|
236
236
|
"homeconnectMaxMinutes": 0,
|
|
237
|
+
"homekitControllerDevices": false,
|
|
238
|
+
"homekitControllerMaxMinutes": 0,
|
|
237
239
|
"hs100Devices": false,
|
|
238
240
|
"hs100MaxMinutes": 300,
|
|
239
241
|
"hueDevices": false,
|
|
@@ -295,6 +297,8 @@
|
|
|
295
297
|
"tradfriMaxMinutes": 0,
|
|
296
298
|
"unifiDevices": false,
|
|
297
299
|
"unifiMaxMinutes": 0,
|
|
300
|
+
"viessmannDevices": false,
|
|
301
|
+
"viessmannMaxMinutes": 0,
|
|
298
302
|
"wledDevices": false,
|
|
299
303
|
"wledMaxMinutes": 0,
|
|
300
304
|
"yeelightDevices": false,
|
package/lib/arrApart.js
CHANGED
|
@@ -183,6 +183,7 @@ const arrApart = {
|
|
|
183
183
|
battery: 'none',
|
|
184
184
|
reach: '.unreach',
|
|
185
185
|
isLowBat: '.lowBat',
|
|
186
|
+
upgrade: '.info.updateState',
|
|
186
187
|
},
|
|
187
188
|
hmrpc: {
|
|
188
189
|
Selektor: 'hm-rpc.*.RSSI_PEER',
|
|
@@ -212,6 +213,18 @@ const arrApart = {
|
|
|
212
213
|
id: '.name',
|
|
213
214
|
upgrade: 'none',
|
|
214
215
|
},
|
|
216
|
+
homekitController: {
|
|
217
|
+
Selektor: 'homekit-controller.*.connected',
|
|
218
|
+
timeSelector: '.lastDiscovered',
|
|
219
|
+
adapterID: 'homekitController',
|
|
220
|
+
adapter: 'Homekit Controller',
|
|
221
|
+
rssiState: 'none',
|
|
222
|
+
battery: 'none',
|
|
223
|
+
reach: '.connected',
|
|
224
|
+
isLowBat: 'none',
|
|
225
|
+
id: 'none',
|
|
226
|
+
upgrade: 'none',
|
|
227
|
+
},
|
|
215
228
|
hs100: {
|
|
216
229
|
Selektor: 'hs100.*.last_update',
|
|
217
230
|
timeSelector: '.last_update',
|
|
@@ -525,6 +538,18 @@ const arrApart = {
|
|
|
525
538
|
id: 'none',
|
|
526
539
|
upgrade: '.upgradable',
|
|
527
540
|
},
|
|
541
|
+
viessmann: {
|
|
542
|
+
Selektor: 'viessmann.*.info.connection',
|
|
543
|
+
timeSelector: '.lastPoll',
|
|
544
|
+
adapterID: 'viessmann',
|
|
545
|
+
adapter: 'Viessmann',
|
|
546
|
+
rssiState: 'none',
|
|
547
|
+
battery: 'none',
|
|
548
|
+
reach: '.connection',
|
|
549
|
+
isLowBat: 'none',
|
|
550
|
+
id: 'none',
|
|
551
|
+
upgrade: 'none',
|
|
552
|
+
},
|
|
528
553
|
wled: {
|
|
529
554
|
Selektor: 'wled.*._online',
|
|
530
555
|
timeSelector: '._online',
|
package/main.js
CHANGED
|
@@ -122,6 +122,7 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
122
122
|
hmiP: this.config.hmiPDevices,
|
|
123
123
|
hmrpc: this.config.hmrpcDevices,
|
|
124
124
|
homeconnect: this.config.homeconnectDevices,
|
|
125
|
+
homekitController: this.config.homekitControllerDevices,
|
|
125
126
|
hs100: this.config.hs100Devices,
|
|
126
127
|
hue: this.config.hueDevices,
|
|
127
128
|
hueExt: this.config.hueExtDevices,
|
|
@@ -153,6 +154,7 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
153
154
|
tapo: this.config.tapoDevices,
|
|
154
155
|
tradfri: this.config.tradfriDevices,
|
|
155
156
|
unifi: this.config.unifiDevices,
|
|
157
|
+
viessmann: this.config.viessmannDevices,
|
|
156
158
|
wled: this.config.wledDevices,
|
|
157
159
|
yeelight: this.config.yeelightDevices,
|
|
158
160
|
zigbee: this.config.zigbeeDevices,
|
|
@@ -178,6 +180,7 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
178
180
|
hmiP: this.config.hmiPMaxMinutes,
|
|
179
181
|
hmrpc: this.config.hmrpcMaxMinutes,
|
|
180
182
|
homeconnect: this.config.homeconnectMaxMinutes,
|
|
183
|
+
homekitController: this.config.homekitControllerMaxMinutes,
|
|
181
184
|
hs100: this.config.hs100MaxMinutes,
|
|
182
185
|
hue: this.config.hueMaxMinutes,
|
|
183
186
|
hueExt: this.config.hueextMaxMinutes,
|
|
@@ -209,6 +212,7 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
209
212
|
tapo: this.config.tapoMaxMinutes,
|
|
210
213
|
tradfri: this.config.tradfriMaxMinutes,
|
|
211
214
|
unifi: this.config.unifiMaxMinutes,
|
|
215
|
+
viessmann: this.config.viessmannMaxMinutes,
|
|
212
216
|
wled: this.config.wledMaxMinutes,
|
|
213
217
|
yeelight: this.config.yeelightMaxMinutes,
|
|
214
218
|
zigbee: this.config.zigbeeMaxMinutes,
|
|
@@ -416,19 +420,18 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
416
420
|
instanceData.isHealthy = instanceStatusRaw[1];
|
|
417
421
|
instanceData.status = instanceStatusRaw[2];
|
|
418
422
|
|
|
419
|
-
if (oldIsHealthyValue
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
if (this.config.checkSendInstanceFailedMsg && instanceData.isAlive && !instanceData.isHealthy) {
|
|
427
|
-
if (!this.blacklistInstancesNotify.includes(instanceID)) {
|
|
428
|
-
await this.sendStateNotifications('errorInstance', instanceID);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
423
|
+
if (oldIsHealthyValue === instanceData.isHealthy) continue;
|
|
424
|
+
// send message when instance was deactivated
|
|
425
|
+
if (this.config.checkSendInstanceDeactivatedMsg && !instanceData.isAlive) {
|
|
426
|
+
if (this.blacklistInstancesNotify.includes(instanceID)) continue;
|
|
427
|
+
await this.sendStateNotifications('deactivatedInstance', instanceID);
|
|
431
428
|
}
|
|
429
|
+
// send message when instance has an error
|
|
430
|
+
if (this.config.checkSendInstanceFailedMsg && instanceData.isAlive && !instanceData.isHealthy) {
|
|
431
|
+
if (this.blacklistInstancesNotify.includes(instanceID)) continue;
|
|
432
|
+
await this.sendStateNotifications('errorInstance', instanceID);
|
|
433
|
+
}
|
|
434
|
+
|
|
432
435
|
instanceData.checkIsRunning = false;
|
|
433
436
|
}
|
|
434
437
|
break;
|
|
@@ -448,8 +451,8 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
448
451
|
// device updates
|
|
449
452
|
case deviceData.UpdateDP:
|
|
450
453
|
if (state.val !== deviceData.Upgradable) {
|
|
451
|
-
deviceData.Upgradable = state.val;
|
|
452
|
-
if (
|
|
454
|
+
deviceData.Upgradable = await this.checkDeviceUpdate(deviceData.adapterID, state.val);
|
|
455
|
+
if (deviceData.Upgradable === true) {
|
|
453
456
|
if (this.config.checkSendDeviceUpgrade && !this.blacklistNotify.includes(deviceData.Path)) {
|
|
454
457
|
await this.sendStateNotifications('updateDevice', device);
|
|
455
458
|
}
|
|
@@ -1002,18 +1005,24 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1002
1005
|
/*=============================================
|
|
1003
1006
|
= Get update data =
|
|
1004
1007
|
=============================================*/
|
|
1005
|
-
const deviceUpdateDP = currDeviceString + this.selAdapter[i].upgrade;
|
|
1006
1008
|
let isUpgradable;
|
|
1009
|
+
let deviceUpdateDP;
|
|
1007
1010
|
|
|
1008
1011
|
if (this.config.checkSendDeviceUpgrade) {
|
|
1009
|
-
|
|
1012
|
+
deviceUpdateDP = currDeviceString + this.selAdapter[i].upgrade;
|
|
1013
|
+
let deviceUpdateSelector = await this.getInitValue(deviceUpdateDP);
|
|
1014
|
+
if (deviceUpdateSelector === undefined) {
|
|
1015
|
+
deviceUpdateDP = shortCurrDeviceString + this.selAdapter[i].upgrade;
|
|
1016
|
+
deviceUpdateSelector = await this.getInitValue(deviceUpdateDP);
|
|
1017
|
+
if (deviceUpdateSelector === undefined) {
|
|
1018
|
+
const shortShortCurrDeviceString = shortCurrDeviceString.slice(0, shortCurrDeviceString.lastIndexOf('.') + 1 - 1);
|
|
1019
|
+
deviceUpdateDP = shortShortCurrDeviceString + this.selAdapter[i].upgrade;
|
|
1020
|
+
deviceUpdateSelector = await this.getInitValue(deviceUpdateDP);
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1010
1023
|
|
|
1011
1024
|
if (deviceUpdateSelector !== undefined) {
|
|
1012
|
-
|
|
1013
|
-
isUpgradable = true;
|
|
1014
|
-
} else if (!deviceUpdateSelector) {
|
|
1015
|
-
isUpgradable = false;
|
|
1016
|
-
}
|
|
1025
|
+
isUpgradable = await this.checkDeviceUpdate(adapterID, deviceUpdateSelector);
|
|
1017
1026
|
} else {
|
|
1018
1027
|
isUpgradable = ' - ';
|
|
1019
1028
|
}
|
|
@@ -1108,6 +1117,8 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1108
1117
|
case 'wled':
|
|
1109
1118
|
case 'mqttNuki':
|
|
1110
1119
|
case 'loqedSmartLock':
|
|
1120
|
+
case 'viessmann':
|
|
1121
|
+
case 'homekitController':
|
|
1111
1122
|
if (shortDeviceObject && typeof shortDeviceObject === 'object') {
|
|
1112
1123
|
deviceName = shortDeviceObject.common.name;
|
|
1113
1124
|
}
|
|
@@ -1442,21 +1453,21 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1442
1453
|
if (this.configMaxMinutes[adapterID] <= 0) {
|
|
1443
1454
|
if (deviceUnreachState === 1) {
|
|
1444
1455
|
deviceState = 'Offline'; //set online state to offline
|
|
1445
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1456
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1446
1457
|
}
|
|
1447
1458
|
} else if (lastDeviceUnreachStateChange > this.configMaxMinutes[adapterID] && deviceUnreachState === 1) {
|
|
1448
1459
|
deviceState = 'Offline'; //set online state to offline
|
|
1449
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1460
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1450
1461
|
}
|
|
1451
1462
|
break;
|
|
1452
1463
|
case 'proxmox':
|
|
1453
1464
|
if (this.configMaxMinutes[adapterID] <= 0) {
|
|
1454
1465
|
if (deviceUnreachState !== 'running' && deviceUnreachState !== 'online') {
|
|
1455
|
-
deviceState = 'Offline'; //set online state to offline
|
|
1466
|
+
if (linkQuality !== ' - ') deviceState = 'Offline'; //set online state to offline
|
|
1456
1467
|
}
|
|
1457
1468
|
} else if (lastDeviceUnreachStateChange > this.configMaxMinutes[adapterID] && deviceUnreachState !== 'running' && deviceUnreachState !== 'online') {
|
|
1458
1469
|
deviceState = 'Offline'; //set online state to offline
|
|
1459
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1470
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1460
1471
|
}
|
|
1461
1472
|
break;
|
|
1462
1473
|
case 'hmiP':
|
|
@@ -1464,11 +1475,11 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1464
1475
|
if (this.configMaxMinutes[adapterID] <= 0) {
|
|
1465
1476
|
if (deviceUnreachState) {
|
|
1466
1477
|
deviceState = 'Offline'; //set online state to offline
|
|
1467
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1478
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1468
1479
|
}
|
|
1469
1480
|
} else if (lastDeviceUnreachStateChange > this.configMaxMinutes[adapterID] && deviceUnreachState) {
|
|
1470
1481
|
deviceState = 'Offline'; //set online state to offline
|
|
1471
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1482
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1472
1483
|
}
|
|
1473
1484
|
break;
|
|
1474
1485
|
case 'apcups':
|
|
@@ -1484,22 +1495,22 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1484
1495
|
if (this.configMaxMinutes[adapterID] <= 0) {
|
|
1485
1496
|
if (!deviceUnreachState) {
|
|
1486
1497
|
deviceState = 'Offline'; //set online state to offline
|
|
1487
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1498
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1488
1499
|
}
|
|
1489
1500
|
} else if (!deviceUnreachState && lastDeviceUnreachStateChange > this.configMaxMinutes[adapterID]) {
|
|
1490
1501
|
deviceState = 'Offline'; //set online state to offline
|
|
1491
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1502
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1492
1503
|
}
|
|
1493
1504
|
break;
|
|
1494
1505
|
case 'mqttClientZigbee2Mqtt':
|
|
1495
1506
|
if (this.configMaxMinutes[adapterID] <= 0) {
|
|
1496
1507
|
if (deviceUnreachState !== 'online') {
|
|
1497
1508
|
deviceState = 'Offline'; //set online state to offline
|
|
1498
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1509
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1499
1510
|
}
|
|
1500
1511
|
} else if (deviceUnreachState !== 'online' && lastDeviceUnreachStateChange > this.configMaxMinutes[adapterID]) {
|
|
1501
1512
|
deviceState = 'Offline'; //set online state to offline
|
|
1502
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1513
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1503
1514
|
}
|
|
1504
1515
|
break;
|
|
1505
1516
|
case 'mihome':
|
|
@@ -1507,21 +1518,21 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1507
1518
|
if (this.configMaxMinutes[adapterID] <= 0) {
|
|
1508
1519
|
if (!deviceUnreachState) {
|
|
1509
1520
|
deviceState = 'Offline'; //set online state to offline
|
|
1510
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1521
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1511
1522
|
}
|
|
1512
1523
|
} else if (lastContact && lastContact > this.configMaxMinutes[adapterID]) {
|
|
1513
1524
|
deviceState = 'Offline'; //set online state to offline
|
|
1514
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1525
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1515
1526
|
}
|
|
1516
1527
|
} else {
|
|
1517
1528
|
if (this.config.mihomeMaxMinutes <= 0) {
|
|
1518
1529
|
if (this.configMaxMinutes[adapterID] <= 0) {
|
|
1519
1530
|
deviceState = 'Offline'; //set online state to offline
|
|
1520
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1531
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1521
1532
|
}
|
|
1522
1533
|
} else if (lastContact && lastContact > this.configMaxMinutes[adapterID]) {
|
|
1523
1534
|
deviceState = 'Offline'; //set online state to offline
|
|
1524
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1535
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1525
1536
|
}
|
|
1526
1537
|
}
|
|
1527
1538
|
break;
|
|
@@ -1529,22 +1540,22 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1529
1540
|
if (this.configMaxMinutes[adapterID] <= 0) {
|
|
1530
1541
|
if (deviceUnreachState === 'OFFLINE') {
|
|
1531
1542
|
deviceState = 'Offline'; //set online state to offline
|
|
1532
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1543
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1533
1544
|
}
|
|
1534
1545
|
} else if (deviceUnreachState === 'OFFLINE' && lastDeviceUnreachStateChange > this.configMaxMinutes[adapterID]) {
|
|
1535
1546
|
deviceState = 'Offline'; //set online state to offline
|
|
1536
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1547
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1537
1548
|
}
|
|
1538
1549
|
break;
|
|
1539
1550
|
default:
|
|
1540
1551
|
if (this.configMaxMinutes[adapterID] <= 0) {
|
|
1541
1552
|
if (!deviceUnreachState) {
|
|
1542
1553
|
deviceState = 'Offline'; //set online state to offline
|
|
1543
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1554
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1544
1555
|
}
|
|
1545
1556
|
} else if (lastContact && lastContact > this.configMaxMinutes[adapterID]) {
|
|
1546
1557
|
deviceState = 'Offline'; //set online state to offline
|
|
1547
|
-
linkQuality = '0%'; // set linkQuality to nothing
|
|
1558
|
+
if (linkQuality !== ' - ') linkQuality = '0%'; // set linkQuality to nothing
|
|
1548
1559
|
}
|
|
1549
1560
|
break;
|
|
1550
1561
|
}
|
|
@@ -1584,8 +1595,35 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1584
1595
|
}
|
|
1585
1596
|
}
|
|
1586
1597
|
|
|
1598
|
+
/**
|
|
1599
|
+
* @param {any} adapterID
|
|
1600
|
+
* @param {string | number | boolean | null} deviceUpdateSelector
|
|
1601
|
+
*/
|
|
1602
|
+
async checkDeviceUpdate(adapterID, deviceUpdateSelector) {
|
|
1603
|
+
let isUpgradable;
|
|
1604
|
+
|
|
1605
|
+
switch (adapterID) {
|
|
1606
|
+
case 'hmiP':
|
|
1607
|
+
if (deviceUpdateSelector === 'UPDATE_AVAILABLE') {
|
|
1608
|
+
isUpgradable = true;
|
|
1609
|
+
} else {
|
|
1610
|
+
isUpgradable = false;
|
|
1611
|
+
}
|
|
1612
|
+
break;
|
|
1613
|
+
default:
|
|
1614
|
+
if (deviceUpdateSelector) {
|
|
1615
|
+
isUpgradable = true;
|
|
1616
|
+
} else if (!deviceUpdateSelector) {
|
|
1617
|
+
isUpgradable = false;
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
return isUpgradable;
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1587
1624
|
/**
|
|
1588
1625
|
* Create Lists
|
|
1626
|
+
* @param {string | undefined} [adptName]
|
|
1589
1627
|
*/
|
|
1590
1628
|
async createLists(adptName) {
|
|
1591
1629
|
this.linkQualityDevices = [];
|
|
@@ -2127,6 +2165,49 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
2127
2165
|
return [isAlive, isHealthy, instanceStatusString];
|
|
2128
2166
|
}
|
|
2129
2167
|
|
|
2168
|
+
/**
|
|
2169
|
+
* Check if instance is alive and ok
|
|
2170
|
+
* @param {string} instanceID
|
|
2171
|
+
* @param {number} instanceDeactivationTime
|
|
2172
|
+
*/
|
|
2173
|
+
async checkDaemonIsAlive(instanceID, instanceDeactivationTime) {
|
|
2174
|
+
const aliveState = await this.getInitValue(`system.adapter.${instanceID}.alive`);
|
|
2175
|
+
let daemonIsAlive;
|
|
2176
|
+
|
|
2177
|
+
let isAlive = false;
|
|
2178
|
+
let isHealthy = false;
|
|
2179
|
+
let instanceStatusString = 'Instanz deaktiviert';
|
|
2180
|
+
|
|
2181
|
+
if (aliveState) {
|
|
2182
|
+
daemonIsAlive = await this.checkDaemonIsHealthy(instanceID);
|
|
2183
|
+
isAlive = Boolean(daemonIsAlive[0]);
|
|
2184
|
+
isHealthy = Boolean(daemonIsAlive[1]);
|
|
2185
|
+
instanceStatusString = String(daemonIsAlive[2]);
|
|
2186
|
+
} else if (!aliveState) {
|
|
2187
|
+
await this.delay(instanceDeactivationTime);
|
|
2188
|
+
daemonIsAlive = await this.checkDaemonIsHealthy(instanceID);
|
|
2189
|
+
if (!daemonIsAlive[0]) {
|
|
2190
|
+
await this.delay(instanceDeactivationTime);
|
|
2191
|
+
daemonIsAlive = await this.checkDaemonIsHealthy(instanceID);
|
|
2192
|
+
if (!daemonIsAlive[0]) {
|
|
2193
|
+
isAlive = Boolean(daemonIsAlive[0]);
|
|
2194
|
+
isHealthy = Boolean(daemonIsAlive[1]);
|
|
2195
|
+
instanceStatusString = String(daemonIsAlive[2]);
|
|
2196
|
+
} else {
|
|
2197
|
+
isAlive = Boolean(daemonIsAlive[0]);
|
|
2198
|
+
isHealthy = Boolean(daemonIsAlive[1]);
|
|
2199
|
+
instanceStatusString = String(daemonIsAlive[2]);
|
|
2200
|
+
}
|
|
2201
|
+
} else {
|
|
2202
|
+
isAlive = Boolean(daemonIsAlive[0]);
|
|
2203
|
+
isHealthy = Boolean(daemonIsAlive[1]);
|
|
2204
|
+
instanceStatusString = String(daemonIsAlive[2]);
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
return [isAlive, isHealthy, instanceStatusString];
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2130
2211
|
async checkScheduleisHealty(instanceID, scheduleTime) {
|
|
2131
2212
|
let lastUpdate;
|
|
2132
2213
|
let previousCronRun = null;
|
|
@@ -2190,24 +2271,8 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
2190
2271
|
instanceErrorTime = this.userTimeInstancesList.get(instanceID).errorTime;
|
|
2191
2272
|
instanceErrorTime = (instanceErrorTime * 1000) / 2; // calculate sec to ms and divide into two
|
|
2192
2273
|
}
|
|
2193
|
-
daemonIsAlive = await this.checkDaemonIsHealthy(instanceID);
|
|
2194
2274
|
|
|
2195
|
-
|
|
2196
|
-
// wait first time
|
|
2197
|
-
await this.delay(instanceDeactivationTime);
|
|
2198
|
-
daemonIsAlive = await this.checkDaemonIsHealthy(instanceID);
|
|
2199
|
-
if (!daemonIsAlive[0]) {
|
|
2200
|
-
// wait second time
|
|
2201
|
-
await this.delay(instanceDeactivationTime);
|
|
2202
|
-
daemonIsAlive = await this.checkDaemonIsHealthy(instanceID);
|
|
2203
|
-
if (!daemonIsAlive[0]) {
|
|
2204
|
-
// finally
|
|
2205
|
-
isAlive = Boolean(daemonIsAlive[0]);
|
|
2206
|
-
isHealthy = Boolean(daemonIsAlive[1]);
|
|
2207
|
-
instanceStatusString = String(daemonIsAlive[2]);
|
|
2208
|
-
}
|
|
2209
|
-
}
|
|
2210
|
-
};
|
|
2275
|
+
daemonIsAlive = await this.checkDaemonIsHealthy(instanceID);
|
|
2211
2276
|
|
|
2212
2277
|
if (daemonIsAlive[0]) {
|
|
2213
2278
|
if (daemonIsAlive[1]) {
|
|
@@ -2228,16 +2293,28 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
2228
2293
|
isHealthy = Boolean(daemonIsAlive[1]);
|
|
2229
2294
|
instanceStatusString = String(daemonIsAlive[2]);
|
|
2230
2295
|
} else if (!daemonIsAlive[0]) {
|
|
2231
|
-
await
|
|
2296
|
+
daemonIsNotAlive = await this.checkDaemonIsAlive(instanceID, instanceDeactivationTime);
|
|
2297
|
+
isAlive = Boolean(daemonIsNotAlive[0]);
|
|
2298
|
+
isHealthy = Boolean(daemonIsNotAlive[1]);
|
|
2299
|
+
instanceStatusString = String(daemonIsNotAlive[2]);
|
|
2232
2300
|
}
|
|
2233
2301
|
} else if (!daemonIsAlive[0]) {
|
|
2234
|
-
await
|
|
2302
|
+
daemonIsNotAlive = await this.checkDaemonIsAlive(instanceID, instanceDeactivationTime);
|
|
2303
|
+
isAlive = Boolean(daemonIsNotAlive[0]);
|
|
2304
|
+
isHealthy = Boolean(daemonIsNotAlive[1]);
|
|
2305
|
+
instanceStatusString = String(daemonIsNotAlive[2]);
|
|
2235
2306
|
}
|
|
2236
2307
|
} else if (!daemonIsAlive[0]) {
|
|
2237
|
-
await
|
|
2308
|
+
daemonIsNotAlive = await this.checkDaemonIsAlive(instanceID, instanceDeactivationTime);
|
|
2309
|
+
isAlive = Boolean(daemonIsNotAlive[0]);
|
|
2310
|
+
isHealthy = Boolean(daemonIsNotAlive[1]);
|
|
2311
|
+
instanceStatusString = String(daemonIsNotAlive[2]);
|
|
2238
2312
|
}
|
|
2239
2313
|
} else if (!daemonIsAlive[0]) {
|
|
2240
|
-
await
|
|
2314
|
+
daemonIsNotAlive = await this.checkDaemonIsAlive(instanceID, instanceDeactivationTime);
|
|
2315
|
+
isAlive = Boolean(daemonIsNotAlive[0]);
|
|
2316
|
+
isHealthy = Boolean(daemonIsNotAlive[1]);
|
|
2317
|
+
instanceStatusString = String(daemonIsNotAlive[2]);
|
|
2241
2318
|
}
|
|
2242
2319
|
break;
|
|
2243
2320
|
}
|
|
@@ -3019,10 +3096,22 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
3019
3096
|
}
|
|
3020
3097
|
}
|
|
3021
3098
|
if (list.length === 0) return;
|
|
3022
|
-
|
|
3099
|
+
|
|
3100
|
+
switch (checkDays.length) {
|
|
3101
|
+
case 1:
|
|
3102
|
+
message = `Wöchentliche Übersicht über Geräte mit niedrigen Batteriezuständen: ${list}`;
|
|
3103
|
+
break;
|
|
3104
|
+
case 7:
|
|
3105
|
+
message = `Tägliche Übersicht über Geräte mit niedrigen Batteriezuständen: ${list}`;
|
|
3106
|
+
break;
|
|
3107
|
+
default:
|
|
3108
|
+
message = `Übersicht über Geräte mit niedrigen Batteriezuständen: ${list}`;
|
|
3109
|
+
break;
|
|
3110
|
+
}
|
|
3023
3111
|
setMessage(message);
|
|
3024
3112
|
});
|
|
3025
3113
|
break;
|
|
3114
|
+
|
|
3026
3115
|
case 'offlineDevices':
|
|
3027
3116
|
// push the selected days in list
|
|
3028
3117
|
if (this.config.checkOfflineMonday) checkDays.push(1);
|
|
@@ -3055,10 +3144,22 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
3055
3144
|
}
|
|
3056
3145
|
|
|
3057
3146
|
if (list.length === 0) return;
|
|
3058
|
-
|
|
3147
|
+
|
|
3148
|
+
switch (checkDays.length) {
|
|
3149
|
+
case 1:
|
|
3150
|
+
message = `Wöchentliche Übersicht über offline Geräte: ${list}`;
|
|
3151
|
+
break;
|
|
3152
|
+
case 7:
|
|
3153
|
+
message = `Tägliche Übersicht über offline Geräte: ${list}`;
|
|
3154
|
+
break;
|
|
3155
|
+
default:
|
|
3156
|
+
message = `Übersicht über offline Geräte: ${list}`;
|
|
3157
|
+
break;
|
|
3158
|
+
}
|
|
3059
3159
|
setMessage(message);
|
|
3060
3160
|
});
|
|
3061
3161
|
break;
|
|
3162
|
+
|
|
3062
3163
|
case 'updateDevices':
|
|
3063
3164
|
// push the selected days in list
|
|
3064
3165
|
if (this.config.checkUpgradeMonday) checkDays.push(1);
|
|
@@ -3090,10 +3191,22 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
3090
3191
|
}
|
|
3091
3192
|
}
|
|
3092
3193
|
if (list.length === 0) return;
|
|
3093
|
-
|
|
3194
|
+
|
|
3195
|
+
switch (checkDays.length) {
|
|
3196
|
+
case 1:
|
|
3197
|
+
message = `Wöchentliche Übersicht über verfügbare Geräte Updates: ${list}`;
|
|
3198
|
+
break;
|
|
3199
|
+
case 7:
|
|
3200
|
+
message = `Tägliche Übersicht über verfügbare Geräte Updates: ${list}`;
|
|
3201
|
+
break;
|
|
3202
|
+
default:
|
|
3203
|
+
message = `Übersicht über verfügbare Geräte Updates: ${list}`;
|
|
3204
|
+
break;
|
|
3205
|
+
}
|
|
3094
3206
|
setMessage(message);
|
|
3095
3207
|
});
|
|
3096
3208
|
break;
|
|
3209
|
+
|
|
3097
3210
|
case 'updateAdapter':
|
|
3098
3211
|
// push the selected days in list
|
|
3099
3212
|
if (this.config.checkAdapterUpdateMonday) checkDays.push(1);
|
|
@@ -3120,10 +3233,22 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
3120
3233
|
list = `${list}\n${id.Adapter}: v${id['Available Version']}`;
|
|
3121
3234
|
}
|
|
3122
3235
|
if (list.length === 0) return;
|
|
3123
|
-
|
|
3236
|
+
|
|
3237
|
+
switch (checkDays.length) {
|
|
3238
|
+
case 1:
|
|
3239
|
+
message = `Wöchentliche Übersicht über verfügbare Adapter Updates: ${list}`;
|
|
3240
|
+
break;
|
|
3241
|
+
case 7:
|
|
3242
|
+
message = `Tägliche Übersicht über verfügbare Adapter Updates: ${list}`;
|
|
3243
|
+
break;
|
|
3244
|
+
default:
|
|
3245
|
+
message = `Übersicht über verfügbare Adapter Updates: ${list}`;
|
|
3246
|
+
break;
|
|
3247
|
+
}
|
|
3124
3248
|
setMessage(message);
|
|
3125
3249
|
});
|
|
3126
3250
|
break;
|
|
3251
|
+
|
|
3127
3252
|
case 'errorInstance':
|
|
3128
3253
|
// push the selected days in list
|
|
3129
3254
|
if (this.config.checkFailedInstancesMonday) checkDays.push(1);
|
|
@@ -3174,13 +3299,24 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
3174
3299
|
cron = '5 ' + time[1] + ' ' + time[0] + ' * * ' + checkDays;
|
|
3175
3300
|
schedule.scheduleJob(cron, () => {
|
|
3176
3301
|
list = '';
|
|
3177
|
-
|
|
3178
3302
|
for (const id of this.listDeactivatedInstances) {
|
|
3179
|
-
if (this.blacklistInstancesNotify.includes(id)) continue;
|
|
3180
|
-
list = `${list}\n${id}`;
|
|
3303
|
+
if (this.blacklistInstancesNotify.includes(id.Instance)) continue;
|
|
3304
|
+
list = `${list}\n${id.Instance}`;
|
|
3181
3305
|
}
|
|
3306
|
+
|
|
3182
3307
|
if (list.length === 0) return;
|
|
3183
|
-
|
|
3308
|
+
|
|
3309
|
+
switch (checkDays.length) {
|
|
3310
|
+
case 1:
|
|
3311
|
+
message = `Wöchentliche Übersicht über deaktivierte Instanzen: ${list}`;
|
|
3312
|
+
break;
|
|
3313
|
+
case 7:
|
|
3314
|
+
message = `Tägliche Übersicht über deaktivierte Instanzen: ${list}`;
|
|
3315
|
+
break;
|
|
3316
|
+
default:
|
|
3317
|
+
message = `Übersicht über deaktivierte Instanzen: ${list}`;
|
|
3318
|
+
break;
|
|
3319
|
+
}
|
|
3184
3320
|
setMessage(message);
|
|
3185
3321
|
});
|
|
3186
3322
|
break;
|