hoffmation-base 3.2.15 → 3.2.16

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.
@@ -225,7 +225,11 @@ class Dachs extends RoomBaseDevice_1.RoomBaseDevice {
225
225
  const heatStorageTemp = this._tempHeatStorage;
226
226
  let desiredWwPumpState = false;
227
227
  let reason = '';
228
- if (this.settings.disableDachsOwnWW) {
228
+ if (this.settings.disableDachsTemporarily) {
229
+ reason = 'Dachs itself is disabled temporarily';
230
+ desiredWwPumpState = false;
231
+ }
232
+ else if (this.settings.disableDachsOwnWW) {
229
233
  desiredWwPumpState = false;
230
234
  reason = 'Dachs own WW is disabled';
231
235
  }
@@ -287,7 +291,14 @@ class Dachs extends RoomBaseDevice_1.RoomBaseDevice {
287
291
  var _a, _b, _c;
288
292
  const dayType = services_1.TimeCallbackService.dayType(new models_1.SunTimeOffsets());
289
293
  if (this.blockDachsStart !== undefined) {
290
- if ((dayType === enums_1.TimeOfDay.Daylight || dayType === enums_1.TimeOfDay.BeforeSunrise) &&
294
+ if (this.settings.disableDachsTemporarily) {
295
+ const blockAction = new command_1.ActuatorSetStateCommand(action, true, `Dachs is disabled temporarily`, null);
296
+ blockAction.overrideCommandSource = enums_1.CommandSource.Force;
297
+ this.blockDachsStart.setActuator(blockAction);
298
+ this._blockStarted = utils_1.Utils.nowMS();
299
+ return false;
300
+ }
301
+ else if ((dayType === enums_1.TimeOfDay.Daylight || dayType === enums_1.TimeOfDay.BeforeSunrise) &&
291
302
  batteryLevel > this.settings.batteryLevelPreventStartThreshold) {
292
303
  const blockAction = new command_1.ActuatorSetStateCommand(action, true, `Battery reached ${batteryLevel}%, Dachs should not run any more`, null);
293
304
  blockAction.overrideCommandSource = enums_1.CommandSource.Force;
@@ -350,7 +361,11 @@ class Dachs extends RoomBaseDevice_1.RoomBaseDevice {
350
361
  }
351
362
  let desiredState = false;
352
363
  let reason = 'Dachs is allowed to run --> Block alternative heating source';
353
- if (this.settings.disableDachsOwnWW) {
364
+ if (this.settings.disableDachsTemporarily) {
365
+ reason = 'Dachs itself is disabled temporarily';
366
+ desiredState = true;
367
+ }
368
+ else if (this.settings.disableDachsOwnWW) {
354
369
  reason = 'Dachs own WW is disabled';
355
370
  desiredState = true;
356
371
  }
@@ -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 services_1 = require("../../services");
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
- // Set the target automatic value
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
- ![enums_1.TimeOfDay.Night, enums_1.TimeOfDay.AfterSunset].includes(services_1.TimeCallbackService.dayType(device.room.settings.rolloOffset))) {
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
- [enums_1.TimeOfDay.Night, enums_1.TimeOfDay.AfterSunset].includes(services_1.TimeCallbackService.dayType(device.room.settings.rolloOffset))) {
39
- // First manual down command of the day on a window with no automatic up.
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.
@@ -14,6 +14,10 @@ export interface iExcessEnergyConsumerSettings {
14
14
  *
15
15
  */
16
16
  powerReactionTime: number;
17
+ /**
18
+ * Option to run the device even if it is not in the excess energy consumer group
19
+ */
20
+ runAnyways: boolean;
17
21
  /**
18
22
  *
19
23
  */
@@ -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.refreshIntervalTime = (_c = data.refreshIntervalTime) !== null && _c !== void 0 ? _c : this.refreshIntervalTime;
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
- (_d = data.batteryLevelBeforeNightTurnOnThreshold) !== null && _d !== void 0 ? _d : this.batteryLevelBeforeNightTurnOnThreshold;
41
- this.batteryLevelTurnOnThreshold = (_e = data.batteryLevelTurnOnThreshold) !== null && _e !== void 0 ? _e : this.batteryLevelTurnOnThreshold;
42
- this.batteryLevelHeatingRodThreshold = (_f = data.batteryLevelHeatingRodThreshold) !== null && _f !== void 0 ? _f : 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
- (_g = data.batteryLevelPreventStartThreshold) !== null && _g !== void 0 ? _g : this.batteryLevelPreventStartThreshold;
47
+ (_h = data.batteryLevelPreventStartThreshold) !== null && _h !== void 0 ? _h : this.batteryLevelPreventStartThreshold;
45
48
  this.batteryLevelPreventStartAtNightThreshold =
46
- (_h = data.batteryLevelPreventStartAtNightThreshold) !== null && _h !== void 0 ? _h : this.batteryLevelPreventStartAtNightThreshold;
47
- this.batteryLevelAllowStartThreshold = (_j = data.batteryLevelAllowStartThreshold) !== null && _j !== void 0 ? _j : this.batteryLevelAllowStartThreshold;
48
- this.warmWaterDesiredMinTemp = (_k = data.warmWaterDesiredMinTemp) !== null && _k !== void 0 ? _k : this.warmWaterDesiredMinTemp;
49
- this.winterMinimumHeatStorageTemp = (_l = data.winterMinimumHeatStorageTemp) !== null && _l !== void 0 ? _l : 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
- (_m = data.winterMinimumPreNightHeatStorageTemp) !== null && _m !== void 0 ? _m : this.winterMinimumPreNightHeatStorageTemp;
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;