iobroker.device-watcher 2.9.5 → 2.9.7
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 +13 -1
- package/admin/i18n/de/translations.json +2 -1
- package/admin/images/noti_push.jpeg +0 -0
- package/admin/images/noti_push2.jpeg +0 -0
- package/admin/jsonConfig.json5 +2405 -0
- package/admin/words.js +1 -1
- package/io-package.json +859 -833
- package/lib/arrApart.js +24 -0
- package/main.js +29 -23
- package/package.json +2 -4
- package/admin/jsonConfig.json +0 -2370
package/lib/arrApart.js
CHANGED
|
@@ -541,6 +541,18 @@ const arrApart = {
|
|
|
541
541
|
isLowBat: 'none',
|
|
542
542
|
id: 'none',
|
|
543
543
|
},
|
|
544
|
+
tuya: {
|
|
545
|
+
Selektor: 'tuya.*.online',
|
|
546
|
+
timeSelector: '.online',
|
|
547
|
+
adapterID: 'tuya',
|
|
548
|
+
adapter: 'Tuya',
|
|
549
|
+
rssiState: 'none',
|
|
550
|
+
battery: 'none',
|
|
551
|
+
reach: '.online',
|
|
552
|
+
isLowBat: 'none',
|
|
553
|
+
id: 'none',
|
|
554
|
+
upgrade: 'none',
|
|
555
|
+
},
|
|
544
556
|
unifi: {
|
|
545
557
|
Selektor: 'unifi.*.state',
|
|
546
558
|
timeSelector: '.uptime',
|
|
@@ -564,6 +576,18 @@ const arrApart = {
|
|
|
564
576
|
id: 'none',
|
|
565
577
|
upgrade: 'none',
|
|
566
578
|
},
|
|
579
|
+
wifilight: {
|
|
580
|
+
Selektor: 'wifilight.*.reachable',
|
|
581
|
+
timeSelector: '.reachable',
|
|
582
|
+
adapterID: 'wifilight',
|
|
583
|
+
adapter: 'Wifilight',
|
|
584
|
+
rssiState: 'none',
|
|
585
|
+
battery: 'none',
|
|
586
|
+
reach: '.reachable',
|
|
587
|
+
isLowBat: 'none',
|
|
588
|
+
id: 'none',
|
|
589
|
+
upgrade: 'none',
|
|
590
|
+
},
|
|
567
591
|
wled: {
|
|
568
592
|
Selektor: 'wled.*._online',
|
|
569
593
|
timeSelector: '._online',
|
package/main.js
CHANGED
|
@@ -147,8 +147,10 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
147
147
|
tado: this.config.tadoDevices,
|
|
148
148
|
tapo: this.config.tapoDevices,
|
|
149
149
|
tradfri: this.config.tradfriDevices,
|
|
150
|
+
tuya: this.config.tuyaDevices,
|
|
150
151
|
unifi: this.config.unifiDevices,
|
|
151
152
|
viessmann: this.config.viessmannDevices,
|
|
153
|
+
wifilight: this.config.wifilightDevices,
|
|
152
154
|
wled: this.config.wledDevices,
|
|
153
155
|
yeelight: this.config.yeelightDevices,
|
|
154
156
|
zigbee: this.config.zigbeeDevices,
|
|
@@ -206,8 +208,10 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
206
208
|
tado: this.config.tadoMaxMinutes,
|
|
207
209
|
tapo: this.config.tapoMaxMinutes,
|
|
208
210
|
tradfri: this.config.tradfriMaxMinutes,
|
|
211
|
+
tuya: this.config.tuyaMaxMinutes,
|
|
209
212
|
unifi: this.config.unifiMaxMinutes,
|
|
210
213
|
viessmann: this.config.viessmannMaxMinutes,
|
|
214
|
+
wifilight: this.config.wifilightMaxMinutes,
|
|
211
215
|
wled: this.config.wledMaxMinutes,
|
|
212
216
|
yeelight: this.config.yeelightMaxMinutes,
|
|
213
217
|
zigbee: this.config.zigbeeMaxMinutes,
|
|
@@ -368,7 +372,6 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
368
372
|
* @param {ioBroker.State | null | undefined} state
|
|
369
373
|
*/
|
|
370
374
|
async onStateChange(id, state) {
|
|
371
|
-
// Admin JSON for Adapter updates
|
|
372
375
|
if (state) {
|
|
373
376
|
// this.log.debug(`State changed: ${id} changed ${state.val}`);
|
|
374
377
|
let batteryData;
|
|
@@ -524,30 +527,32 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
524
527
|
|
|
525
528
|
// device unreach
|
|
526
529
|
case deviceData.UnreachDP:
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
if (
|
|
545
|
-
|
|
546
|
-
|
|
530
|
+
if (deviceData.UnreachState !== state.val) {
|
|
531
|
+
oldStatus = deviceData.Status;
|
|
532
|
+
deviceData.UnreachState = state.val;
|
|
533
|
+
contactData = await this.getOnlineState(
|
|
534
|
+
deviceData.timeSelector,
|
|
535
|
+
deviceData.adapterID,
|
|
536
|
+
deviceData.UnreachDP,
|
|
537
|
+
deviceData.SignalStrength,
|
|
538
|
+
deviceData.UnreachState,
|
|
539
|
+
deviceData.DeviceStateSelectorDP,
|
|
540
|
+
deviceData.rssiPeerSelectorDP,
|
|
541
|
+
);
|
|
542
|
+
if (contactData !== undefined) {
|
|
543
|
+
deviceData.LastContact = contactData[0];
|
|
544
|
+
deviceData.Status = contactData[1];
|
|
545
|
+
deviceData.SignalStrength = contactData[2];
|
|
546
|
+
}
|
|
547
|
+
if (this.config.checkSendOfflineMsg && oldStatus !== deviceData.Status && !this.blacklistNotify.includes(deviceData.Path)) {
|
|
548
|
+
if (deviceData.instanceDeviceConnectionDP.val !== undefined) {
|
|
549
|
+
// check if the generally deviceData connected state is for a while true
|
|
550
|
+
if (await this.getTimestampConnectionDP(deviceData.instanceDeviceConnectionDP, 20000)) {
|
|
551
|
+
await this.sendStateNotifications('onlineStateDevice', device);
|
|
552
|
+
}
|
|
553
|
+
} else {
|
|
547
554
|
await this.sendStateNotifications('onlineStateDevice', device);
|
|
548
555
|
}
|
|
549
|
-
} else {
|
|
550
|
-
await this.sendStateNotifications('onlineStateDevice', device);
|
|
551
556
|
}
|
|
552
557
|
}
|
|
553
558
|
break;
|
|
@@ -1139,6 +1144,7 @@ class DeviceWatcher extends utils.Adapter {
|
|
|
1139
1144
|
|
|
1140
1145
|
//Get ID of foldername
|
|
1141
1146
|
case 'tado':
|
|
1147
|
+
case 'wifilight':
|
|
1142
1148
|
deviceName = currDeviceString.slice(currDeviceString.lastIndexOf('.') + 1);
|
|
1143
1149
|
break;
|
|
1144
1150
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.device-watcher",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.7",
|
|
4
4
|
"description": "Watchdog for devices",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Christian Behrends",
|
|
@@ -58,10 +58,8 @@
|
|
|
58
58
|
},
|
|
59
59
|
"main": "main.js",
|
|
60
60
|
"files": [
|
|
61
|
-
"admin
|
|
62
|
-
"admin{,/!(src)/**}/*.{html,css,png,svg,jpg,js}",
|
|
61
|
+
"admin/",
|
|
63
62
|
"lib/",
|
|
64
|
-
"www/",
|
|
65
63
|
"io-package.json",
|
|
66
64
|
"LICENSE",
|
|
67
65
|
"main.js"
|