hoffmation-base 3.2.4 → 3.2.6
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/devices/BaseDevice.d.ts +2 -0
- package/lib/devices/BaseDevice.js +3 -1
- package/lib/devices/dachs/dachs.js +6 -6
- package/lib/interfaces/deviceSettings/iDachsDeviceSettings.d.ts +4 -0
- package/lib/interfaces/settings/iShutterSettings.d.ts +12 -0
- package/lib/services/weather/weather-service.js +4 -1
- package/lib/settingsObjects/deviceSettings/dachsSettings.d.ts +2 -0
- package/lib/settingsObjects/deviceSettings/dachsSettings.js +14 -11
- package/lib/settingsObjects/deviceSettings/shutterSettings.d.ts +4 -0
- package/lib/settingsObjects/deviceSettings/shutterSettings.js +8 -2
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -9,6 +9,8 @@ export declare abstract class BaseDevice implements iBaseDevice {
|
|
|
9
9
|
/** @inheritDoc */
|
|
10
10
|
readonly jsonOmitKeys: string[];
|
|
11
11
|
/** @inheritDoc */
|
|
12
|
+
readonly jsonOmitTopLevelKeys: string[];
|
|
13
|
+
/** @inheritDoc */
|
|
12
14
|
readonly deviceCapabilities: DeviceCapability[];
|
|
13
15
|
/**
|
|
14
16
|
* @inheritDoc
|
|
@@ -16,6 +16,8 @@ class BaseDevice {
|
|
|
16
16
|
/** @inheritDoc */
|
|
17
17
|
this.jsonOmitKeys = [];
|
|
18
18
|
/** @inheritDoc */
|
|
19
|
+
this.jsonOmitTopLevelKeys = [];
|
|
20
|
+
/** @inheritDoc */
|
|
19
21
|
this.deviceCapabilities = [];
|
|
20
22
|
/**
|
|
21
23
|
* @inheritDoc
|
|
@@ -95,7 +97,7 @@ class BaseDevice {
|
|
|
95
97
|
// eslint-disable-next-line
|
|
96
98
|
const returnValue = lodash_1.default.omit(this, 'lastCommands');
|
|
97
99
|
returnValue['lastCommands'] = this.lastCommands.readAmount(this.lastCommands.maximumSize);
|
|
98
|
-
return utils_1.Utils.jsonFilter(returnValue, this.jsonOmitKeys);
|
|
100
|
+
return utils_1.Utils.jsonFilter(returnValue, this.jsonOmitKeys, this.jsonOmitTopLevelKeys);
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
103
|
exports.BaseDevice = BaseDevice;
|
|
@@ -52,14 +52,13 @@ class Dachs extends RoomBaseDevice_1.RoomBaseDevice {
|
|
|
52
52
|
* The timestamp of the last time the Block was enforced.
|
|
53
53
|
*/
|
|
54
54
|
this._blockStarted = 0;
|
|
55
|
+
this.jsonOmitTopLevelKeys.push(...['warmWaterPump', 'heatingRod']);
|
|
55
56
|
this.jsonOmitKeys.push(...[
|
|
56
57
|
'client',
|
|
57
58
|
'config',
|
|
58
59
|
'_influxClient',
|
|
59
60
|
'warmWaterSensor',
|
|
60
61
|
'heatStorageTempSensor',
|
|
61
|
-
'warmWaterPump',
|
|
62
|
-
'heatingRod',
|
|
63
62
|
'blockDachsStart',
|
|
64
63
|
'warmWaterDachsAlternativeActuator',
|
|
65
64
|
]);
|
|
@@ -269,10 +268,11 @@ class Dachs extends RoomBaseDevice_1.RoomBaseDevice {
|
|
|
269
268
|
if (this.heatingRod === undefined) {
|
|
270
269
|
return;
|
|
271
270
|
}
|
|
272
|
-
const shouldBeOff =
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
271
|
+
const shouldBeOff = this.settings.disableHeatingRod ||
|
|
272
|
+
(batteryLevel < this.settings.batteryLevelHeatingRodThreshold &&
|
|
273
|
+
!(settings_service_1.SettingsService.heatMode === enums_1.HeatingMode.Winter &&
|
|
274
|
+
batteryLevel > this.settings.batteryLevelPreventStartThreshold &&
|
|
275
|
+
this.heatStorageTempSensor.temperatureSensor.temperature < 60));
|
|
276
276
|
if (this.heatingRod.actuatorOn !== shouldBeOff) {
|
|
277
277
|
return;
|
|
278
278
|
}
|
|
@@ -7,6 +7,10 @@ export interface iDachsDeviceSettings extends iActuatorSettings {
|
|
|
7
7
|
* The refresh interval in ms to pull the data from the device.
|
|
8
8
|
*/
|
|
9
9
|
refreshIntervalTime: number;
|
|
10
|
+
/**
|
|
11
|
+
* Whether the secondary water heating source should be disabled regardless of battery level.
|
|
12
|
+
*/
|
|
13
|
+
disableHeatingRod: boolean;
|
|
10
14
|
/**
|
|
11
15
|
* Defines the battery level at which the dachs should be turned on,
|
|
12
16
|
* to prevent a battery based island-system to be out of power.
|
|
@@ -19,6 +19,18 @@ export interface iShutterSettings extends iDeviceSettings {
|
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
21
|
heatReductionPosition: number;
|
|
22
|
+
/**
|
|
23
|
+
* The minimum temperature in degree celsius, to trigger heat reduction, when the sun is shining on window.
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @default 24
|
|
26
|
+
*/
|
|
27
|
+
heatReductionDirectionThreshold: number;
|
|
28
|
+
/**
|
|
29
|
+
* The minimum temperature in degree celsius, to trigger heat reduction regardless of direction
|
|
30
|
+
* @type {number}
|
|
31
|
+
* @default 27
|
|
32
|
+
*/
|
|
33
|
+
heatReductionThreshold: number;
|
|
22
34
|
/**
|
|
23
35
|
*
|
|
24
36
|
*/
|
|
@@ -155,6 +155,9 @@ class WeatherService {
|
|
|
155
155
|
logger(enums_1.LogLevel.Trace, "RolloWeatherPosition: It's close to or after todays sunset");
|
|
156
156
|
return result;
|
|
157
157
|
}
|
|
158
|
+
else if (this.willOutsideBeWarmer(shutterSettings.heatReductionThreshold, logger)) {
|
|
159
|
+
result = shutterSettings.heatReductionPosition;
|
|
160
|
+
}
|
|
158
161
|
else if (shutterSettings.direction !== undefined &&
|
|
159
162
|
!utils_1.Utils.degreeInBetween(shutterSettings.direction - 50, shutterSettings.direction + 50, this.sunDirection)) {
|
|
160
163
|
logger(enums_1.LogLevel.Trace, 'RolloWeatherPosition: Sun is facing a different direction');
|
|
@@ -163,7 +166,7 @@ class WeatherService {
|
|
|
163
166
|
else if (this.getCurrentCloudiness() > 40) {
|
|
164
167
|
logger(enums_1.LogLevel.Trace, 'RolloWeatherPosition: It´s cloudy now.');
|
|
165
168
|
}
|
|
166
|
-
else if (this.willOutsideBeWarmer(
|
|
169
|
+
else if (this.willOutsideBeWarmer(shutterSettings.heatReductionDirectionThreshold, logger)) {
|
|
167
170
|
result = shutterSettings.heatReductionPosition;
|
|
168
171
|
}
|
|
169
172
|
if (result !== normalPos) {
|
|
@@ -4,6 +4,8 @@ export declare class DachsDeviceSettings extends ActuatorSettings implements iDa
|
|
|
4
4
|
/** @inheritDoc */
|
|
5
5
|
refreshIntervalTime: number;
|
|
6
6
|
/** @inheritDoc */
|
|
7
|
+
disableHeatingRod: boolean;
|
|
8
|
+
/** @inheritDoc */
|
|
7
9
|
batteryLevelTurnOnThreshold: number;
|
|
8
10
|
/** @inheritDoc */
|
|
9
11
|
batteryLevelBeforeNightTurnOnThreshold: number;
|
|
@@ -9,6 +9,8 @@ class DachsDeviceSettings extends actuatorSettings_1.ActuatorSettings {
|
|
|
9
9
|
/** @inheritDoc */
|
|
10
10
|
this.refreshIntervalTime = 30000;
|
|
11
11
|
/** @inheritDoc */
|
|
12
|
+
this.disableHeatingRod = false;
|
|
13
|
+
/** @inheritDoc */
|
|
12
14
|
this.batteryLevelTurnOnThreshold = -1;
|
|
13
15
|
/** @inheritDoc */
|
|
14
16
|
this.batteryLevelBeforeNightTurnOnThreshold = -1;
|
|
@@ -28,21 +30,22 @@ class DachsDeviceSettings extends actuatorSettings_1.ActuatorSettings {
|
|
|
28
30
|
this.winterMinimumPreNightHeatStorageTemp = 65;
|
|
29
31
|
}
|
|
30
32
|
fromPartialObject(data) {
|
|
31
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
32
|
-
this.
|
|
33
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
34
|
+
this.disableHeatingRod = (_a = data.disableHeatingRod) !== null && _a !== void 0 ? _a : this.disableHeatingRod;
|
|
35
|
+
this.refreshIntervalTime = (_b = data.refreshIntervalTime) !== null && _b !== void 0 ? _b : this.refreshIntervalTime;
|
|
33
36
|
this.batteryLevelBeforeNightTurnOnThreshold =
|
|
34
|
-
(
|
|
35
|
-
this.batteryLevelTurnOnThreshold = (
|
|
36
|
-
this.batteryLevelHeatingRodThreshold = (
|
|
37
|
+
(_c = data.batteryLevelBeforeNightTurnOnThreshold) !== null && _c !== void 0 ? _c : this.batteryLevelBeforeNightTurnOnThreshold;
|
|
38
|
+
this.batteryLevelTurnOnThreshold = (_d = data.batteryLevelTurnOnThreshold) !== null && _d !== void 0 ? _d : this.batteryLevelTurnOnThreshold;
|
|
39
|
+
this.batteryLevelHeatingRodThreshold = (_e = data.batteryLevelHeatingRodThreshold) !== null && _e !== void 0 ? _e : this.batteryLevelHeatingRodThreshold;
|
|
37
40
|
this.batteryLevelPreventStartThreshold =
|
|
38
|
-
(
|
|
41
|
+
(_f = data.batteryLevelPreventStartThreshold) !== null && _f !== void 0 ? _f : this.batteryLevelPreventStartThreshold;
|
|
39
42
|
this.batteryLevelPreventStartAtNightThreshold =
|
|
40
|
-
(
|
|
41
|
-
this.batteryLevelAllowStartThreshold = (
|
|
42
|
-
this.warmWaterDesiredMinTemp = (
|
|
43
|
-
this.winterMinimumHeatStorageTemp = (
|
|
43
|
+
(_g = data.batteryLevelPreventStartAtNightThreshold) !== null && _g !== void 0 ? _g : this.batteryLevelPreventStartAtNightThreshold;
|
|
44
|
+
this.batteryLevelAllowStartThreshold = (_h = data.batteryLevelAllowStartThreshold) !== null && _h !== void 0 ? _h : this.batteryLevelAllowStartThreshold;
|
|
45
|
+
this.warmWaterDesiredMinTemp = (_j = data.warmWaterDesiredMinTemp) !== null && _j !== void 0 ? _j : this.warmWaterDesiredMinTemp;
|
|
46
|
+
this.winterMinimumHeatStorageTemp = (_k = data.winterMinimumHeatStorageTemp) !== null && _k !== void 0 ? _k : this.winterMinimumHeatStorageTemp;
|
|
44
47
|
this.winterMinimumPreNightHeatStorageTemp =
|
|
45
|
-
(
|
|
48
|
+
(_l = data.winterMinimumPreNightHeatStorageTemp) !== null && _l !== void 0 ? _l : this.winterMinimumPreNightHeatStorageTemp;
|
|
46
49
|
super.fromPartialObject(data);
|
|
47
50
|
}
|
|
48
51
|
toJSON() {
|
|
@@ -21,6 +21,10 @@ export declare class ShutterSettings extends DeviceSettings implements iShutterS
|
|
|
21
21
|
* @default 40
|
|
22
22
|
*/
|
|
23
23
|
heatReductionPosition: number;
|
|
24
|
+
/** @inheritDoc */
|
|
25
|
+
heatReductionDirectionThreshold: number;
|
|
26
|
+
/** @inheritDoc */
|
|
27
|
+
heatReductionThreshold: number;
|
|
24
28
|
/**
|
|
25
29
|
* Some shutter give no position feedback on their own, so by knowing the durations in either direction,
|
|
26
30
|
* we can programmatically trigger the callbacks.
|
|
@@ -26,6 +26,10 @@ class ShutterSettings extends deviceSettings_1.DeviceSettings {
|
|
|
26
26
|
* @default 40
|
|
27
27
|
*/
|
|
28
28
|
this.heatReductionPosition = 40;
|
|
29
|
+
/** @inheritDoc */
|
|
30
|
+
this.heatReductionDirectionThreshold = 24;
|
|
31
|
+
/** @inheritDoc */
|
|
32
|
+
this.heatReductionThreshold = 27;
|
|
29
33
|
/**
|
|
30
34
|
* Some shutter give no position feedback on their own, so by knowing the durations in either direction,
|
|
31
35
|
* we can programmatically trigger the callbacks.
|
|
@@ -34,12 +38,14 @@ class ShutterSettings extends deviceSettings_1.DeviceSettings {
|
|
|
34
38
|
this.triggerPositionUpdateByTime = false;
|
|
35
39
|
}
|
|
36
40
|
fromPartialObject(data) {
|
|
37
|
-
var _a, _b, _c, _d, _e;
|
|
41
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
38
42
|
this.msTilTop = (_a = data.msTilTop) !== null && _a !== void 0 ? _a : this.msTilTop;
|
|
39
43
|
this.msTilBot = (_b = data.msTilBot) !== null && _b !== void 0 ? _b : this.msTilBot;
|
|
40
44
|
this.direction = (_c = data.direction) !== null && _c !== void 0 ? _c : this.direction;
|
|
41
45
|
this.heatReductionPosition = (_d = data.heatReductionPosition) !== null && _d !== void 0 ? _d : this.heatReductionPosition;
|
|
42
|
-
this.
|
|
46
|
+
this.heatReductionThreshold = (_e = data.heatReductionThreshold) !== null && _e !== void 0 ? _e : this.heatReductionThreshold;
|
|
47
|
+
this.heatReductionDirectionThreshold = (_f = data.heatReductionDirectionThreshold) !== null && _f !== void 0 ? _f : this.heatReductionDirectionThreshold;
|
|
48
|
+
this.triggerPositionUpdateByTime = (_g = data.triggerPositionUpdateByTime) !== null && _g !== void 0 ? _g : this.triggerPositionUpdateByTime;
|
|
43
49
|
super.fromPartialObject(data);
|
|
44
50
|
}
|
|
45
51
|
toJSON() {
|