hoffmation-base 3.2.15 → 3.2.17
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/dachs/dachs.js +23 -7
- package/lib/devices/groups/windowGroup.js +1 -0
- package/lib/devices/hmIPDevices/hmIpRoll.d.ts +2 -0
- package/lib/devices/hmIPDevices/hmIpRoll.js +2 -0
- package/lib/devices/sharedFunctions/shutterUtils.js +7 -5
- package/lib/devices/velux/veluxShutter.d.ts +2 -0
- package/lib/devices/velux/veluxShutter.js +2 -0
- package/lib/devices/zigbee/BaseDevices/zigbeeShutter.d.ts +2 -0
- package/lib/devices/zigbee/BaseDevices/zigbeeShutter.js +2 -0
- package/lib/interfaces/baseDevices/iShutter.d.ts +4 -0
- package/lib/interfaces/deviceSettings/iDachsDeviceSettings.d.ts +4 -0
- package/lib/interfaces/settings/iExcessEnergyConsumerSettings.d.ts +4 -0
- package/lib/services/ac/ac-device.js +1 -1
- package/lib/settingsObjects/deviceSettings/dachsSettings.d.ts +2 -0
- package/lib/settingsObjects/deviceSettings/dachsSettings.js +14 -11
- package/lib/settingsObjects/excessEnergyConsumerSettings.d.ts +2 -0
- package/lib/settingsObjects/excessEnergyConsumerSettings.js +4 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/utils.d.ts +1 -0
- package/lib/utils/utils.js +10 -0
- package/package.json +1 -1
|
@@ -145,7 +145,8 @@ class Dachs extends RoomBaseDevice_1.RoomBaseDevice {
|
|
|
145
145
|
if (!c.on ||
|
|
146
146
|
!this.warmWaterPump ||
|
|
147
147
|
(this.queuedValue === false && !this._dachsOn) ||
|
|
148
|
-
this.heatStorageTempSensor.temperatureSensor.temperature < this.warmWaterSensor.temperatureSensor.temperature
|
|
148
|
+
this.heatStorageTempSensor.temperatureSensor.temperature < this.warmWaterSensor.temperatureSensor.temperature ||
|
|
149
|
+
this.warmWaterSensor.temperatureSensor.temperature > 70) {
|
|
149
150
|
return;
|
|
150
151
|
}
|
|
151
152
|
const startPumpCommand = new command_1.ActuatorSetStateCommand(c, true, 'Dachs is starting/on');
|
|
@@ -203,8 +204,8 @@ class Dachs extends RoomBaseDevice_1.RoomBaseDevice {
|
|
|
203
204
|
if (!shouldDachsBeStarted) {
|
|
204
205
|
return;
|
|
205
206
|
}
|
|
206
|
-
const setStateCommand = new command_1.ActuatorSetStateCommand(action, true, 'Energy Level of battery dropped to critical level',
|
|
207
|
-
setStateCommand.overrideCommandSource = enums_1.CommandSource.
|
|
207
|
+
const setStateCommand = new command_1.ActuatorSetStateCommand(action, true, 'Energy Level of battery dropped to critical level', new command_1.BlockAutomaticCommand(action, 60000, 'Dachs is starting/on', enums_1.CollisionSolving.overrideIfGreater, false));
|
|
208
|
+
setStateCommand.overrideCommandSource = enums_1.CommandSource.Automatic;
|
|
208
209
|
this.setActuator(setStateCommand);
|
|
209
210
|
}
|
|
210
211
|
onHeatStorageTempChange(action) {
|
|
@@ -225,7 +226,11 @@ class Dachs extends RoomBaseDevice_1.RoomBaseDevice {
|
|
|
225
226
|
const heatStorageTemp = this._tempHeatStorage;
|
|
226
227
|
let desiredWwPumpState = false;
|
|
227
228
|
let reason = '';
|
|
228
|
-
if (this.settings.
|
|
229
|
+
if (this.settings.disableDachsTemporarily) {
|
|
230
|
+
reason = 'Dachs itself is disabled temporarily';
|
|
231
|
+
desiredWwPumpState = false;
|
|
232
|
+
}
|
|
233
|
+
else if (this.settings.disableDachsOwnWW) {
|
|
229
234
|
desiredWwPumpState = false;
|
|
230
235
|
reason = 'Dachs own WW is disabled';
|
|
231
236
|
}
|
|
@@ -287,7 +292,14 @@ class Dachs extends RoomBaseDevice_1.RoomBaseDevice {
|
|
|
287
292
|
var _a, _b, _c;
|
|
288
293
|
const dayType = services_1.TimeCallbackService.dayType(new models_1.SunTimeOffsets());
|
|
289
294
|
if (this.blockDachsStart !== undefined) {
|
|
290
|
-
if (
|
|
295
|
+
if (this.settings.disableDachsTemporarily) {
|
|
296
|
+
const blockAction = new command_1.ActuatorSetStateCommand(action, true, `Dachs is disabled temporarily`, null);
|
|
297
|
+
blockAction.overrideCommandSource = enums_1.CommandSource.Force;
|
|
298
|
+
this.blockDachsStart.setActuator(blockAction);
|
|
299
|
+
this._blockStarted = utils_1.Utils.nowMS();
|
|
300
|
+
return false;
|
|
301
|
+
}
|
|
302
|
+
else if ((dayType === enums_1.TimeOfDay.Daylight || dayType === enums_1.TimeOfDay.BeforeSunrise) &&
|
|
291
303
|
batteryLevel > this.settings.batteryLevelPreventStartThreshold) {
|
|
292
304
|
const blockAction = new command_1.ActuatorSetStateCommand(action, true, `Battery reached ${batteryLevel}%, Dachs should not run any more`, null);
|
|
293
305
|
blockAction.overrideCommandSource = enums_1.CommandSource.Force;
|
|
@@ -341,7 +353,7 @@ class Dachs extends RoomBaseDevice_1.RoomBaseDevice {
|
|
|
341
353
|
// It is not daylight but battery level is high enough
|
|
342
354
|
return false;
|
|
343
355
|
}
|
|
344
|
-
return
|
|
356
|
+
return !this.settings.blockAutomaticSettings;
|
|
345
357
|
}
|
|
346
358
|
checkAlternativeActuator(shouldDachsBeStarted, action) {
|
|
347
359
|
var _a, _b;
|
|
@@ -350,7 +362,11 @@ class Dachs extends RoomBaseDevice_1.RoomBaseDevice {
|
|
|
350
362
|
}
|
|
351
363
|
let desiredState = false;
|
|
352
364
|
let reason = 'Dachs is allowed to run --> Block alternative heating source';
|
|
353
|
-
if (this.settings.
|
|
365
|
+
if (this.settings.disableDachsTemporarily) {
|
|
366
|
+
reason = 'Dachs itself is disabled temporarily';
|
|
367
|
+
desiredState = true;
|
|
368
|
+
}
|
|
369
|
+
else if (this.settings.disableDachsOwnWW) {
|
|
354
370
|
reason = 'Dachs own WW is disabled';
|
|
355
371
|
desiredState = true;
|
|
356
372
|
}
|
|
@@ -147,6 +147,7 @@ class WindowGroup extends base_group_1.BaseGroup {
|
|
|
147
147
|
}
|
|
148
148
|
shutter.baseAutomaticLevel = 0;
|
|
149
149
|
w.setDesiredPosition(new command_1.WindowSetDesiredPositionCommand(c, 0));
|
|
150
|
+
shutter.lastAutomaticDownTime = utils_1.Utils.nowMS();
|
|
150
151
|
});
|
|
151
152
|
const room = this.getRoom();
|
|
152
153
|
room.setLightTimeBased(new command_1.RoomSetLightTimeBasedCommand(c, true, 'sunsetDown'));
|
|
@@ -15,6 +15,8 @@ export declare class HmIpRoll extends HmIPDevice implements iShutter {
|
|
|
15
15
|
blockAutomationHandler: BlockAutomaticHandler;
|
|
16
16
|
/** @inheritDoc */
|
|
17
17
|
baseAutomaticLevel: number;
|
|
18
|
+
/** @inheritDoc */
|
|
19
|
+
lastAutomaticDownTime: number;
|
|
18
20
|
private _setLevelSwitchID;
|
|
19
21
|
private _setLevel;
|
|
20
22
|
private _setLevelTime;
|
|
@@ -21,6 +21,8 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
|
21
21
|
this.targetAutomaticValue = 0;
|
|
22
22
|
/** @inheritDoc */
|
|
23
23
|
this.baseAutomaticLevel = 0;
|
|
24
|
+
/** @inheritDoc */
|
|
25
|
+
this.lastAutomaticDownTime = 0;
|
|
24
26
|
this._setLevel = -1;
|
|
25
27
|
this._setLevelTime = -1;
|
|
26
28
|
this._currentLevel = -1;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ShutterUtils = void 0;
|
|
4
4
|
const enums_1 = require("../../enums");
|
|
5
|
-
const
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
6
|
class ShutterUtils {
|
|
7
7
|
/**
|
|
8
8
|
* Handles setting the shutter level with all checks (block automation, window open, etc)
|
|
@@ -12,7 +12,8 @@ class ShutterUtils {
|
|
|
12
12
|
static setLevel(device, c) {
|
|
13
13
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
14
14
|
if (!c.isForceAction) {
|
|
15
|
-
//
|
|
15
|
+
// Only automatic commands should update the target automatic value
|
|
16
|
+
// Manual/Force commands should not override the automatic target
|
|
16
17
|
device.targetAutomaticValue = c.level;
|
|
17
18
|
}
|
|
18
19
|
// Respect block automation
|
|
@@ -22,10 +23,11 @@ class ShutterUtils {
|
|
|
22
23
|
}
|
|
23
24
|
if (c.isManual &&
|
|
24
25
|
c.level > 0 &&
|
|
26
|
+
!utils_1.Utils.isToday(device.lastAutomaticDownTime) &&
|
|
25
27
|
device.baseAutomaticLevel === 0 &&
|
|
26
28
|
!((_b = (_a = device.room) === null || _a === void 0 ? void 0 : _a.settings) === null || _b === void 0 ? void 0 : _b.sonnenAufgangRollos) &&
|
|
27
29
|
((_d = (_c = device.room) === null || _c === void 0 ? void 0 : _c.settings) === null || _d === void 0 ? void 0 : _d.rolloOffset) &&
|
|
28
|
-
|
|
30
|
+
utils_1.Utils.timeWithinBorders(6, 0, 20, 0, new Date())) {
|
|
29
31
|
// First manual up command of the day on a window with no automatic up.
|
|
30
32
|
device.baseAutomaticLevel = 100;
|
|
31
33
|
device.targetAutomaticValue = 100;
|
|
@@ -35,8 +37,8 @@ class ShutterUtils {
|
|
|
35
37
|
device.baseAutomaticLevel === 100 &&
|
|
36
38
|
!((_f = (_e = device.room) === null || _e === void 0 ? void 0 : _e.settings) === null || _f === void 0 ? void 0 : _f.sonnenUntergangRollos) &&
|
|
37
39
|
((_h = (_g = device.room) === null || _g === void 0 ? void 0 : _g.settings) === null || _h === void 0 ? void 0 : _h.rolloOffset) &&
|
|
38
|
-
|
|
39
|
-
// First manual down command of the day on a window with no automatic
|
|
40
|
+
(utils_1.Utils.timeWithinBorders(0, 0, 2, 0) || utils_1.Utils.timeWithinBorders(16, 0, 24, 0))) {
|
|
41
|
+
// First manual down command of the day on a window with no automatic down.
|
|
40
42
|
device.baseAutomaticLevel = 0;
|
|
41
43
|
device.targetAutomaticValue = 0;
|
|
42
44
|
}
|
|
@@ -14,6 +14,8 @@ export declare class VeluxShutter extends VeluxDevice implements iShutter, iTemp
|
|
|
14
14
|
targetAutomaticValue: number;
|
|
15
15
|
/** @inheritDoc */
|
|
16
16
|
baseAutomaticLevel: number;
|
|
17
|
+
/** @inheritDoc */
|
|
18
|
+
lastAutomaticDownTime: number;
|
|
17
19
|
private _setLevel;
|
|
18
20
|
private _setLevelTime;
|
|
19
21
|
private _currentLevel;
|
|
@@ -21,6 +21,8 @@ class VeluxShutter extends veluxDevice_1.VeluxDevice {
|
|
|
21
21
|
this.targetAutomaticValue = 0;
|
|
22
22
|
/** @inheritDoc */
|
|
23
23
|
this.baseAutomaticLevel = 0;
|
|
24
|
+
/** @inheritDoc */
|
|
25
|
+
this.lastAutomaticDownTime = 0;
|
|
24
26
|
this._setLevel = -1;
|
|
25
27
|
this._setLevelTime = -1;
|
|
26
28
|
this._currentLevel = -1;
|
|
@@ -23,6 +23,8 @@ export declare class ZigbeeShutter extends ZigbeeDevice implements iShutter {
|
|
|
23
23
|
targetAutomaticValue: number;
|
|
24
24
|
/** @inheritDoc */
|
|
25
25
|
baseAutomaticLevel: number;
|
|
26
|
+
/** @inheritDoc */
|
|
27
|
+
lastAutomaticDownTime: number;
|
|
26
28
|
constructor(pInfo: IoBrokerDeviceInfo, pType: DeviceType);
|
|
27
29
|
/** @inheritDoc */
|
|
28
30
|
get currentLevel(): number;
|
|
@@ -27,6 +27,8 @@ class ZigbeeShutter extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
27
27
|
this.targetAutomaticValue = 0;
|
|
28
28
|
/** @inheritDoc */
|
|
29
29
|
this.baseAutomaticLevel = 0;
|
|
30
|
+
/** @inheritDoc */
|
|
31
|
+
this.lastAutomaticDownTime = 0;
|
|
30
32
|
this.deviceCapabilities.push(enums_1.DeviceCapability.shutter);
|
|
31
33
|
this.deviceCapabilities.push(enums_1.DeviceCapability.blockAutomatic);
|
|
32
34
|
this.jsonOmitKeys.push('_window');
|
|
@@ -37,6 +37,10 @@ export interface iShutter extends iRoomDevice, iTemporaryDisableAutomatic {
|
|
|
37
37
|
* The base automation level (e.g., 0 = closed at night, 100 = open at day)
|
|
38
38
|
*/
|
|
39
39
|
baseAutomaticLevel: number;
|
|
40
|
+
/**
|
|
41
|
+
* The last time the shutter was automatically closed
|
|
42
|
+
*/
|
|
43
|
+
lastAutomaticDownTime: number;
|
|
40
44
|
/**
|
|
41
45
|
* Persists the current information of the shutter to the database
|
|
42
46
|
*/
|
|
@@ -15,6 +15,10 @@ export interface iDachsDeviceSettings extends iActuatorSettings {
|
|
|
15
15
|
* Option to disable Warm-Water production from dachs completely.
|
|
16
16
|
*/
|
|
17
17
|
disableDachsOwnWW: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Option to disable Dachs altogether, e.g. if no additional heat should be produced during summer times.
|
|
20
|
+
*/
|
|
21
|
+
disableDachsTemporarily: boolean;
|
|
18
22
|
/**
|
|
19
23
|
* Defines the battery level at which the dachs should be turned on,
|
|
20
24
|
* to prevent a battery based island-system to be out of power.
|
|
@@ -146,7 +146,7 @@ class AcDevice extends devices_1.RoomBaseDevice {
|
|
|
146
146
|
}
|
|
147
147
|
return enums_1.AcMode.Off;
|
|
148
148
|
}
|
|
149
|
-
if ((_b = devices_1.Devices.energymanager) === null || _b === void 0 ? void 0 : _b.acBlocked) {
|
|
149
|
+
if (((_b = devices_1.Devices.energymanager) === null || _b === void 0 ? void 0 : _b.acBlocked) && !this.settings.energySettings.runAnyways) {
|
|
150
150
|
if (acOn) {
|
|
151
151
|
this.log(enums_1.LogLevel.Info, 'We should turn off now, as energy-manager demands off.');
|
|
152
152
|
}
|
|
@@ -8,6 +8,8 @@ export declare class DachsDeviceSettings extends ActuatorSettings implements iDa
|
|
|
8
8
|
/** @inheritDoc */
|
|
9
9
|
disableDachsOwnWW: boolean;
|
|
10
10
|
/** @inheritDoc */
|
|
11
|
+
disableDachsTemporarily: boolean;
|
|
12
|
+
/** @inheritDoc */
|
|
11
13
|
batteryLevelTurnOnThreshold: number;
|
|
12
14
|
/** @inheritDoc */
|
|
13
15
|
batteryLevelBeforeNightTurnOnThreshold: number;
|
|
@@ -13,6 +13,8 @@ class DachsDeviceSettings extends actuatorSettings_1.ActuatorSettings {
|
|
|
13
13
|
/** @inheritDoc */
|
|
14
14
|
this.disableDachsOwnWW = false;
|
|
15
15
|
/** @inheritDoc */
|
|
16
|
+
this.disableDachsTemporarily = false;
|
|
17
|
+
/** @inheritDoc */
|
|
16
18
|
this.batteryLevelTurnOnThreshold = -1;
|
|
17
19
|
/** @inheritDoc */
|
|
18
20
|
this.batteryLevelBeforeNightTurnOnThreshold = -1;
|
|
@@ -32,23 +34,24 @@ class DachsDeviceSettings extends actuatorSettings_1.ActuatorSettings {
|
|
|
32
34
|
this.winterMinimumPreNightHeatStorageTemp = 65;
|
|
33
35
|
}
|
|
34
36
|
fromPartialObject(data) {
|
|
35
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
37
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
36
38
|
this.disableHeatingRod = (_a = data.disableHeatingRod) !== null && _a !== void 0 ? _a : this.disableHeatingRod;
|
|
37
39
|
this.disableDachsOwnWW = (_b = data.disableDachsOwnWW) !== null && _b !== void 0 ? _b : this.disableDachsOwnWW;
|
|
38
|
-
this.
|
|
40
|
+
this.disableDachsTemporarily = (_c = data.disableDachsTemporarily) !== null && _c !== void 0 ? _c : this.disableDachsTemporarily;
|
|
41
|
+
this.refreshIntervalTime = (_d = data.refreshIntervalTime) !== null && _d !== void 0 ? _d : this.refreshIntervalTime;
|
|
39
42
|
this.batteryLevelBeforeNightTurnOnThreshold =
|
|
40
|
-
(
|
|
41
|
-
this.batteryLevelTurnOnThreshold = (
|
|
42
|
-
this.batteryLevelHeatingRodThreshold = (
|
|
43
|
+
(_e = data.batteryLevelBeforeNightTurnOnThreshold) !== null && _e !== void 0 ? _e : this.batteryLevelBeforeNightTurnOnThreshold;
|
|
44
|
+
this.batteryLevelTurnOnThreshold = (_f = data.batteryLevelTurnOnThreshold) !== null && _f !== void 0 ? _f : this.batteryLevelTurnOnThreshold;
|
|
45
|
+
this.batteryLevelHeatingRodThreshold = (_g = data.batteryLevelHeatingRodThreshold) !== null && _g !== void 0 ? _g : this.batteryLevelHeatingRodThreshold;
|
|
43
46
|
this.batteryLevelPreventStartThreshold =
|
|
44
|
-
(
|
|
47
|
+
(_h = data.batteryLevelPreventStartThreshold) !== null && _h !== void 0 ? _h : this.batteryLevelPreventStartThreshold;
|
|
45
48
|
this.batteryLevelPreventStartAtNightThreshold =
|
|
46
|
-
(
|
|
47
|
-
this.batteryLevelAllowStartThreshold = (
|
|
48
|
-
this.warmWaterDesiredMinTemp = (
|
|
49
|
-
this.winterMinimumHeatStorageTemp = (
|
|
49
|
+
(_j = data.batteryLevelPreventStartAtNightThreshold) !== null && _j !== void 0 ? _j : this.batteryLevelPreventStartAtNightThreshold;
|
|
50
|
+
this.batteryLevelAllowStartThreshold = (_k = data.batteryLevelAllowStartThreshold) !== null && _k !== void 0 ? _k : this.batteryLevelAllowStartThreshold;
|
|
51
|
+
this.warmWaterDesiredMinTemp = (_l = data.warmWaterDesiredMinTemp) !== null && _l !== void 0 ? _l : this.warmWaterDesiredMinTemp;
|
|
52
|
+
this.winterMinimumHeatStorageTemp = (_m = data.winterMinimumHeatStorageTemp) !== null && _m !== void 0 ? _m : this.winterMinimumHeatStorageTemp;
|
|
50
53
|
this.winterMinimumPreNightHeatStorageTemp =
|
|
51
|
-
(
|
|
54
|
+
(_o = data.winterMinimumPreNightHeatStorageTemp) !== null && _o !== void 0 ? _o : this.winterMinimumPreNightHeatStorageTemp;
|
|
52
55
|
super.fromPartialObject(data);
|
|
53
56
|
}
|
|
54
57
|
toJSON() {
|
|
@@ -8,6 +8,8 @@ export declare class ExcessEnergyConsumerSettings implements iExcessEnergyConsum
|
|
|
8
8
|
priority: number;
|
|
9
9
|
rampUpOnSpareEnergy: boolean;
|
|
10
10
|
powerReactionTime: number;
|
|
11
|
+
/** @inheritDoc */
|
|
12
|
+
runAnyways: boolean;
|
|
11
13
|
constructor(
|
|
12
14
|
/**
|
|
13
15
|
* Priority in comparision to other ExcessEnergyConsumer Devices
|
|
@@ -14,12 +14,15 @@ class ExcessEnergyConsumerSettings {
|
|
|
14
14
|
this.priority = priority;
|
|
15
15
|
this.rampUpOnSpareEnergy = rampUpOnSpareEnergy;
|
|
16
16
|
this.powerReactionTime = powerReactionTime;
|
|
17
|
+
/** @inheritDoc */
|
|
18
|
+
this.runAnyways = false;
|
|
17
19
|
}
|
|
18
20
|
fromPartialObject(obj) {
|
|
19
|
-
var _a, _b, _c;
|
|
21
|
+
var _a, _b, _c, _d;
|
|
20
22
|
this.priority = (_a = obj.priority) !== null && _a !== void 0 ? _a : this.priority;
|
|
21
23
|
this.rampUpOnSpareEnergy = (_b = obj.rampUpOnSpareEnergy) !== null && _b !== void 0 ? _b : this.rampUpOnSpareEnergy;
|
|
22
24
|
this.powerReactionTime = (_c = obj.powerReactionTime) !== null && _c !== void 0 ? _c : this.powerReactionTime;
|
|
25
|
+
this.runAnyways = (_d = obj.runAnyways) !== null && _d !== void 0 ? _d : this.runAnyways;
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
exports.ExcessEnergyConsumerSettings = ExcessEnergyConsumerSettings;
|