iobroker.device-watcher 2.8.4 → 2.8.5
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 +5 -0
- package/admin/jsonConfig.json +1 -9
- package/io-package.json +14 -14
- package/main.js +71 -33
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -189,6 +189,11 @@ 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.8.5 (2023-04-20)
|
|
193
|
+
|
|
194
|
+
- (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)
|
|
195
|
+
- (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)
|
|
196
|
+
|
|
192
197
|
### 2.8.4 (2023-04-16)
|
|
193
198
|
|
|
194
199
|
- (ciddi89) Fixed: Functions for instance status completely renewed ([#170](https://github.com/ciddi89/ioBroker.device-watcher/issues/170))
|
package/admin/jsonConfig.json
CHANGED
|
@@ -1389,15 +1389,7 @@
|
|
|
1389
1389
|
"sort": false,
|
|
1390
1390
|
"jsonData": "{\"instanceID\":\"${globalData.instanceID}\",\"adapter\":\"${globalData.adapter}\"}",
|
|
1391
1391
|
"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
|
-
}
|
|
1392
|
+
"width": "60%"
|
|
1401
1393
|
},
|
|
1402
1394
|
{
|
|
1403
1395
|
"type": "checkbox",
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "device-watcher",
|
|
4
|
-
"version": "2.8.
|
|
4
|
+
"version": "2.8.5",
|
|
5
5
|
"news": {
|
|
6
|
+
"2.8.5": {
|
|
7
|
+
"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)",
|
|
8
|
+
"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)",
|
|
9
|
+
"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)",
|
|
10
|
+
"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)",
|
|
11
|
+
"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",
|
|
12
|
+
"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)",
|
|
13
|
+
"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)",
|
|
14
|
+
"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)",
|
|
15
|
+
"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)",
|
|
16
|
+
"uk": "Виправлено: помилка, що екземпляри не можуть бути додані в чорний список через повідомлення електронної пошти [#172] (https://github.com/ciddi89/ioBroker.device-watcher/issues/172)\nВиправлено: Що повідомлення було відправлено, коли екземпляр коротко стрибнув з Увімкненого і назад до Увімкненого [#173] (https://github.com/ciddi89/ioBroker.device-watcher/issues/173)",
|
|
17
|
+
"zh-cn": "固定:由于人口信息[第172号](http://github.com/ciddi89/ioBroker.device-watcher/issues/172)而无法增加黑名单。\n固定: 这一信息是在以下情况下发出的:从便携起降到残疾人,回到了可居住的[第173号](http://github.com/ciddi89/ioBroker.device-watcher/issues/173)。"
|
|
18
|
+
},
|
|
6
19
|
"2.8.4": {
|
|
7
20
|
"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
21
|
"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)",
|
|
@@ -80,19 +93,6 @@
|
|
|
80
93
|
"pl": "Wsparcie dla Ecovac-Deebota\nZastrzeżenie: Zależność\nPoprawa: drobne rozwiązanie",
|
|
81
94
|
"uk": "Додано: Підтримка Ecovacs-Deebot\nОновлено: Залежності\nУдосконалення: Маленькі кріплення",
|
|
82
95
|
"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": {
|
package/main.js
CHANGED
|
@@ -416,19 +416,18 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
416
416
|
instanceData.isHealthy = instanceStatusRaw[1];
|
|
417
417
|
instanceData.status = instanceStatusRaw[2];
|
|
418
418
|
|
|
419
|
-
if (oldIsHealthyValue
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
}
|
|
430
|
-
}
|
|
419
|
+
if (oldIsHealthyValue === instanceData.isHealthy) continue;
|
|
420
|
+
// send message when instance was deactivated
|
|
421
|
+
if (this.config.checkSendInstanceDeactivatedMsg && !instanceData.isAlive) {
|
|
422
|
+
if (this.blacklistInstancesNotify.includes(instanceID)) continue;
|
|
423
|
+
await this.sendStateNotifications('deactivatedInstance', instanceID);
|
|
424
|
+
}
|
|
425
|
+
// send message when instance has an error
|
|
426
|
+
if (this.config.checkSendInstanceFailedMsg && instanceData.isAlive && !instanceData.isHealthy) {
|
|
427
|
+
if (this.blacklistInstancesNotify.includes(instanceID)) continue;
|
|
428
|
+
await this.sendStateNotifications('errorInstance', instanceID);
|
|
431
429
|
}
|
|
430
|
+
|
|
432
431
|
instanceData.checkIsRunning = false;
|
|
433
432
|
}
|
|
434
433
|
break;
|
|
@@ -2127,6 +2126,49 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
2127
2126
|
return [isAlive, isHealthy, instanceStatusString];
|
|
2128
2127
|
}
|
|
2129
2128
|
|
|
2129
|
+
/**
|
|
2130
|
+
* Check if instance is alive and ok
|
|
2131
|
+
* @param {string} instanceID
|
|
2132
|
+
* @param {number} instanceDeactivationTime
|
|
2133
|
+
*/
|
|
2134
|
+
async checkDaemonIsAlive(instanceID, instanceDeactivationTime) {
|
|
2135
|
+
const aliveState = await this.getInitValue(`system.adapter.${instanceID}.alive`);
|
|
2136
|
+
let daemonIsAlive;
|
|
2137
|
+
|
|
2138
|
+
let isAlive = false;
|
|
2139
|
+
let isHealthy = false;
|
|
2140
|
+
let instanceStatusString = 'Instanz deaktiviert';
|
|
2141
|
+
|
|
2142
|
+
if (aliveState) {
|
|
2143
|
+
daemonIsAlive = await this.checkDaemonIsHealthy(instanceID);
|
|
2144
|
+
isAlive = Boolean(daemonIsAlive[0]);
|
|
2145
|
+
isHealthy = Boolean(daemonIsAlive[1]);
|
|
2146
|
+
instanceStatusString = String(daemonIsAlive[2]);
|
|
2147
|
+
} else if (!aliveState) {
|
|
2148
|
+
await this.delay(instanceDeactivationTime);
|
|
2149
|
+
daemonIsAlive = await this.checkDaemonIsHealthy(instanceID);
|
|
2150
|
+
if (!daemonIsAlive[0]) {
|
|
2151
|
+
await this.delay(instanceDeactivationTime);
|
|
2152
|
+
daemonIsAlive = await this.checkDaemonIsHealthy(instanceID);
|
|
2153
|
+
if (!daemonIsAlive[0]) {
|
|
2154
|
+
isAlive = Boolean(daemonIsAlive[0]);
|
|
2155
|
+
isHealthy = Boolean(daemonIsAlive[1]);
|
|
2156
|
+
instanceStatusString = String(daemonIsAlive[2]);
|
|
2157
|
+
} else {
|
|
2158
|
+
isAlive = Boolean(daemonIsAlive[0]);
|
|
2159
|
+
isHealthy = Boolean(daemonIsAlive[1]);
|
|
2160
|
+
instanceStatusString = String(daemonIsAlive[2]);
|
|
2161
|
+
}
|
|
2162
|
+
} else {
|
|
2163
|
+
isAlive = Boolean(daemonIsAlive[0]);
|
|
2164
|
+
isHealthy = Boolean(daemonIsAlive[1]);
|
|
2165
|
+
instanceStatusString = String(daemonIsAlive[2]);
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
return [isAlive, isHealthy, instanceStatusString];
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2130
2172
|
async checkScheduleisHealty(instanceID, scheduleTime) {
|
|
2131
2173
|
let lastUpdate;
|
|
2132
2174
|
let previousCronRun = null;
|
|
@@ -2190,24 +2232,8 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
2190
2232
|
instanceErrorTime = this.userTimeInstancesList.get(instanceID).errorTime;
|
|
2191
2233
|
instanceErrorTime = (instanceErrorTime * 1000) / 2; // calculate sec to ms and divide into two
|
|
2192
2234
|
}
|
|
2193
|
-
daemonIsAlive = await this.checkDaemonIsHealthy(instanceID);
|
|
2194
2235
|
|
|
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
|
-
};
|
|
2236
|
+
daemonIsAlive = await this.checkDaemonIsHealthy(instanceID);
|
|
2211
2237
|
|
|
2212
2238
|
if (daemonIsAlive[0]) {
|
|
2213
2239
|
if (daemonIsAlive[1]) {
|
|
@@ -2228,16 +2254,28 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
2228
2254
|
isHealthy = Boolean(daemonIsAlive[1]);
|
|
2229
2255
|
instanceStatusString = String(daemonIsAlive[2]);
|
|
2230
2256
|
} else if (!daemonIsAlive[0]) {
|
|
2231
|
-
await
|
|
2257
|
+
daemonIsNotAlive = await this.checkDaemonIsAlive(instanceID, instanceDeactivationTime);
|
|
2258
|
+
isAlive = Boolean(daemonIsNotAlive[0]);
|
|
2259
|
+
isHealthy = Boolean(daemonIsNotAlive[1]);
|
|
2260
|
+
instanceStatusString = String(daemonIsNotAlive[2]);
|
|
2232
2261
|
}
|
|
2233
2262
|
} else if (!daemonIsAlive[0]) {
|
|
2234
|
-
await
|
|
2263
|
+
daemonIsNotAlive = await this.checkDaemonIsAlive(instanceID, instanceDeactivationTime);
|
|
2264
|
+
isAlive = Boolean(daemonIsNotAlive[0]);
|
|
2265
|
+
isHealthy = Boolean(daemonIsNotAlive[1]);
|
|
2266
|
+
instanceStatusString = String(daemonIsNotAlive[2]);
|
|
2235
2267
|
}
|
|
2236
2268
|
} else if (!daemonIsAlive[0]) {
|
|
2237
|
-
await
|
|
2269
|
+
daemonIsNotAlive = await this.checkDaemonIsAlive(instanceID, instanceDeactivationTime);
|
|
2270
|
+
isAlive = Boolean(daemonIsNotAlive[0]);
|
|
2271
|
+
isHealthy = Boolean(daemonIsNotAlive[1]);
|
|
2272
|
+
instanceStatusString = String(daemonIsNotAlive[2]);
|
|
2238
2273
|
}
|
|
2239
2274
|
} else if (!daemonIsAlive[0]) {
|
|
2240
|
-
await
|
|
2275
|
+
daemonIsNotAlive = await this.checkDaemonIsAlive(instanceID, instanceDeactivationTime);
|
|
2276
|
+
isAlive = Boolean(daemonIsNotAlive[0]);
|
|
2277
|
+
isHealthy = Boolean(daemonIsNotAlive[1]);
|
|
2278
|
+
instanceStatusString = String(daemonIsNotAlive[2]);
|
|
2241
2279
|
}
|
|
2242
2280
|
break;
|
|
2243
2281
|
}
|