hoffmation-base 2.19.1 → 2.19.4
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/lib/models/deviceSettings/cameraSettings.d.ts +1 -0
- package/lib/models/deviceSettings/cameraSettings.js +4 -2
- package/lib/server/devices/blueIris/cameraDevice.d.ts +6 -0
- package/lib/server/devices/blueIris/cameraDevice.js +38 -0
- package/lib/server/devices/dachs/dachs.d.ts +5 -2
- package/lib/server/devices/dachs/dachs.js +11 -4
- package/lib/server/devices/dachs/{dachsWarmWaterTemperature.d.ts → dachsTemperatureSensor.d.ts} +2 -2
- package/lib/server/devices/dachs/{dachsWarmWaterTemperature.js → dachsTemperatureSensor.js} +8 -8
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import { MotionSensorSettings } from './motionSensorSettings';
|
|
|
2
2
|
export declare class CameraSettings extends MotionSensorSettings {
|
|
3
3
|
alertPersonOnTelegram: boolean;
|
|
4
4
|
movementDetectionOnPersonOnly: boolean;
|
|
5
|
+
movementDetectionOnDogsToo: boolean;
|
|
5
6
|
hasAudio: boolean;
|
|
6
7
|
fromPartialObject(data: Partial<CameraSettings>): void;
|
|
7
8
|
protected toJSON(): Partial<MotionSensorSettings>;
|
|
@@ -8,13 +8,15 @@ class CameraSettings extends motionSensorSettings_1.MotionSensorSettings {
|
|
|
8
8
|
super(...arguments);
|
|
9
9
|
this.alertPersonOnTelegram = false;
|
|
10
10
|
this.movementDetectionOnPersonOnly = false;
|
|
11
|
+
this.movementDetectionOnDogsToo = false;
|
|
11
12
|
this.hasAudio = false;
|
|
12
13
|
}
|
|
13
14
|
fromPartialObject(data) {
|
|
14
|
-
var _a, _b, _c;
|
|
15
|
+
var _a, _b, _c, _d;
|
|
15
16
|
this.alertPersonOnTelegram = (_a = data.alertPersonOnTelegram) !== null && _a !== void 0 ? _a : this.alertPersonOnTelegram;
|
|
16
17
|
this.movementDetectionOnPersonOnly = (_b = data.movementDetectionOnPersonOnly) !== null && _b !== void 0 ? _b : this.movementDetectionOnPersonOnly;
|
|
17
|
-
this.
|
|
18
|
+
this.movementDetectionOnDogsToo = (_c = data.movementDetectionOnDogsToo) !== null && _c !== void 0 ? _c : this.movementDetectionOnDogsToo;
|
|
19
|
+
this.hasAudio = (_d = data.hasAudio) !== null && _d !== void 0 ? _d : this.hasAudio;
|
|
18
20
|
super.fromPartialObject(data);
|
|
19
21
|
}
|
|
20
22
|
toJSON() {
|
|
@@ -8,7 +8,9 @@ export declare class CameraDevice implements iCameraDevice {
|
|
|
8
8
|
readonly blueIrisName: string;
|
|
9
9
|
private _personDetectFallbackTimeout;
|
|
10
10
|
private _movementDetectFallbackTimeout;
|
|
11
|
+
private _dogDetectFallbackTimeout;
|
|
11
12
|
private _personDetectedStateId;
|
|
13
|
+
private _dogDetectedStateId;
|
|
12
14
|
private _movementDetectedStateId;
|
|
13
15
|
get lastImage(): string;
|
|
14
16
|
settings: CameraSettings;
|
|
@@ -20,12 +22,15 @@ export declare class CameraDevice implements iCameraDevice {
|
|
|
20
22
|
private _movementDetectedCallback;
|
|
21
23
|
private _lastImage;
|
|
22
24
|
private _personDetected;
|
|
25
|
+
private _dogDetected;
|
|
23
26
|
private _alarmGriffBlockCount;
|
|
24
27
|
private _alarmBlockedByGriffTimeStamp;
|
|
25
28
|
readonly mpegStreamLink: string;
|
|
26
29
|
readonly h264IosStreamLink: string;
|
|
27
30
|
readonly rtspStreamLink: string;
|
|
28
31
|
readonly currentImageLink: string;
|
|
32
|
+
get dogDetected(): boolean;
|
|
33
|
+
get personDetected(): boolean;
|
|
29
34
|
get alarmBlockedByGriffTimeStamp(): number;
|
|
30
35
|
get alarmBlockedByGriff(): boolean;
|
|
31
36
|
constructor(mqttName: string, roomName: string, blueIrisName: string);
|
|
@@ -59,5 +64,6 @@ export declare class CameraDevice implements iCameraDevice {
|
|
|
59
64
|
persistDeviceInfo(): void;
|
|
60
65
|
loadDeviceSettings(): void;
|
|
61
66
|
private resetPersonDetectFallbackTimer;
|
|
67
|
+
private resetDogDetectFallbackTimer;
|
|
62
68
|
private resetMovementFallbackTimer;
|
|
63
69
|
}
|
|
@@ -17,6 +17,12 @@ class CameraDevice {
|
|
|
17
17
|
get lastImage() {
|
|
18
18
|
return this._lastImage;
|
|
19
19
|
}
|
|
20
|
+
get dogDetected() {
|
|
21
|
+
return this._dogDetected;
|
|
22
|
+
}
|
|
23
|
+
get personDetected() {
|
|
24
|
+
return this._personDetected;
|
|
25
|
+
}
|
|
20
26
|
get alarmBlockedByGriffTimeStamp() {
|
|
21
27
|
return this._alarmBlockedByGriffTimeStamp;
|
|
22
28
|
}
|
|
@@ -27,7 +33,9 @@ class CameraDevice {
|
|
|
27
33
|
var _a;
|
|
28
34
|
this._personDetectFallbackTimeout = null;
|
|
29
35
|
this._movementDetectFallbackTimeout = null;
|
|
36
|
+
this._dogDetectFallbackTimeout = null;
|
|
30
37
|
this._personDetectedStateId = undefined;
|
|
38
|
+
this._dogDetectedStateId = undefined;
|
|
31
39
|
this._movementDetectedStateId = undefined;
|
|
32
40
|
this.settings = new models_1.CameraSettings();
|
|
33
41
|
this.deviceCapabilities = [DeviceCapability_1.DeviceCapability.camera, DeviceCapability_1.DeviceCapability.motionSensor];
|
|
@@ -37,6 +45,7 @@ class CameraDevice {
|
|
|
37
45
|
this._movementDetectedCallback = [];
|
|
38
46
|
this._lastImage = '';
|
|
39
47
|
this._personDetected = false;
|
|
48
|
+
this._dogDetected = false;
|
|
40
49
|
this._alarmGriffBlockCount = 0;
|
|
41
50
|
this._alarmBlockedByGriffTimeStamp = 0;
|
|
42
51
|
this.mpegStreamLink = '';
|
|
@@ -158,6 +167,18 @@ class CameraDevice {
|
|
|
158
167
|
this.updateMovement(newValue);
|
|
159
168
|
}
|
|
160
169
|
break;
|
|
170
|
+
case 'DogDetected':
|
|
171
|
+
this._dogDetectedStateId = idSplit.join('.');
|
|
172
|
+
const newDogDetectionVal = state.val === 1;
|
|
173
|
+
if (newDogDetectionVal) {
|
|
174
|
+
this.log(models_1.LogLevel.Info, `Dog Detected`);
|
|
175
|
+
this.resetDogDetectFallbackTimer();
|
|
176
|
+
}
|
|
177
|
+
this._dogDetected = newDogDetectionVal;
|
|
178
|
+
if (this.settings.movementDetectionOnDogsToo) {
|
|
179
|
+
this.updateMovement(newDogDetectionVal);
|
|
180
|
+
}
|
|
181
|
+
break;
|
|
161
182
|
case 'MotionSnapshot':
|
|
162
183
|
this._lastImage = state.val;
|
|
163
184
|
services_1.Utils.guardedTimeout(() => {
|
|
@@ -234,6 +255,23 @@ class CameraDevice {
|
|
|
234
255
|
}
|
|
235
256
|
}, 120000, this);
|
|
236
257
|
}
|
|
258
|
+
resetDogDetectFallbackTimer() {
|
|
259
|
+
if (this._dogDetectFallbackTimeout !== null) {
|
|
260
|
+
clearTimeout(this._dogDetectFallbackTimeout);
|
|
261
|
+
this._dogDetectFallbackTimeout = null;
|
|
262
|
+
}
|
|
263
|
+
this._dogDetectFallbackTimeout = services_1.Utils.guardedTimeout(() => {
|
|
264
|
+
var _a;
|
|
265
|
+
this._dogDetectFallbackTimeout = null;
|
|
266
|
+
this._dogDetected = false;
|
|
267
|
+
if (this.settings.movementDetectionOnDogsToo) {
|
|
268
|
+
this.updateMovement(false);
|
|
269
|
+
}
|
|
270
|
+
if (this._dogDetectedStateId !== undefined) {
|
|
271
|
+
(_a = ioBroker_1.ioBrokerMain.iOConnection) === null || _a === void 0 ? void 0 : _a.setState(this._dogDetectedStateId, { val: 0, ack: true });
|
|
272
|
+
}
|
|
273
|
+
}, 120000, this);
|
|
274
|
+
}
|
|
237
275
|
resetMovementFallbackTimer() {
|
|
238
276
|
if (this._movementDetectFallbackTimeout !== null) {
|
|
239
277
|
clearTimeout(this._movementDetectFallbackTimeout);
|
|
@@ -5,21 +5,24 @@ import { LogDebugType, OwnSonosDevice } from '../../services';
|
|
|
5
5
|
import { iDachsSettings } from '../../config/iDachsSettings';
|
|
6
6
|
import { DachsDeviceSettings } from '../../../models/deviceSettings/dachsSettings';
|
|
7
7
|
import { iFlattenedCompleteResponse } from './interfaces';
|
|
8
|
-
import {
|
|
8
|
+
import { DachsTemperatureSensor } from './dachsTemperatureSensor';
|
|
9
9
|
export declare class Dachs implements iBaseDevice, iActuator {
|
|
10
10
|
settings: DachsDeviceSettings;
|
|
11
11
|
readonly deviceType: DeviceType;
|
|
12
12
|
readonly deviceCapabilities: DeviceCapability[];
|
|
13
|
-
readonly warmWaterSensor:
|
|
13
|
+
readonly warmWaterSensor: DachsTemperatureSensor;
|
|
14
|
+
readonly heatStorageTempSensor: DachsTemperatureSensor;
|
|
14
15
|
private readonly client;
|
|
15
16
|
private readonly config;
|
|
16
17
|
fetchedData: iFlattenedCompleteResponse | undefined;
|
|
17
18
|
private readonly _influxClient;
|
|
18
19
|
private _dachsOn;
|
|
19
20
|
private _tempWarmWater;
|
|
21
|
+
private _tempHeatStorage;
|
|
20
22
|
get customName(): string;
|
|
21
23
|
get actuatorOn(): boolean;
|
|
22
24
|
get tempWarmWater(): number;
|
|
25
|
+
get tempHeatStorage(): number;
|
|
23
26
|
constructor(options: iDachsSettings);
|
|
24
27
|
protected _info: DeviceInfo;
|
|
25
28
|
get info(): DeviceInfo;
|
|
@@ -11,7 +11,7 @@ const services_1 = require("../../services");
|
|
|
11
11
|
const lodash_1 = __importDefault(require("lodash"));
|
|
12
12
|
const dachsSettings_1 = require("../../../models/deviceSettings/dachsSettings");
|
|
13
13
|
const lib_1 = require("./lib");
|
|
14
|
-
const
|
|
14
|
+
const dachsTemperatureSensor_1 = require("./dachsTemperatureSensor");
|
|
15
15
|
class Dachs {
|
|
16
16
|
get customName() {
|
|
17
17
|
return this.info.customName;
|
|
@@ -22,12 +22,16 @@ class Dachs {
|
|
|
22
22
|
get tempWarmWater() {
|
|
23
23
|
return this._tempWarmWater;
|
|
24
24
|
}
|
|
25
|
+
get tempHeatStorage() {
|
|
26
|
+
return this._tempHeatStorage;
|
|
27
|
+
}
|
|
25
28
|
constructor(options) {
|
|
26
29
|
this.settings = new dachsSettings_1.DachsDeviceSettings();
|
|
27
30
|
this.deviceType = devices_1.DeviceType.Dachs;
|
|
28
31
|
this.deviceCapabilities = [];
|
|
29
32
|
this._dachsOn = false;
|
|
30
33
|
this._tempWarmWater = 0;
|
|
34
|
+
this._tempHeatStorage = 0;
|
|
31
35
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.actuator);
|
|
32
36
|
this._info = new devices_1.DeviceInfo();
|
|
33
37
|
this._info.fullName = `Dachs`;
|
|
@@ -46,7 +50,8 @@ class Dachs {
|
|
|
46
50
|
};
|
|
47
51
|
this.config = modifiedOptions;
|
|
48
52
|
this.client = new lib_1.DachsHttpClient(this.config.connectionOptions);
|
|
49
|
-
this.warmWaterSensor = new
|
|
53
|
+
this.warmWaterSensor = new dachsTemperatureSensor_1.DachsTemperatureSensor(this.config.roomName, 'ww', 'Water Temperature');
|
|
54
|
+
this.heatStorageTempSensor = new dachsTemperatureSensor_1.DachsTemperatureSensor(this.config.roomName, 'hs', 'Heat Storage Temperature');
|
|
50
55
|
services_1.Utils.guardedInterval(this.loadData, this.config.refreshInterval, this);
|
|
51
56
|
}
|
|
52
57
|
get info() {
|
|
@@ -74,7 +79,7 @@ class Dachs {
|
|
|
74
79
|
});
|
|
75
80
|
}
|
|
76
81
|
toJSON() {
|
|
77
|
-
return services_1.Utils.jsonFilter(lodash_1.default.omit(this, ['room', 'client', 'config', '_influxClient', 'warmWaterSensor']));
|
|
82
|
+
return services_1.Utils.jsonFilter(lodash_1.default.omit(this, ['room', 'client', 'config', '_influxClient', 'warmWaterSensor', 'heatStorageTempSensor']));
|
|
78
83
|
}
|
|
79
84
|
persistDeviceInfo() {
|
|
80
85
|
services_1.Utils.guardedTimeout(() => {
|
|
@@ -87,7 +92,7 @@ class Dachs {
|
|
|
87
92
|
}
|
|
88
93
|
loadData() {
|
|
89
94
|
this.client.fetchAllKeys().then((data) => {
|
|
90
|
-
var _a;
|
|
95
|
+
var _a, _b;
|
|
91
96
|
this.fetchedData = data;
|
|
92
97
|
if (this._influxClient === undefined) {
|
|
93
98
|
return;
|
|
@@ -104,6 +109,8 @@ class Dachs {
|
|
|
104
109
|
this._dachsOn = this.fetchedData['Hka_Mw1.usDrehzahl'] >= 1;
|
|
105
110
|
this._tempWarmWater = (_a = this.fetchedData['Hka_Mw1.Temp.sbZS_Warmwasser']) !== null && _a !== void 0 ? _a : 0;
|
|
106
111
|
this.warmWaterSensor.update(this._tempWarmWater);
|
|
112
|
+
this._tempHeatStorage = (_b = this.fetchedData['Hka_Mw1.Temp.sbFuehler1']) !== null && _b !== void 0 ? _b : 0;
|
|
113
|
+
this.heatStorageTempSensor.update(this._tempHeatStorage);
|
|
107
114
|
this.persist();
|
|
108
115
|
});
|
|
109
116
|
}
|
package/lib/server/devices/dachs/{dachsWarmWaterTemperature.d.ts → dachsTemperatureSensor.d.ts}
RENAMED
|
@@ -5,7 +5,7 @@ import { DeviceCapability } from '../DeviceCapability';
|
|
|
5
5
|
import { DeviceType } from '../deviceType';
|
|
6
6
|
import { DeviceInfo } from '../DeviceInfo';
|
|
7
7
|
import { DeviceSettings, LogLevel, RoomBase } from '../../../models';
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class DachsTemperatureSensor implements iTemperatureSensor {
|
|
9
9
|
settings: DeviceSettings | undefined;
|
|
10
10
|
readonly deviceType: DeviceType;
|
|
11
11
|
readonly deviceCapabilities: DeviceCapability[];
|
|
@@ -13,7 +13,7 @@ export declare class DachsWarmWaterTemperature implements iTemperatureSensor {
|
|
|
13
13
|
private _temperaturCallbacks;
|
|
14
14
|
private _roomTemperature;
|
|
15
15
|
protected _info: DeviceInfo;
|
|
16
|
-
constructor(roomName: string);
|
|
16
|
+
constructor(roomName: string, shortKey: string, longKey: string);
|
|
17
17
|
get customName(): string;
|
|
18
18
|
get info(): DeviceInfo;
|
|
19
19
|
set info(info: DeviceInfo);
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.DachsTemperatureSensor = void 0;
|
|
7
7
|
const baseDeviceInterfaces_1 = require("../baseDeviceInterfaces");
|
|
8
8
|
const services_1 = require("../../services");
|
|
9
9
|
const DeviceCapability_1 = require("../DeviceCapability");
|
|
@@ -11,8 +11,8 @@ const deviceType_1 = require("../deviceType");
|
|
|
11
11
|
const DeviceInfo_1 = require("../DeviceInfo");
|
|
12
12
|
const devices_1 = require("../devices");
|
|
13
13
|
const lodash_1 = __importDefault(require("lodash"));
|
|
14
|
-
class
|
|
15
|
-
constructor(roomName) {
|
|
14
|
+
class DachsTemperatureSensor {
|
|
15
|
+
constructor(roomName, shortKey, longKey) {
|
|
16
16
|
this.settings = undefined;
|
|
17
17
|
this.deviceType = deviceType_1.DeviceType.DachsWarmWaterTemperature;
|
|
18
18
|
this.deviceCapabilities = [];
|
|
@@ -24,9 +24,9 @@ class DachsWarmWaterTemperature {
|
|
|
24
24
|
this._temperature = baseDeviceInterfaces_1.UNDEFINED_TEMP_VALUE;
|
|
25
25
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.temperatureSensor);
|
|
26
26
|
this._info = new DeviceInfo_1.DeviceInfo();
|
|
27
|
-
this._info.fullName =
|
|
28
|
-
this._info.customName =
|
|
29
|
-
this._info.allDevicesKey = `dachs
|
|
27
|
+
this._info.fullName = longKey;
|
|
28
|
+
this._info.customName = `${longKey} ${roomName}`;
|
|
29
|
+
this._info.allDevicesKey = `dachs-${shortKey}-${roomName}`;
|
|
30
30
|
this._info.room = roomName;
|
|
31
31
|
devices_1.Devices.alLDevices[this._info.allDevicesKey] = this;
|
|
32
32
|
devices_1.Devices.temperatureWarmWater = this;
|
|
@@ -44,7 +44,7 @@ class DachsWarmWaterTemperature {
|
|
|
44
44
|
}
|
|
45
45
|
get id() {
|
|
46
46
|
var _a;
|
|
47
|
-
return (_a = this.info.allDevicesKey) !== null && _a !== void 0 ? _a : `
|
|
47
|
+
return (_a = this.info.allDevicesKey) !== null && _a !== void 0 ? _a : `dachs-${this.info.room}-${this.info.customName}`;
|
|
48
48
|
}
|
|
49
49
|
get name() {
|
|
50
50
|
return this.info.customName;
|
|
@@ -113,4 +113,4 @@ class DachsWarmWaterTemperature {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
exports.
|
|
116
|
+
exports.DachsTemperatureSensor = DachsTemperatureSensor;
|