hoffmation-base 2.19.0 → 2.19.2

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.
@@ -30,6 +30,11 @@ export declare class HeaterSettings extends DeviceSettings {
30
30
  * @type {number}
31
31
  */
32
32
  pidForcedMinimum: number;
33
+ /**
34
+ * Whether this AC should be turned off for some time manually
35
+ * @type {boolean}
36
+ */
37
+ manualDisabled: boolean;
33
38
  fromPartialObject(data: Partial<HeaterSettings>): void;
34
39
  protected toJSON(): Partial<HeaterSettings>;
35
40
  }
@@ -36,9 +36,14 @@ class HeaterSettings extends deviceSettings_1.DeviceSettings {
36
36
  * @type {number}
37
37
  */
38
38
  this.pidForcedMinimum = 1;
39
+ /**
40
+ * Whether this AC should be turned off for some time manually
41
+ * @type {boolean}
42
+ */
43
+ this.manualDisabled = false;
39
44
  }
40
45
  fromPartialObject(data) {
41
- var _a, _b, _c, _d, _e, _f, _g, _h;
46
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
42
47
  this.automaticMode = (_a = data.automaticMode) !== null && _a !== void 0 ? _a : this.automaticMode;
43
48
  this.useOwnTemperatur = (_b = data.useOwnTemperatur) !== null && _b !== void 0 ? _b : this.useOwnTemperatur;
44
49
  this.controlByPid = (_c = data.controlByPid) !== null && _c !== void 0 ? _c : this.controlByPid;
@@ -47,6 +52,7 @@ class HeaterSettings extends deviceSettings_1.DeviceSettings {
47
52
  this.seasonTurnOffDay = (_f = data.seasonTurnOffDay) !== null && _f !== void 0 ? _f : this.seasonTurnOffDay;
48
53
  this.seasonTurnOnDay = (_g = data.seasonTurnOnDay) !== null && _g !== void 0 ? _g : this.seasonTurnOnDay;
49
54
  this.pidForcedMinimum = (_h = data.pidForcedMinimum) !== null && _h !== void 0 ? _h : this.pidForcedMinimum;
55
+ this.manualDisabled = (_j = data.manualDisabled) !== null && _j !== void 0 ? _j : this.manualDisabled;
50
56
  super.fromPartialObject(data);
51
57
  }
52
58
  toJSON() {
@@ -5,18 +5,20 @@ 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 { DachsWarmWaterTemperature } from './dachsWarmWaterTemperature';
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: DachsWarmWaterTemperature;
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;
@@ -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 dachsWarmWaterTemperature_1 = require("./dachsWarmWaterTemperature");
14
+ const dachsTemperatureSensor_1 = require("./dachsTemperatureSensor");
15
15
  class Dachs {
16
16
  get customName() {
17
17
  return this.info.customName;
@@ -28,6 +28,7 @@ class Dachs {
28
28
  this.deviceCapabilities = [];
29
29
  this._dachsOn = false;
30
30
  this._tempWarmWater = 0;
31
+ this._tempHeatStorage = 0;
31
32
  this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.actuator);
32
33
  this._info = new devices_1.DeviceInfo();
33
34
  this._info.fullName = `Dachs`;
@@ -46,7 +47,8 @@ class Dachs {
46
47
  };
47
48
  this.config = modifiedOptions;
48
49
  this.client = new lib_1.DachsHttpClient(this.config.connectionOptions);
49
- this.warmWaterSensor = new dachsWarmWaterTemperature_1.DachsWarmWaterTemperature(this.config.roomName);
50
+ this.warmWaterSensor = new dachsTemperatureSensor_1.DachsTemperatureSensor(this.config.roomName, 'ww', 'Water Temperature');
51
+ this.heatStorageTempSensor = new dachsTemperatureSensor_1.DachsTemperatureSensor(this.config.roomName, 'hs', 'Heat Storage Temperature');
50
52
  services_1.Utils.guardedInterval(this.loadData, this.config.refreshInterval, this);
51
53
  }
52
54
  get info() {
@@ -74,7 +76,7 @@ class Dachs {
74
76
  });
75
77
  }
76
78
  toJSON() {
77
- return services_1.Utils.jsonFilter(lodash_1.default.omit(this, ['room', 'client', 'config', '_influxClient', 'warmWaterSensor']));
79
+ return services_1.Utils.jsonFilter(lodash_1.default.omit(this, ['room', 'client', 'config', '_influxClient', 'warmWaterSensor', 'heatStorageTempSensor']));
78
80
  }
79
81
  persistDeviceInfo() {
80
82
  services_1.Utils.guardedTimeout(() => {
@@ -87,7 +89,7 @@ class Dachs {
87
89
  }
88
90
  loadData() {
89
91
  this.client.fetchAllKeys().then((data) => {
90
- var _a;
92
+ var _a, _b;
91
93
  this.fetchedData = data;
92
94
  if (this._influxClient === undefined) {
93
95
  return;
@@ -104,6 +106,8 @@ class Dachs {
104
106
  this._dachsOn = this.fetchedData['Hka_Mw1.usDrehzahl'] >= 1;
105
107
  this._tempWarmWater = (_a = this.fetchedData['Hka_Mw1.Temp.sbZS_Warmwasser']) !== null && _a !== void 0 ? _a : 0;
106
108
  this.warmWaterSensor.update(this._tempWarmWater);
109
+ this._tempHeatStorage = (_b = this.fetchedData['Hka_Mw1.Temp.sbFuehler1']) !== null && _b !== void 0 ? _b : 0;
110
+ this.heatStorageTempSensor.update(this._tempHeatStorage);
107
111
  this.persist();
108
112
  });
109
113
  }
@@ -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 DachsWarmWaterTemperature implements iTemperatureSensor {
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.DachsWarmWaterTemperature = void 0;
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 DachsWarmWaterTemperature {
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 = `Water Temperature`;
28
- this._info.customName = `Water Temperature ${roomName}`;
29
- this._info.allDevicesKey = `dachs-ww-${roomName}`;
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 : `sonos-${this.info.room}-${this.info.customName}`;
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.DachsWarmWaterTemperature = DachsWarmWaterTemperature;
116
+ exports.DachsTemperatureSensor = DachsTemperatureSensor;
@@ -130,6 +130,10 @@ class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
130
130
  if (!this._initialSeasonCheckDone) {
131
131
  this.checkSeasonTurnOff();
132
132
  }
133
+ if (this.seasonTurnOff || this.settings.manualDisabled) {
134
+ this.seasonTurnOff = true;
135
+ return;
136
+ }
133
137
  const heatGroupSettings = (_b = (_a = this.room) === null || _a === void 0 ? void 0 : _a.HeatGroup) === null || _b === void 0 ? void 0 : _b.settings;
134
138
  if (!this.settings.automaticMode || this.seasonTurnOff || (heatGroupSettings === null || heatGroupSettings === void 0 ? void 0 : heatGroupSettings.automaticMode) === false) {
135
139
  return;
@@ -126,7 +126,9 @@ class ShellyTrv extends shellyDevice_1.ShellyDevice {
126
126
  if (!this._initialSeasonCheckDone) {
127
127
  this.checkSeasonTurnOff();
128
128
  }
129
- if (this.seasonTurnOff) {
129
+ if (this.seasonTurnOff || this.settings.manualDisabled) {
130
+ this.setValve(0);
131
+ this.setMode(false);
130
132
  return;
131
133
  }
132
134
  if (this.settings.pidForcedMinimum !== this.minimumLevel) {
@@ -96,6 +96,10 @@ class ZigbeeHeater extends zigbeeDevice_1.ZigbeeDevice {
96
96
  this.checkSeasonTurnOff();
97
97
  }
98
98
  const heatGroup = this.room.HeatGroup;
99
+ if (this.seasonTurnOff || this.settings.manualDisabled) {
100
+ this.desiredTemperature = 0;
101
+ return;
102
+ }
99
103
  if (!this.settings.automaticMode || this.seasonTurnOff || ((_a = heatGroup === null || heatGroup === void 0 ? void 0 : heatGroup.settings) === null || _a === void 0 ? void 0 : _a.automaticMode) === false) {
100
104
  return;
101
105
  }
@@ -102,6 +102,11 @@ class ZigbeeEuroHeater extends BaseDevices_1.ZigbeeHeater {
102
102
  super.update(idSplit, state, initial, true);
103
103
  }
104
104
  recalcLevel() {
105
+ if (this.seasonTurnOff || this.settings.manualDisabled) {
106
+ this.setValve(0);
107
+ this.setMode(1);
108
+ return;
109
+ }
105
110
  if (this.settings.useOwnTemperatur || this.seasonTurnOff) {
106
111
  return;
107
112
  }