iobroker.device-watcher 2.2.0 → 2.2.2
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 +12 -0
- package/admin/i18n/de/translations.json +4 -1
- package/admin/i18n/en/translations.json +97 -94
- package/admin/i18n/es/translations.json +4 -1
- package/admin/i18n/fr/translations.json +4 -1
- package/admin/i18n/it/translations.json +4 -1
- package/admin/i18n/nl/translations.json +4 -1
- package/admin/i18n/pl/translations.json +4 -1
- package/admin/i18n/pt/translations.json +4 -1
- package/admin/i18n/ru/translations.json +4 -1
- package/admin/i18n/uk/translations.json +4 -1
- package/admin/i18n/zh-cn/translations.json +4 -1
- package/admin/jsonConfig.json +19 -0
- package/io-package.json +30 -28
- package/lib/arrApart.js +9 -0
- package/main.js +187 -215
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,6 +90,18 @@ If you don't want a specifice device in the list, you can add it in the blacklis
|
|
|
90
90
|
Placeholder for the next version (at the beginning of the line):
|
|
91
91
|
### **WORK IN PROGRESS**
|
|
92
92
|
-->
|
|
93
|
+
### 2.2.2 (2022-12-29)
|
|
94
|
+
|
|
95
|
+
- (ciddi89) some translation added
|
|
96
|
+
- (ciddi89) datapoints will be written in intervall
|
|
97
|
+
- (ciddi89) improvements of lists
|
|
98
|
+
- (ciddi89) some other small improvements
|
|
99
|
+
|
|
100
|
+
### 2.2.1 (2022-12-28)
|
|
101
|
+
|
|
102
|
+
- (ciddi89) Innogy Smarthome added
|
|
103
|
+
- (ciddi89) Lists for each adapter are working again
|
|
104
|
+
|
|
93
105
|
### 2.2.0 (2022-12-27)
|
|
94
106
|
|
|
95
107
|
- (Scrounger) Yamaha MusicCast adapter added
|
|
@@ -96,5 +96,8 @@
|
|
|
96
96
|
"Update the datapoints directly": "Aktualisieren Sie die Datenpunkte direkt",
|
|
97
97
|
"Update lists & counts which each statechange of devices": "Aktualisiere Listen und Zählungen, die sich bei jedem Statuswechsel von Geräten ändern",
|
|
98
98
|
"Update datapoints directly": "Datenpunkte direkt aktualisieren",
|
|
99
|
-
"Update lists & counts directly with each statechange of devices": "Aktualisieren Sie Listen und Zählungen direkt bei jedem Zustandswechsel von Geräten"
|
|
99
|
+
"Update lists & counts directly with each statechange of devices": "Aktualisieren Sie Listen und Zählungen direkt bei jedem Zustandswechsel von Geräten",
|
|
100
|
+
"Overview of low battery devices": "Übersicht über schwache Batteriegeräte",
|
|
101
|
+
"Get a regular message with an overview all low battery devices": "Erhalten Sie eine regelmäßige Nachricht mit einer Übersicht aller schwachen Batteriegeräte",
|
|
102
|
+
"From what % battery is considered low": "Ab wie viel % gilt der Akku als schwach"
|
|
100
103
|
}
|
|
@@ -1,96 +1,99 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
2
|
+
"Add own notes, name, etc": "Add own notes, name, etc",
|
|
3
|
+
"Battery message": "Battery message",
|
|
4
|
+
"Choose devices to watch": "Choose devices to watch",
|
|
5
|
+
"Choose if only devices with batteries should be listed or all devices": "Choose if only devices with batteries should be listed or all devices",
|
|
6
|
+
"Choose the Time:": "Choose the Time:",
|
|
7
|
+
"Choose the day(s) where you want to get the message of low battery:": "Choose the day(s) where you want to get the message of low battery:",
|
|
8
|
+
"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:",
|
|
9
|
+
"Choose the priority": "Choose the priority",
|
|
10
|
+
"Choose which devices should be excluded": "Choose which devices should be excluded",
|
|
11
|
+
"Choose your Chat-ID": "Choose your Chat-ID",
|
|
12
|
+
"Choose your device": "Choose your device",
|
|
13
|
+
"Choose your email address": "Choose your email address",
|
|
14
|
+
"Choose your notification services": "Choose your notification services",
|
|
15
|
+
"Choose your recipient": "Choose your recipient",
|
|
16
|
+
"Choose your subject for the Email": "Choose your subject for the Email",
|
|
17
|
+
"Choose your title for Pushmessage": "Choose your title for Pushmessage",
|
|
18
|
+
"Common Notification Settings": "Common Notification Settings",
|
|
19
|
+
"Create additionally HTML lists": "Create additionally HTML lists",
|
|
20
|
+
"Create own folders for each adapter": "Create own folders for each adapter",
|
|
21
|
+
"Create the lists also in HTML": "Create the lists also in HTML",
|
|
22
|
+
"Daily overview of offline devices": "Daily overview of offline devices",
|
|
23
|
+
"Device-ID (optional)": "Device-ID (optional)",
|
|
24
|
+
"Email Instance": "Email Instance",
|
|
25
|
+
"Fri": "Fri",
|
|
26
|
+
"From how much min % would you get a message": "From how much min % would you get a message",
|
|
27
|
+
"Get a message with an overview all offline devices": "Get a message with an overview all offline devices",
|
|
28
|
+
"Get daily an overview with all offline devices": "Get daily an overview with all offline devices",
|
|
29
|
+
"Get message if an device has low battery": "Get message if an device has low battery",
|
|
30
|
+
"Get message if an device is not reachable": "Get message if an device is not reachable",
|
|
31
|
+
"Here you can choose your notification service, you can use more than one service, but you can also leave all blank, then only the datapoint lastNotification will be filled.": "Here you can choose your notification service, you can use more than one service, but you can also leave all blank, then only the datapoint lastNotification will be filled.",
|
|
32
|
+
"Here you can define the offline times of each adapter. If you want to use the data points of the devices (online, available, reachable etc.) directly to determine the status, enter ' 0 '.": "Here you can define the offline times of each adapter. If you want to use the data points of the devices (online, available, reachable etc.) directly to determine the status, enter ' 0 '.",
|
|
33
|
+
"Here you can define the offline times of each adapter. If you want to use the data points of the devices (online, available, reachable etc.) directly to determine the status, enter '-1'.": "Here you can define the offline times of each adapter. If you want to use the data points of the devices (online, available, reachable etc.) directly to determine the status, enter '-1'.",
|
|
34
|
+
"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.",
|
|
35
|
+
"High Priority": "High Priority",
|
|
36
|
+
"If you like to have for every Adapter an own folder with own data": "If you like to have for every Adapter an own folder with own data",
|
|
37
|
+
"Ignor in lists": "Ignor in lists",
|
|
38
|
+
"Ignor in notifications": "Ignor in notifications",
|
|
39
|
+
"Jarvis Instance": "Jarvis Instance",
|
|
40
|
+
"List only devices with batteries": "List only devices with batteries",
|
|
41
|
+
"Lovelace Instance": "Lovelace Instance",
|
|
42
|
+
"Lovelace Notification": "Lovelace Notification",
|
|
43
|
+
"Mon": "Mon",
|
|
44
|
+
"Notification Service": "Notification Service",
|
|
45
|
+
"Notifications": "Notifications",
|
|
46
|
+
"Offline Time": "Offline Time",
|
|
47
|
+
"Offline message": "Offline message",
|
|
48
|
+
"Offline time of Devices": "Offline time of Devices",
|
|
49
|
+
"Other Settings": "Other Settings",
|
|
50
|
+
"Overview of offline devices": "Overview of offline devices",
|
|
51
|
+
"Please choose": "Please choose",
|
|
52
|
+
"Please choose the Whatsapp instance": "Please choose the Whatsapp instance",
|
|
53
|
+
"Please choose the email instance": "Please choose the email instance",
|
|
54
|
+
"Please choose the jarvis instance": "Please choose the jarvis instance",
|
|
55
|
+
"Please choose the lovelace instance": "Please choose the lovelace instance",
|
|
56
|
+
"Please choose the pushover instance": "Please choose the pushover instance",
|
|
57
|
+
"Please choose the telegram instance": "Please choose the telegram instance",
|
|
58
|
+
"Please choose the Synochat instance": "Please choose the Synochat instance",
|
|
59
|
+
"Synochat Instance": "Synochat Instance",
|
|
60
|
+
"Enter the channelname for Synochat": "Enter the channelname for Synochat",
|
|
61
|
+
"Pushover Instance": "Pushover Instance",
|
|
62
|
+
"Recipient (optional)": "Recipient (optional)",
|
|
63
|
+
"Sat": "Sat",
|
|
64
|
+
"Send batterie message": "Send batterie message",
|
|
65
|
+
"Send offline message": "Send offline message",
|
|
66
|
+
"Send to (optional)": "Send to (optional)",
|
|
67
|
+
"Subject (optional)": "Subject (optional)",
|
|
68
|
+
"Sun": "Sun",
|
|
69
|
+
"Telegram Instance": "Telegram Instance",
|
|
70
|
+
"Thu": "Thu",
|
|
71
|
+
"Title (optional)": "Title (optional)",
|
|
72
|
+
"True State": "True State",
|
|
73
|
+
"Tue": "Tue",
|
|
74
|
+
"Update-Interval": "Update-Interval",
|
|
75
|
+
"Use the true state from quality state": "Use the true state from quality state",
|
|
76
|
+
"Use the true value of the signal strength, or it is converted to %": "Use the true value of the signal strength, Or it is converted to %",
|
|
77
|
+
"Wed": "Wed",
|
|
78
|
+
"Whatsapp Instance": "Whatsapp Instance",
|
|
79
|
+
"With confirmation": "With confirmation",
|
|
80
|
+
"device-watcher adapter settings": "Adapter settings for device-watcher",
|
|
81
|
+
"in minutes": "in minutes",
|
|
82
|
+
"in percent": "in percent",
|
|
83
|
+
"Add adapter name in notifcations": "Add adapter name in notifcations",
|
|
84
|
+
"Will add the adaptername from the device": "Will add the adaptername from the device",
|
|
85
|
+
"Adapter update message": "Adapter update message",
|
|
86
|
+
"Receive a message when an update for an adapter is available": "Receive a message when an update for an adapter is available",
|
|
87
|
+
"Device update message": "Device update message",
|
|
88
|
+
"Receive a message when an update for an device is available": "Receive a message when an update for an device is available",
|
|
89
|
+
"Overview of devices with update": "Overview of devices with update",
|
|
90
|
+
"Get a message with an overview all devices with update": "Get a message with an overview of all devices with update",
|
|
91
|
+
"Choose the day(s) where you want to get the overview of update devices:": "Choose the day(s) where you want to get the overview of update devices:",
|
|
92
|
+
"Other Notification Settings": "Other Notification Settings",
|
|
93
|
+
"Update datapoints directly": "Update datapoints directly",
|
|
94
|
+
"Update lists & counts which each statechange of devices": "Update lists & counts which each statechange of devices",
|
|
95
|
+
"Update lists & counts directly with each statechange of devices": "Update lists & counts directly with each statechange of devices",
|
|
96
|
+
"Overview of low battery devices": "Overview of low battery devices",
|
|
97
|
+
"Get a regular message with an overview all low battery devices": "Get a regular message with an overview all low battery devices",
|
|
98
|
+
"From what % battery is considered low": "From what % battery is considered low"
|
|
96
99
|
}
|
|
@@ -96,5 +96,8 @@
|
|
|
96
96
|
"Update the datapoints directly": "Actualizar los puntos de datos directamente",
|
|
97
97
|
"Update lists & counts which each statechange of devices": "Actualizar listas y recuentos en los que cada estado cambia de dispositivos",
|
|
98
98
|
"Update datapoints directly": "Actualizar puntos de datos directamente",
|
|
99
|
-
"Update lists & counts directly with each statechange of devices": "Actualice listas y conteos directamente con cada cambio de estado de los dispositivos"
|
|
99
|
+
"Update lists & counts directly with each statechange of devices": "Actualice listas y conteos directamente con cada cambio de estado de los dispositivos",
|
|
100
|
+
"Overview of low battery devices": "Descripción general de los dispositivos con batería baja",
|
|
101
|
+
"Get a regular message with an overview all low battery devices": "Reciba un mensaje regular con una descripción general de todos los dispositivos con batería baja",
|
|
102
|
+
"From what % battery is considered low": "A partir de qué % de batería se considera bajo"
|
|
100
103
|
}
|
|
@@ -96,5 +96,8 @@
|
|
|
96
96
|
"Update the datapoints directly": "Mettre à jour les points de données directement",
|
|
97
97
|
"Update lists & counts which each statechange of devices": "Mettre à jour les listes et compter chaque changement d'état des appareils",
|
|
98
98
|
"Update datapoints directly": "Mettre à jour directement les points de données",
|
|
99
|
-
"Update lists & counts directly with each statechange of devices": "Mettre à jour les listes et les décomptes directement à chaque changement d'état des appareils"
|
|
99
|
+
"Update lists & counts directly with each statechange of devices": "Mettre à jour les listes et les décomptes directement à chaque changement d'état des appareils",
|
|
100
|
+
"Overview of low battery devices": "Aperçu des appareils à batterie faible",
|
|
101
|
+
"Get a regular message with an overview all low battery devices": "Recevez un message régulier avec un aperçu de tous les appareils à batterie faible",
|
|
102
|
+
"From what % battery is considered low": "A partir de quel % la batterie est considérée comme faible"
|
|
100
103
|
}
|
|
@@ -96,5 +96,8 @@
|
|
|
96
96
|
"Update the datapoints directly": "Aggiorna direttamente i datapoint",
|
|
97
97
|
"Update lists & counts which each statechange of devices": "Aggiorna elenchi e conteggi che ogni stato cambia di dispositivi",
|
|
98
98
|
"Update datapoints directly": "Aggiorna direttamente i datapoint",
|
|
99
|
-
"Update lists & counts directly with each statechange of devices": "Aggiorna elenchi e conteggi direttamente con ogni cambio di stato dei dispositivi"
|
|
99
|
+
"Update lists & counts directly with each statechange of devices": "Aggiorna elenchi e conteggi direttamente con ogni cambio di stato dei dispositivi",
|
|
100
|
+
"Overview of low battery devices": "Panoramica dei dispositivi con batteria scarica",
|
|
101
|
+
"Get a regular message with an overview all low battery devices": "Ricevi un messaggio regolare con una panoramica di tutti i dispositivi con batteria scarica",
|
|
102
|
+
"From what % battery is considered low": "Da quale % la batteria è considerata scarica"
|
|
100
103
|
}
|
|
@@ -96,5 +96,8 @@
|
|
|
96
96
|
"Update the datapoints directly": "Werk de datapunten direct bij",
|
|
97
97
|
"Update lists & counts which each statechange of devices": "Update lijsten & tellingen die elke statusverandering van apparaten",
|
|
98
98
|
"Update datapoints directly": "Update datapunten direct",
|
|
99
|
-
"Update lists & counts directly with each statechange of devices": "Update lijsten en tellingen direct bij elke statusverandering van apparaten"
|
|
99
|
+
"Update lists & counts directly with each statechange of devices": "Update lijsten en tellingen direct bij elke statusverandering van apparaten",
|
|
100
|
+
"Overview of low battery devices": "Overzicht apparaten met bijna lege batterij",
|
|
101
|
+
"Get a regular message with an overview all low battery devices": "Ontvang regelmatig een bericht met een overzicht van alle bijna lege apparaten",
|
|
102
|
+
"From what % battery is considered low": "Van welk % batterij als laag wordt beschouwd"
|
|
100
103
|
}
|
|
@@ -96,5 +96,8 @@
|
|
|
96
96
|
"Update the datapoints directly": "Bezpośrednio aktualizuj punkty danych",
|
|
97
97
|
"Update lists & counts which each statechange of devices": "Aktualizuj listy i liczniki, które powodują każdą zmianę stanu urządzeń",
|
|
98
98
|
"Update datapoints directly": "Aktualizuj punkty danych bezpośrednio",
|
|
99
|
-
"Update lists & counts directly with each statechange of devices": "Aktualizuj listy i liczniki bezpośrednio przy każdej zmianie stanu urządzeń"
|
|
99
|
+
"Update lists & counts directly with each statechange of devices": "Aktualizuj listy i liczniki bezpośrednio przy każdej zmianie stanu urządzeń",
|
|
100
|
+
"Overview of low battery devices": "Przegląd urządzeń o niskim poziomie naładowania baterii",
|
|
101
|
+
"Get a regular message with an overview all low battery devices": "Otrzymuj regularne wiadomości z przeglądem wszystkich urządzeń o niskim poziomie baterii",
|
|
102
|
+
"From what % battery is considered low": "Od jakiego % baterii uważa się za niski"
|
|
100
103
|
}
|
|
@@ -96,5 +96,8 @@
|
|
|
96
96
|
"Update the datapoints directly": "Atualize os pontos de dados diretamente",
|
|
97
97
|
"Update lists & counts which each statechange of devices": "Listas de atualização e conta qual cada mudança de estado dos dispositivos",
|
|
98
98
|
"Update datapoints directly": "Atualizar pontos de dados diretamente",
|
|
99
|
-
"Update lists & counts directly with each statechange of devices": "Atualiza listas e contagens diretamente com cada mudança de estado dos dispositivos"
|
|
99
|
+
"Update lists & counts directly with each statechange of devices": "Atualiza listas e contagens diretamente com cada mudança de estado dos dispositivos",
|
|
100
|
+
"Overview of low battery devices": "Visão geral de dispositivos com bateria fraca",
|
|
101
|
+
"Get a regular message with an overview all low battery devices": "Receba uma mensagem regular com uma visão geral de todos os dispositivos com bateria fraca",
|
|
102
|
+
"From what % battery is considered low": "A partir de que % a bateria é considerada fraca"
|
|
100
103
|
}
|
|
@@ -96,5 +96,8 @@
|
|
|
96
96
|
"Update the datapoints directly": "Обновляйте точки данных напрямую",
|
|
97
97
|
"Update lists & counts which each statechange of devices": "Обновление списков и подсчетов при каждом изменении состояния устройств.",
|
|
98
98
|
"Update datapoints directly": "Обновляйте точки данных напрямую",
|
|
99
|
-
"Update lists & counts directly with each statechange of devices": "Обновляйте списки и счетчики непосредственно при каждом изменении состояния устройств."
|
|
99
|
+
"Update lists & counts directly with each statechange of devices": "Обновляйте списки и счетчики непосредственно при каждом изменении состояния устройств.",
|
|
100
|
+
"Overview of low battery devices": "Обзор устройств с низким зарядом батареи",
|
|
101
|
+
"Get a regular message with an overview all low battery devices": "Получайте регулярное сообщение с обзором всех устройств с низким зарядом батареи",
|
|
102
|
+
"From what % battery is considered low": "С какого % батарея считается разряженной"
|
|
100
103
|
}
|
|
@@ -96,5 +96,8 @@
|
|
|
96
96
|
"Update the datapoints directly": "Оновіть точки даних безпосередньо",
|
|
97
97
|
"Update lists & counts which each statechange of devices": "Оновлення списків і підрахунок кожної зміни стану пристроїв",
|
|
98
98
|
"Update datapoints directly": "Оновіть точки даних безпосередньо",
|
|
99
|
-
"Update lists & counts directly with each statechange of devices": "Оновлюйте списки та підрахунки безпосередньо з кожною зміною стану пристроїв"
|
|
99
|
+
"Update lists & counts directly with each statechange of devices": "Оновлюйте списки та підрахунки безпосередньо з кожною зміною стану пристроїв",
|
|
100
|
+
"Overview of low battery devices": "Огляд розряджених пристроїв",
|
|
101
|
+
"Get a regular message with an overview all low battery devices": "Отримуйте регулярне повідомлення з оглядом усіх пристроїв із розрядженим акумулятором",
|
|
102
|
+
"From what % battery is considered low": "Від якого % батарея вважається розрядженою"
|
|
100
103
|
}
|
|
@@ -96,5 +96,8 @@
|
|
|
96
96
|
"Update the datapoints directly": "直接更新数据点",
|
|
97
97
|
"Update lists & counts which each statechange of devices": "更新设备每次状态变化的列表和计数",
|
|
98
98
|
"Update datapoints directly": "直接更新数据点",
|
|
99
|
-
"Update lists & counts directly with each statechange of devices": "每次设备状态变化时直接更新列表和计数"
|
|
99
|
+
"Update lists & counts directly with each statechange of devices": "每次设备状态变化时直接更新列表和计数",
|
|
100
|
+
"Overview of low battery devices": "低电量设备概述",
|
|
101
|
+
"Get a regular message with an overview all low battery devices": "获取包含所有低电量设备概览的常规消息",
|
|
102
|
+
"From what % battery is considered low": "从什么百分比电池被认为是低"
|
|
100
103
|
}
|
package/admin/jsonConfig.json
CHANGED
|
@@ -116,6 +116,13 @@
|
|
|
116
116
|
"lg": 3,
|
|
117
117
|
"label": "Hue Extended"
|
|
118
118
|
},
|
|
119
|
+
"innogyDevices": {
|
|
120
|
+
"type": "checkbox",
|
|
121
|
+
"sm": 6,
|
|
122
|
+
"md": 6,
|
|
123
|
+
"lg": 3,
|
|
124
|
+
"label": "Innogy Smarthome"
|
|
125
|
+
},
|
|
119
126
|
"jeelinkDevices": {
|
|
120
127
|
"type": "checkbox",
|
|
121
128
|
"sm": 6,
|
|
@@ -1219,6 +1226,18 @@
|
|
|
1219
1226
|
"hidden": "!data.hueExtDevices",
|
|
1220
1227
|
"hideOnlyControl": false
|
|
1221
1228
|
},
|
|
1229
|
+
"innogyMaxMinutes": {
|
|
1230
|
+
"type": "number",
|
|
1231
|
+
"min": 0,
|
|
1232
|
+
"max": 100000,
|
|
1233
|
+
"sm": 6,
|
|
1234
|
+
"md": 6,
|
|
1235
|
+
"lg": 3,
|
|
1236
|
+
"label": "Innogy Smarthome",
|
|
1237
|
+
"help": "in minutes",
|
|
1238
|
+
"hidden": "!data.innogyDevices",
|
|
1239
|
+
"hideOnlyControl": false
|
|
1240
|
+
},
|
|
1222
1241
|
"jeelinkMaxMinutes": {
|
|
1223
1242
|
"type": "number",
|
|
1224
1243
|
"min": 1,
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "device-watcher",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.2",
|
|
5
5
|
"news": {
|
|
6
|
+
"2.2.2": {
|
|
7
|
+
"en": "some translation added\ndatapoints will be written in intervall\nimprovements of lists\nsome other small improvements",
|
|
8
|
+
"de": "einige übersetzung hinzugefügt\ndatenpunkte werden in intervall geschrieben\nverbesserungen der listen\neinige andere kleine verbesserungen",
|
|
9
|
+
"ru": "некоторый перевод добавлен\nдата-точки будут написаны в интервале\nулучшения списков\nнекоторые другие небольшие улучшения",
|
|
10
|
+
"pt": "alguma tradução adicionada\ndatapoints serão escritos em intervalo\nmelhorias das listas\noutras pequenas melhorias",
|
|
11
|
+
"nl": "vertaling:\ndatapoints worden geschreven in intervall\nverbeteringen van lijsten\nandere kleine verbetering",
|
|
12
|
+
"fr": "une traduction ajoutée\nles points de données seront écrits en intervalles\naméliorations des listes\nd'autres petites améliorations",
|
|
13
|
+
"it": "qualche traduzione aggiunta\ni datapoint saranno scritti in intervallo\nmiglioramenti degli elenchi\nalcuni altri piccoli miglioramenti",
|
|
14
|
+
"es": "algo de traducción añadido\ndatapoints se escribirá en intervalol\nmejoras de las listas\nalgunas otras pequeñas mejoras",
|
|
15
|
+
"pl": "w tłumaczeniu dodano również nowe tłumaczenia\npunkty danych są zapisywane w interwałcie\npoprawa list\ndrobne ulepszenia",
|
|
16
|
+
"uk": "додано переклад\nдані будуть написані в інтервалі\nудосконалення переліків\nдеякі інші невеликі поліпшення",
|
|
17
|
+
"zh-cn": "一些翻译\n数据点将在相互间记录。\n改进名单\n其他一些小的改进"
|
|
18
|
+
},
|
|
19
|
+
"2.2.1": {
|
|
20
|
+
"en": "Innogy Smarthome added\nLists for each adapter are working again",
|
|
21
|
+
"de": "Innogy Smarthome hinzugefügt\nListen für jeden Adapter arbeiten wieder",
|
|
22
|
+
"ru": "Innogy Smarthome добавлено\nСписки для каждого адаптера работают снова",
|
|
23
|
+
"pt": "Innogy Smarthome adicionado\nListas para cada adaptador estão funcionando novamente",
|
|
24
|
+
"nl": "Innogy Smarthome toegevoegd\nLeugens voor elke adapter werken weer",
|
|
25
|
+
"fr": "Innogy Smarthome ajouté\nLes listes pour chaque adaptateur fonctionnent à nouveau",
|
|
26
|
+
"it": "Innogy Smarthome aggiunto\nLe liste per ogni adattatore funzionano di nuovo",
|
|
27
|
+
"es": "Innogy Smarthome añadido\nListas para cada adaptador están trabajando de nuevo",
|
|
28
|
+
"pl": "Innogia Smarthome dodała\nLista do każdej adaptacji ponownie działa",
|
|
29
|
+
"uk": "Innogy Smarthome додано\nСписки для кожного адаптера працюють знову",
|
|
30
|
+
"zh-cn": "诺特·萨马尔·罗马\n每个适应人员名单正再次工作。"
|
|
31
|
+
},
|
|
6
32
|
"2.2.0": {
|
|
7
33
|
"en": "Yamaha MusicCast adapter added\nsend update message on state change\ndatapoints and scheduled notification for updateable devices added\nreaction for state changes of battery datapoints added\nsend message and write lists directly if one device has low battery\nsend message and write lists directly if on device is going online or offline",
|
|
8
34
|
"de": "Yamaha Musik Cast Adapter hinzugefügt\naktualisierungsnachricht über zustandsänderung senden\ndatenpunkte und geplante benachrichtigung für aktualisierte geräte hinzugefügt\nreaktion auf zustandsänderungen von batteriedatenpunkten hinzugefügt\nsende nachrichten und schreiblisten direkt, wenn ein gerät einen niedrigen akku hat\nnachrichten und schreiblisten direkt senden, wenn auf dem gerät online oder offline geht",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "Jeśli urządzenie jest offline, ustawia siłę sygnału do 0%\nJeśli urządzenie jest wycinane, ustawiono baterię do '- '\nwyremontowano drobne problemy w listach",
|
|
68
94
|
"uk": "Якщо пристрій вимкнено, встановлюється міцність сигналу на 0%\nЯкщо пристрій вимкнено, встановіть акумулятор до ' - '\nремонт деяких невеликих питань у переліках",
|
|
69
95
|
"zh-cn": "如果装置落空,信号强度达到0%\n如果装置不线,便将电池到该地。\n在名单中修理一些小型问题"
|
|
70
|
-
},
|
|
71
|
-
"2.0.0": {
|
|
72
|
-
"en": "added Lupusec, HS100 adapter, Zigbee2MQTT and MaxCube\nchanged name of Homematic to HM-RPC\nmade a completly makeover of the blacklist\nclean up the code and shorten some",
|
|
73
|
-
"de": "lupusec, HS100 Adapter, Zigbee2MQTT und MaxCube\ngeänderter Name von Homematic zu HM-RPC\naus einem kompletten makeover der blacklist\nden code reinigen und einige verkürzen",
|
|
74
|
-
"ru": "добавлено Lupusec, HS100 адаптер, Zigbee2MQTT и MaxCube\nизменено имя Homematic в HM-RPC\nсделал полный макияж черного списка\nочистить код и сократить некоторые",
|
|
75
|
-
"pt": "adicionado Lupusec, adaptador HS100, Zigbee2MQTT e MaxCube\nnome alterado de Homematic para HM-RPC\nfez uma reforma completa da lista negra\nlimpar o código e encurtar alguns",
|
|
76
|
-
"nl": "voegde Lupusec toe, HS100 adapter, Zigbee2MQT en MaxCube\nveranderde naam van Homema aan HM-RPC\n_\nruim de code op en verklein wat",
|
|
77
|
-
"fr": "lupusec, adaptateur HS100, Zigbee2MQTT et MaxCube\nchangement de nom de Homematic à HM-RPC\nfait un complet de la liste noire\nnettoyer le code et raccourcir certains",
|
|
78
|
-
"it": "aggiunto Lupusec, adattatore HS100, Zigbee2MQTT e MaxCube\ncambiato nome di Homematic a HM-RPC\nreso completo della lista nera\npulire il codice e accorciare alcuni",
|
|
79
|
-
"es": "añadido Lupusec, adaptador HS100, Zigbee2MQTT y MaxCube\ncambio de nombre de Homematic a HM-RPC\nhizo un cambio completly de la lista negra\nlimpiar el código y acortar algunos",
|
|
80
|
-
"pl": "lupusec, adapter HS100, Zigbee2MQTT i MaxCube\nzmienił nazwę Homematic na HM-RPC\nudało się to zrobić zupełnienie czarnej listy\nczyścił kod i skrócił niektóre z nich",
|
|
81
|
-
"uk": "додано Lupusec, HS100 адаптер, Zigbee2MQTT і MaxCube\nзмінено назву Homematic до HM-RPC\nвиготовлений комплетально макіяж чорного списку\nочистити код і скорочувати деякі",
|
|
82
|
-
"zh-cn": "加上Lupusec,HS100适应者,Zigbee2MQTT和MaxCube\n家庭名称改为HM-RPC\n填写黑名单\na. 守则的清理和缩短某些人"
|
|
83
|
-
},
|
|
84
|
-
"1.1.0": {
|
|
85
|
-
"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",
|
|
86
|
-
"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",
|
|
87
|
-
"ru": "удаленный индикатор для ежедневных отправленных сообщений\nизменен селектор для оболочки устройств\nдобавлен адаптер Zigbee2MQTT\nдобавлена функция cron для использования собственного времени для ежедневного обзора сообщений",
|
|
88
|
-
"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",
|
|
89
|
-
"nl": "verwijderde indicatoren voor dagelijks verzonden berichten\nverschoonde selector voor shelly apparaten\nvoegde Zigbee2MQT adapter toe\nvoegde kroonfunctie toe om dagelijks overzicht te gebruiken",
|
|
90
|
-
"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",
|
|
91
|
-
"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",
|
|
92
|
-
"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",
|
|
93
|
-
"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",
|
|
94
|
-
"zh-cn": "d. 每天发出的讯息的清除指标\n炮火装置的选择\n增加Zigbee2MQTT适应人员\nb. 利用自己的时间进行日常概览信息",
|
|
95
|
-
"uk": "видалено індикатор щоденних відправлених повідомлень\nзмінено селектор для пристроїв shelly\nдодано адаптер Zigbee2MQTT\nдодано функцію cron для використання власного часу для щоденних оглядових повідомлень"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
|
@@ -205,6 +205,8 @@
|
|
|
205
205
|
"hueMaxMinutes": 0,
|
|
206
206
|
"hueExtDevices": false,
|
|
207
207
|
"hueextMaxMinutes": 0,
|
|
208
|
+
"innogyDevices": false,
|
|
209
|
+
"innogyMaxMinutes": 0,
|
|
208
210
|
"jeelinkDevices": false,
|
|
209
211
|
"jeelinkMaxMinutes": 300,
|
|
210
212
|
"lupusecDevices": false,
|
|
@@ -306,7 +308,7 @@
|
|
|
306
308
|
"channelSynochat": "",
|
|
307
309
|
"showAdapterNameinMsg": false,
|
|
308
310
|
"tableBlacklist": [],
|
|
309
|
-
"updateinterval":
|
|
311
|
+
"updateinterval": 10,
|
|
310
312
|
"ownDataEditor": [],
|
|
311
313
|
"checkSendDeviceUpgrade": false,
|
|
312
314
|
"checkSendUpgradeMsg": false,
|
package/lib/arrApart.js
CHANGED
|
@@ -133,6 +133,15 @@ const arrApart = {
|
|
|
133
133
|
reach: '.reachable',
|
|
134
134
|
isLowBat: 'none',
|
|
135
135
|
},
|
|
136
|
+
innogy: {
|
|
137
|
+
Selektor: 'innogy-smarthome.*.IsReachable',
|
|
138
|
+
adapterID: 'innogy',
|
|
139
|
+
adapter: 'Innogy Smarthome',
|
|
140
|
+
battery: 'none',
|
|
141
|
+
rssiState: 'none',
|
|
142
|
+
reach: '.IsReachable',
|
|
143
|
+
isLowBat: '.LowBattery',
|
|
144
|
+
},
|
|
136
145
|
jeelink: {
|
|
137
146
|
Selektor: 'jeelink.*.lowBatt',
|
|
138
147
|
adapterID: 'jeelink',
|
package/main.js
CHANGED
|
@@ -68,6 +68,8 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
68
68
|
|
|
69
69
|
try {
|
|
70
70
|
this.listOnlyBattery = this.config.listOnlyBattery;
|
|
71
|
+
this.createOwnFolder = this.config.createOwnFolder;
|
|
72
|
+
this.createHtmlList = this.config.createHtmlList;
|
|
71
73
|
|
|
72
74
|
this.supAdapter = {
|
|
73
75
|
alexa2: this.config.alexa2Devices,
|
|
@@ -85,6 +87,7 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
85
87
|
hs100: this.config.hs100Devices,
|
|
86
88
|
hue: this.config.hueDevices,
|
|
87
89
|
hueExt: this.config.hueExtDevices,
|
|
90
|
+
innogy: this.config.innogyDevices,
|
|
88
91
|
jeelink: this.config.jeelinkDevices,
|
|
89
92
|
lupusec: this.config.lupusecDevices,
|
|
90
93
|
maxcube: this.config.maxcubeDevices,
|
|
@@ -132,6 +135,7 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
132
135
|
hs100: this.config.hs100MaxMinutes,
|
|
133
136
|
hue: this.config.hueMaxMinutes,
|
|
134
137
|
hueExt: this.config.hueextMaxMinutes,
|
|
138
|
+
innogy: this.config.innogyMaxMinutes,
|
|
135
139
|
jeelink: this.config.jeelinkMaxMinutes,
|
|
136
140
|
lupusec: this.config.lupusecMaxMinutes,
|
|
137
141
|
maxcube: this.config.maxcubeMaxMinutes,
|
|
@@ -193,17 +197,13 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
193
197
|
}
|
|
194
198
|
|
|
195
199
|
//create and fill datapoints for each adapter if selected
|
|
196
|
-
if (this.
|
|
200
|
+
if (this.createOwnFolder) {
|
|
197
201
|
try {
|
|
198
202
|
for (const [id] of Object.entries(arrApart)) {
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
this.log.debug(`Created datapoints for ${this.capitalize(id)}`);
|
|
204
|
-
}
|
|
205
|
-
} else {
|
|
206
|
-
return; // cancel run if unloaded was called.
|
|
203
|
+
if (this.supAdapter !== undefined && this.supAdapter[id]) {
|
|
204
|
+
await this.createDPsForEachAdapter(id);
|
|
205
|
+
if (this.createHtmlList) await this.createHtmlListDatapoints(id);
|
|
206
|
+
this.log.debug(`Created datapoints for ${this.capitalize(id)}`);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
} catch (error) {
|
|
@@ -212,7 +212,7 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
// create HTML list
|
|
215
|
-
if (this.
|
|
215
|
+
if (this.createHtmlList) await this.createHtmlListDatapoints();
|
|
216
216
|
|
|
217
217
|
//read data first at start
|
|
218
218
|
await this.main();
|
|
@@ -247,94 +247,79 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
247
247
|
let oldLowBatState;
|
|
248
248
|
let contactData;
|
|
249
249
|
let oldStatus;
|
|
250
|
-
let oldSignalStrength;
|
|
251
250
|
|
|
252
|
-
for (const
|
|
251
|
+
for (const device of this.listAllDevicesRaw) {
|
|
253
252
|
// On statechange update available datapoint
|
|
254
253
|
switch (id) {
|
|
255
|
-
case
|
|
254
|
+
case device.UpdateDP:
|
|
256
255
|
if (state.val) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
await this.writeDatapoints();
|
|
262
|
-
await this.sendDeviceUpdatesNotification(i.Device, i.Adapter, i.Path);
|
|
256
|
+
device.Upgradable = state.val;
|
|
257
|
+
if (!this.blacklistNotify.includes(device.Path)) {
|
|
258
|
+
await this.sendDeviceUpdatesNotification(device.Device, device.Adapter);
|
|
259
|
+
}
|
|
263
260
|
}
|
|
264
261
|
break;
|
|
265
262
|
|
|
266
|
-
case
|
|
267
|
-
|
|
268
|
-
i.SignalStrength = await this.calculateSignalStrength(state, i.adapterID);
|
|
269
|
-
if (oldSignalStrength !== i.SignalStrength) {
|
|
270
|
-
await this.createLists();
|
|
271
|
-
|
|
272
|
-
await this.writeDatapoints();
|
|
273
|
-
}
|
|
263
|
+
case device.SignalStrengthDP:
|
|
264
|
+
device.SignalStrength = await this.calculateSignalStrength(state, device.adapterID);
|
|
274
265
|
break;
|
|
275
266
|
|
|
276
|
-
case
|
|
277
|
-
|
|
278
|
-
|
|
267
|
+
case device.batteryDP:
|
|
268
|
+
if (device.isBatteryDevice) {
|
|
269
|
+
oldLowBatState = device.LowBat;
|
|
270
|
+
batteryData = await this.getBatteryData(state.val, oldLowBatState, device.adapterID);
|
|
279
271
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
272
|
+
device.Battery = batteryData[0];
|
|
273
|
+
device.BatteryRaw = batteryData[2];
|
|
274
|
+
device.LowBat = await this.setLowbatIndicator(state.val, undefined, device.LowBatDP);
|
|
283
275
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
if (this.config.checkSendBatteryMsg) {
|
|
289
|
-
await this.sendLowBatNoticiation(i.Device, i.Adapter, i.Battery, i.Path);
|
|
276
|
+
if (device.LowBat && oldLowBatState !== device.LowBat) {
|
|
277
|
+
if (this.config.checkSendBatteryMsg && !this.blacklistNotify.includes(device.Path)) {
|
|
278
|
+
await this.sendLowBatNoticiation(device.Device, device.Adapter, device.Battery);
|
|
279
|
+
}
|
|
290
280
|
}
|
|
291
|
-
} else if (!i.LowBat && oldLowBatState !== i.LowBat) {
|
|
292
|
-
await this.createLists();
|
|
293
|
-
|
|
294
|
-
await this.writeDatapoints();
|
|
295
281
|
}
|
|
296
282
|
break;
|
|
297
283
|
|
|
298
|
-
case
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
await this.sendLowBatNoticiation(i.Device, i.Adapter, i.Battery, i.Path);
|
|
284
|
+
case device.LowBatDP:
|
|
285
|
+
if (device.isBatteryDevice) {
|
|
286
|
+
oldLowBatState = device.LowBat;
|
|
287
|
+
batteryData = await this.getBatteryData(device.BatteryRaw, state.val, device.adapterID);
|
|
288
|
+
device.Battery = batteryData[0];
|
|
289
|
+
device.BatteryRaw = batteryData[2];
|
|
290
|
+
device.LowBat = await this.setLowbatIndicator(device.BatteryRaw, state.val, device.LowBatDP);
|
|
291
|
+
|
|
292
|
+
if (device.LowBat && oldLowBatState !== device.LowBat) {
|
|
293
|
+
if (this.config.checkSendBatteryMsg && !this.blacklistNotify.includes(device.Path)) {
|
|
294
|
+
await this.sendLowBatNoticiation(device.Device, device.Adapter, device.Battery);
|
|
295
|
+
}
|
|
311
296
|
}
|
|
312
|
-
} else if (!i.LowBat && oldLowBatState !== i.LowBat) {
|
|
313
|
-
await this.createLists();
|
|
314
|
-
|
|
315
|
-
await this.writeDatapoints();
|
|
316
297
|
}
|
|
298
|
+
|
|
317
299
|
break;
|
|
318
|
-
case
|
|
319
|
-
case
|
|
320
|
-
case
|
|
321
|
-
case
|
|
322
|
-
oldStatus =
|
|
323
|
-
|
|
324
|
-
contactData = await this.getOnlineState(
|
|
300
|
+
case device.UnreachDP:
|
|
301
|
+
case device.DeviceStateSelectorDP:
|
|
302
|
+
case device.rssiPeerSelectorDP:
|
|
303
|
+
case device.Path:
|
|
304
|
+
oldStatus = device.Status;
|
|
305
|
+
device.UnreachState = await this.getInitValue(device.UnreachDP);
|
|
306
|
+
contactData = await this.getOnlineState(
|
|
307
|
+
device.Path,
|
|
308
|
+
device.adapterID,
|
|
309
|
+
device.UnreachDP,
|
|
310
|
+
device.SignalStrength,
|
|
311
|
+
device.UnreachState,
|
|
312
|
+
device.DeviceStateSelectorDP,
|
|
313
|
+
device.rssiPeerSelectorDP,
|
|
314
|
+
);
|
|
325
315
|
if (contactData !== undefined) {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
if (i.Status !== oldStatus) {
|
|
331
|
-
await this.createLists();
|
|
332
|
-
|
|
333
|
-
await this.writeDatapoints();
|
|
316
|
+
device.LastContact = contactData[0];
|
|
317
|
+
device.Status = contactData[1];
|
|
318
|
+
device.SignalStrength = contactData[2];
|
|
334
319
|
}
|
|
335
320
|
|
|
336
|
-
if (
|
|
337
|
-
await this.sendOfflineNotifications(
|
|
321
|
+
if (device.Status && oldStatus !== device.Status && this.config.checkSendOfflineMsg && !this.blacklistNotify.includes(device.Path)) {
|
|
322
|
+
await this.sendOfflineNotifications(device.Device, device.Adapter, device.Status, device.LastContact);
|
|
338
323
|
}
|
|
339
324
|
break;
|
|
340
325
|
}
|
|
@@ -384,6 +369,18 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
384
369
|
const nextTimeout = this.config.updateinterval * 1000;
|
|
385
370
|
|
|
386
371
|
await this.checkLastContact();
|
|
372
|
+
await this.createLists();
|
|
373
|
+
await this.writeDatapoints();
|
|
374
|
+
|
|
375
|
+
if (this.createOwnFolder) {
|
|
376
|
+
for (const [id] of Object.entries(arrApart)) {
|
|
377
|
+
if (this.supAdapter !== undefined && this.supAdapter[id]) {
|
|
378
|
+
await this.createLists(id);
|
|
379
|
+
await this.writeDatapoints(id);
|
|
380
|
+
this.log.debug(`Created and filled data for ${this.capitalize(id)}`);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
387
384
|
|
|
388
385
|
// Clear existing timeout
|
|
389
386
|
if (this.refreshDataTimeout) {
|
|
@@ -417,7 +414,7 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
417
414
|
}
|
|
418
415
|
|
|
419
416
|
// fill datapoints for each adapter if selected
|
|
420
|
-
if (this.
|
|
417
|
+
if (this.createOwnFolder) {
|
|
421
418
|
try {
|
|
422
419
|
for (const [id] of Object.entries(arrApart)) {
|
|
423
420
|
if (this.supAdapter !== undefined && this.supAdapter[id]) {
|
|
@@ -780,7 +777,13 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
780
777
|
|
|
781
778
|
/**
|
|
782
779
|
* get online state and time
|
|
783
|
-
*
|
|
780
|
+
* @param {object} id - ID
|
|
781
|
+
* @param {string} adapterID - ID of Adapter
|
|
782
|
+
* @param {string} unreachDP - Datapoint of Unreach
|
|
783
|
+
* @param {object} linkQuality - Linkquality Value
|
|
784
|
+
* @param {object} deviceUnreachState - State of deviceUnreach datapoint
|
|
785
|
+
* @param {string} deviceStateSelectorDP - Selector of device state (like .state)
|
|
786
|
+
* @param {string} rssiPeerSelectorDP - HM RSSI Peer Datapoint
|
|
784
787
|
*/
|
|
785
788
|
async getOnlineState(id, adapterID, unreachDP, linkQuality, deviceUnreachState, deviceStateSelectorDP, rssiPeerSelectorDP) {
|
|
786
789
|
let lastContactString;
|
|
@@ -925,21 +928,27 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
925
928
|
* when was last contact of device
|
|
926
929
|
*/
|
|
927
930
|
async checkLastContact() {
|
|
928
|
-
for (const
|
|
929
|
-
const oldContactState =
|
|
930
|
-
|
|
931
|
-
const contactData = await this.getOnlineState(
|
|
931
|
+
for (const device of this.listAllDevicesRaw) {
|
|
932
|
+
const oldContactState = device.Status;
|
|
933
|
+
device.UnreachState = await this.getInitValue(device.UnreachDP);
|
|
934
|
+
const contactData = await this.getOnlineState(
|
|
935
|
+
device.Path,
|
|
936
|
+
device.adapterID,
|
|
937
|
+
device.UnreachDP,
|
|
938
|
+
device.SignalStrength,
|
|
939
|
+
device.UnreachState,
|
|
940
|
+
device.DeviceStateSelectorDP,
|
|
941
|
+
device.rssiPeerSelectorDP,
|
|
942
|
+
);
|
|
932
943
|
if (contactData !== undefined) {
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
944
|
+
device.LastContact = contactData[0];
|
|
945
|
+
device.Status = contactData[1];
|
|
946
|
+
device.linkQuality = contactData[2];
|
|
936
947
|
}
|
|
937
|
-
if (oldContactState !==
|
|
938
|
-
await this.sendOfflineNotifications(
|
|
948
|
+
if (this.config.checkSendOfflineMsg && oldContactState !== device.Status && !this.blacklistNotify.includes(device.Path)) {
|
|
949
|
+
await this.sendOfflineNotifications(device.Device, device.Adapter, device.Status, device.LastContact);
|
|
939
950
|
}
|
|
940
951
|
}
|
|
941
|
-
await this.createLists();
|
|
942
|
-
await this.writeDatapoints();
|
|
943
952
|
}
|
|
944
953
|
|
|
945
954
|
/**
|
|
@@ -1152,13 +1161,12 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1152
1161
|
return;
|
|
1153
1162
|
}
|
|
1154
1163
|
} // <-- end of loop
|
|
1155
|
-
await this.createLists();
|
|
1156
1164
|
} // <-- end of createData
|
|
1157
1165
|
|
|
1158
1166
|
/**
|
|
1159
1167
|
* Create Lists
|
|
1160
1168
|
*/
|
|
1161
|
-
async createLists() {
|
|
1169
|
+
async createLists(adptName) {
|
|
1162
1170
|
this.linkQualityDevices = [];
|
|
1163
1171
|
this.batteryPowered = [];
|
|
1164
1172
|
this.batteryLowPowered = [];
|
|
@@ -1168,78 +1176,84 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1168
1176
|
this.offlineDevicesRaw = [];
|
|
1169
1177
|
this.upgradableList = [];
|
|
1170
1178
|
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
if (device.LowBat && device.Status !== 'Offline') {
|
|
1175
|
-
this.batteryLowPoweredRaw.push({
|
|
1176
|
-
Path: device.Path,
|
|
1177
|
-
Device: device.Device,
|
|
1178
|
-
Adapter: device.Adapter,
|
|
1179
|
-
Battery: device.Battery,
|
|
1180
|
-
});
|
|
1181
|
-
}
|
|
1182
|
-
// offline raw list
|
|
1183
|
-
if (device.Status === 'Offline') {
|
|
1184
|
-
this.offlineDevicesRaw.push({
|
|
1185
|
-
Path: device.Path,
|
|
1186
|
-
Device: device.Device,
|
|
1187
|
-
Adapter: device.Adapter,
|
|
1188
|
-
'Last contact': device.LastContact,
|
|
1189
|
-
});
|
|
1190
|
-
}
|
|
1179
|
+
if (adptName === undefined) {
|
|
1180
|
+
adptName = '';
|
|
1181
|
+
}
|
|
1191
1182
|
|
|
1192
|
-
|
|
1193
|
-
if (
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
Adapter: device.Adapter,
|
|
1197
|
-
Battery: device.Battery,
|
|
1198
|
-
'Signal strength': device.SignalStrength,
|
|
1199
|
-
'Last contact': device.LastContact,
|
|
1200
|
-
Status: device.Status,
|
|
1201
|
-
});
|
|
1202
|
-
// LinkQuality lists
|
|
1203
|
-
if (device.SignalStrength != ' - ') {
|
|
1204
|
-
this.linkQualityDevices.push({
|
|
1205
|
-
Device: device.Device,
|
|
1206
|
-
Adapter: device.Adapter,
|
|
1207
|
-
'Signal strength': device.SignalStrength,
|
|
1208
|
-
});
|
|
1209
|
-
}
|
|
1210
|
-
// Battery lists
|
|
1211
|
-
if (device['isBatteryDevice']) {
|
|
1212
|
-
this.batteryPowered.push({
|
|
1213
|
-
Device: device.Device,
|
|
1214
|
-
Adapter: device.Adapter,
|
|
1215
|
-
Battery: device.Battery,
|
|
1216
|
-
Status: device.Status,
|
|
1217
|
-
});
|
|
1218
|
-
}
|
|
1219
|
-
// Low Bat lists
|
|
1183
|
+
for (const device of this.listAllDevicesRaw) {
|
|
1184
|
+
if (device.adapterID.includes(adptName)) {
|
|
1185
|
+
/*---------- fill raw lists ----------*/
|
|
1186
|
+
// low bat list
|
|
1220
1187
|
if (device.LowBat && device.Status !== 'Offline') {
|
|
1221
|
-
this.
|
|
1188
|
+
this.batteryLowPoweredRaw.push({
|
|
1189
|
+
Path: device.Path,
|
|
1222
1190
|
Device: device.Device,
|
|
1223
1191
|
Adapter: device.Adapter,
|
|
1224
1192
|
Battery: device.Battery,
|
|
1225
1193
|
});
|
|
1226
1194
|
}
|
|
1227
|
-
|
|
1228
|
-
// Offline List
|
|
1195
|
+
// offline raw list
|
|
1229
1196
|
if (device.Status === 'Offline') {
|
|
1230
|
-
this.
|
|
1197
|
+
this.offlineDevicesRaw.push({
|
|
1198
|
+
Path: device.Path,
|
|
1231
1199
|
Device: device.Device,
|
|
1232
1200
|
Adapter: device.Adapter,
|
|
1233
1201
|
'Last contact': device.LastContact,
|
|
1234
1202
|
});
|
|
1235
1203
|
}
|
|
1236
1204
|
|
|
1237
|
-
|
|
1238
|
-
if (device.
|
|
1239
|
-
this.
|
|
1205
|
+
/*---------- fill user lists ----------*/
|
|
1206
|
+
if (!this.blacklistLists.includes(device.Path)) {
|
|
1207
|
+
this.listAllDevices.push({
|
|
1240
1208
|
Device: device.Device,
|
|
1241
1209
|
Adapter: device.Adapter,
|
|
1210
|
+
Battery: device.Battery,
|
|
1211
|
+
'Signal strength': device.SignalStrength,
|
|
1212
|
+
'Last contact': device.LastContact,
|
|
1213
|
+
Status: device.Status,
|
|
1242
1214
|
});
|
|
1215
|
+
// LinkQuality lists
|
|
1216
|
+
if (device.SignalStrength != ' - ') {
|
|
1217
|
+
this.linkQualityDevices.push({
|
|
1218
|
+
Device: device.Device,
|
|
1219
|
+
Adapter: device.Adapter,
|
|
1220
|
+
'Signal strength': device.SignalStrength,
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1223
|
+
// Battery lists
|
|
1224
|
+
if (device['isBatteryDevice']) {
|
|
1225
|
+
this.batteryPowered.push({
|
|
1226
|
+
Device: device.Device,
|
|
1227
|
+
Adapter: device.Adapter,
|
|
1228
|
+
Battery: device.Battery,
|
|
1229
|
+
Status: device.Status,
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1232
|
+
// Low Bat lists
|
|
1233
|
+
if (device.LowBat && device.Status !== 'Offline') {
|
|
1234
|
+
this.batteryLowPowered.push({
|
|
1235
|
+
Device: device.Device,
|
|
1236
|
+
Adapter: device.Adapter,
|
|
1237
|
+
Battery: device.Battery,
|
|
1238
|
+
});
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
// Offline List
|
|
1242
|
+
if (device.Status === 'Offline') {
|
|
1243
|
+
this.offlineDevices.push({
|
|
1244
|
+
Device: device.Device,
|
|
1245
|
+
Adapter: device.Adapter,
|
|
1246
|
+
'Last contact': device.LastContact,
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
// Device update List
|
|
1251
|
+
if (device.Upgradable) {
|
|
1252
|
+
this.upgradableList.push({
|
|
1253
|
+
Device: device.Device,
|
|
1254
|
+
Adapter: device.Adapter,
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1243
1257
|
}
|
|
1244
1258
|
}
|
|
1245
1259
|
}
|
|
@@ -1267,11 +1281,6 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1267
1281
|
|
|
1268
1282
|
// Count how many devices has update available
|
|
1269
1283
|
this.upgradableDevicesCount = this.upgradableList.length;
|
|
1270
|
-
|
|
1271
|
-
// raws
|
|
1272
|
-
|
|
1273
|
-
// Count how many devcies are offline
|
|
1274
|
-
this.offlineDevicesCountRaw = this.offlineDevicesRaw.length;
|
|
1275
1284
|
}
|
|
1276
1285
|
|
|
1277
1286
|
/**
|
|
@@ -1281,17 +1290,13 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1281
1290
|
// create Data for each Adapter in own lists
|
|
1282
1291
|
this.log.debug(`Function started: ${this.createDataForEachAdapter.name}`);
|
|
1283
1292
|
|
|
1284
|
-
await this.resetVars(); // reset the arrays and counts
|
|
1285
|
-
|
|
1286
1293
|
try {
|
|
1287
|
-
for (const
|
|
1288
|
-
if (
|
|
1294
|
+
for (const device of this.listAllDevicesRaw) {
|
|
1295
|
+
if (device.adapterID.includes(adptName)) {
|
|
1289
1296
|
// list device only if selected adapter matched with device
|
|
1290
|
-
await this.createLists();
|
|
1291
|
-
await this.writeDatapoints();
|
|
1297
|
+
await this.createLists(adptName);
|
|
1292
1298
|
}
|
|
1293
1299
|
}
|
|
1294
|
-
|
|
1295
1300
|
await this.writeDatapoints(adptName); // fill the datapoints
|
|
1296
1301
|
} catch (error) {
|
|
1297
1302
|
this.errorReporting('[createDataForEachAdapter]', error);
|
|
@@ -1307,10 +1312,9 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1307
1312
|
this.log.debug(`Function started: ${this.createDataOfAllAdapter.name}`);
|
|
1308
1313
|
|
|
1309
1314
|
try {
|
|
1310
|
-
await this.resetVars(); // reset the arrays and counts
|
|
1311
|
-
|
|
1312
1315
|
for (let i = 0; i < this.arrDev.length; i++) {
|
|
1313
1316
|
await this.createData(i);
|
|
1317
|
+
await this.createLists();
|
|
1314
1318
|
}
|
|
1315
1319
|
await this.writeDatapoints(); // fill the datapoints
|
|
1316
1320
|
} catch (error) {
|
|
@@ -1525,21 +1529,18 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1525
1529
|
* @param {string} deviceName
|
|
1526
1530
|
* @param {string} adapter
|
|
1527
1531
|
* @param {string} battery
|
|
1528
|
-
* @param {string} devicePath
|
|
1529
1532
|
**/
|
|
1530
|
-
async sendLowBatNoticiation(deviceName, adapter, battery
|
|
1533
|
+
async sendLowBatNoticiation(deviceName, adapter, battery) {
|
|
1531
1534
|
this.log.debug(`Start the function: ${this.sendLowBatNoticiation.name}`);
|
|
1532
1535
|
|
|
1533
1536
|
try {
|
|
1534
1537
|
let msg = '';
|
|
1535
1538
|
let deviceList = '';
|
|
1536
1539
|
|
|
1537
|
-
if (!this.
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
}
|
|
1541
|
-
deviceList = `${deviceList}\n${adapter}: ${deviceName} (${battery})`;
|
|
1542
|
-
}
|
|
1540
|
+
if (!this.config.showAdapterNameinMsg) {
|
|
1541
|
+
deviceList = `${deviceList}\n${deviceName} (${battery})`;
|
|
1542
|
+
} else {
|
|
1543
|
+
deviceList = `${deviceList}\n${adapter}: ${deviceName} (${battery})`;
|
|
1543
1544
|
}
|
|
1544
1545
|
msg = `Gerät mit geringer Batterie erkannt: \n`;
|
|
1545
1546
|
|
|
@@ -1554,21 +1555,24 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1554
1555
|
|
|
1555
1556
|
/**
|
|
1556
1557
|
* send message if an device is offline
|
|
1558
|
+
* @param {string} deviceName
|
|
1559
|
+
* @param {string} adapter
|
|
1560
|
+
* @param {string} status
|
|
1561
|
+
* @param {string} lastContact
|
|
1557
1562
|
*/
|
|
1558
|
-
async sendOfflineNotifications(deviceName, adapter, status, lastContact
|
|
1563
|
+
async sendOfflineNotifications(deviceName, adapter, status, lastContact) {
|
|
1559
1564
|
this.log.debug(`Start the function: ${this.sendOfflineNotifications.name}`);
|
|
1560
1565
|
|
|
1561
1566
|
try {
|
|
1562
1567
|
let msg = '';
|
|
1563
1568
|
let deviceList = '';
|
|
1564
1569
|
|
|
1565
|
-
if (!this.
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
}
|
|
1569
|
-
deviceList = `${deviceList}\n${adapter}: ${deviceName} (${lastContact})`;
|
|
1570
|
-
}
|
|
1570
|
+
if (!this.config.showAdapterNameinMsg) {
|
|
1571
|
+
deviceList = `${deviceList}\n${deviceName} (${lastContact})`;
|
|
1572
|
+
} else {
|
|
1573
|
+
deviceList = `${deviceList}\n${adapter}: ${deviceName} (${lastContact})`;
|
|
1571
1574
|
}
|
|
1575
|
+
|
|
1572
1576
|
if (status === 'Online') {
|
|
1573
1577
|
// make singular if it is only one device
|
|
1574
1578
|
msg = 'Folgendes Gerät ist wieder erreichbar: \n';
|
|
@@ -1644,22 +1648,20 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1644
1648
|
* check if device updates are available and send notification
|
|
1645
1649
|
* @param {string} deviceName
|
|
1646
1650
|
* @param {string} adapter
|
|
1647
|
-
* @param {string} devicePath
|
|
1648
1651
|
**/
|
|
1649
|
-
async sendDeviceUpdatesNotification(deviceName, adapter
|
|
1652
|
+
async sendDeviceUpdatesNotification(deviceName, adapter) {
|
|
1650
1653
|
this.log.debug(`Start the function: ${this.sendDeviceUpdatesNotification.name}`);
|
|
1651
1654
|
|
|
1652
1655
|
try {
|
|
1653
1656
|
let msg = '';
|
|
1654
1657
|
let deviceList = '';
|
|
1655
1658
|
|
|
1656
|
-
if (!this.
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
deviceList = `${deviceList}\n${adapter}: ${deviceName}`;
|
|
1661
|
-
}
|
|
1659
|
+
if (!this.config.showAdapterNameinMsg) {
|
|
1660
|
+
deviceList = `${deviceList}\n${deviceName}`;
|
|
1661
|
+
} else {
|
|
1662
|
+
deviceList = `${deviceList}\n${adapter}: ${deviceName}`;
|
|
1662
1663
|
}
|
|
1664
|
+
|
|
1663
1665
|
msg = `Neue Geräte Updates vorhanden: \n`;
|
|
1664
1666
|
|
|
1665
1667
|
this.log.info(msg + deviceList);
|
|
@@ -1725,36 +1727,6 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1725
1727
|
}
|
|
1726
1728
|
} //<--End of daily offline notification
|
|
1727
1729
|
|
|
1728
|
-
/**
|
|
1729
|
-
* reset arrays and counts
|
|
1730
|
-
*/
|
|
1731
|
-
async resetVars() {
|
|
1732
|
-
//Reset all arrays and counts
|
|
1733
|
-
this.log.debug(`Function started: ${this.resetVars.name}`);
|
|
1734
|
-
|
|
1735
|
-
// arrays
|
|
1736
|
-
this.offlineDevices = [];
|
|
1737
|
-
this.linkQualityDevices = [];
|
|
1738
|
-
this.batteryPowered = [];
|
|
1739
|
-
this.batteryLowPowered = [];
|
|
1740
|
-
this.listAllDevices = [];
|
|
1741
|
-
//this.listAllDevicesRaw = [];
|
|
1742
|
-
|
|
1743
|
-
// raws
|
|
1744
|
-
this.batteryLowPoweredRaw = [];
|
|
1745
|
-
this.offlineDevicesRaw = [];
|
|
1746
|
-
|
|
1747
|
-
// counts
|
|
1748
|
-
this.offlineDevicesCount = 0;
|
|
1749
|
-
this.deviceCounter = 0;
|
|
1750
|
-
this.linkQualityCount = 0;
|
|
1751
|
-
this.batteryPoweredCount = 0;
|
|
1752
|
-
this.lowBatteryPoweredCount = 0;
|
|
1753
|
-
this.upgradableDevicesCount = 0;
|
|
1754
|
-
|
|
1755
|
-
this.log.debug(`Function finished: ${this.resetVars.name}`);
|
|
1756
|
-
} // <-- end of resetVars
|
|
1757
|
-
|
|
1758
1730
|
/**
|
|
1759
1731
|
* @param {string} [adptName] - Adaptername
|
|
1760
1732
|
*/
|
|
@@ -1835,7 +1807,7 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1835
1807
|
});
|
|
1836
1808
|
|
|
1837
1809
|
//write HTML list
|
|
1838
|
-
if (this.
|
|
1810
|
+
if (this.createHtmlList) {
|
|
1839
1811
|
await this.setStateAsync(`${dpSubFolder}linkQualityListHTML`, {
|
|
1840
1812
|
val: await this.creatLinkQualityListHTML(this.linkQualityDevices, this.linkQualityCount),
|
|
1841
1813
|
ack: true,
|