hoffmation-base 2.13.2 → 2.14.1
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/acSettings.d.ts +0 -10
- package/lib/models/deviceSettings/acSettings.js +5 -17
- package/lib/models/deviceSettings/heaterSettings.d.ts +0 -5
- package/lib/models/deviceSettings/heaterSettings.js +10 -30
- package/lib/models/groupSettings/groupSettings.d.ts +3 -0
- package/lib/models/groupSettings/groupSettings.js +7 -0
- package/lib/models/groupSettings/heatGroupSettings.d.ts +16 -0
- package/lib/models/groupSettings/heatGroupSettings.js +46 -0
- package/lib/models/rooms/RoomBase.js +3 -0
- package/lib/server/devices/baseDeviceInterfaces/iHeater.d.ts +1 -3
- package/lib/server/devices/groups/base-group.d.ts +7 -2
- package/lib/server/devices/groups/base-group.js +5 -0
- package/lib/server/devices/groups/heatGroup.d.ts +6 -0
- package/lib/server/devices/groups/heatGroup.js +18 -0
- package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.d.ts +1 -3
- package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.js +5 -10
- package/lib/server/devices/zigbee/BaseDevices/zigbeeHeater.d.ts +1 -3
- package/lib/server/devices/zigbee/BaseDevices/zigbeeHeater.js +4 -8
- package/lib/server/services/ac/ac-device.d.ts +2 -2
- package/lib/server/services/ac/ac-device.js +21 -17
- package/lib/server/services/ac/own-daikin-device.d.ts +1 -2
- package/lib/server/services/ac/own-daikin-device.js +9 -10
- package/lib/server/services/api/api-service.d.ts +6 -2
- package/lib/server/services/api/api-service.js +22 -2
- package/lib/server/services/dbo/postgreSqlPersist.js +1 -1
- package/lib/server/services/room-service/room-service.d.ts +2 -1
- package/lib/server/services/room-service/room-service.js +1 -0
- package/lib/server/services/victron/victron-device.js +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
|
@@ -6,16 +6,6 @@ export declare class AcSettings extends DeviceSettings {
|
|
|
6
6
|
minimumMinutes: number;
|
|
7
7
|
maximumHours: number;
|
|
8
8
|
maximumMinutes: number;
|
|
9
|
-
/**
|
|
10
|
-
* The temperature below which cooling should be stopped
|
|
11
|
-
* @type {number}
|
|
12
|
-
*/
|
|
13
|
-
stopCoolingTemperatur: number;
|
|
14
|
-
/**
|
|
15
|
-
* The temperature above which heating should be stopped
|
|
16
|
-
* @type {number}
|
|
17
|
-
*/
|
|
18
|
-
stopHeatingTemperatur: number;
|
|
19
9
|
/**
|
|
20
10
|
* Heating can be forbidden completly e.g. for summer season
|
|
21
11
|
* @type {boolean}
|
|
@@ -12,16 +12,6 @@ class AcSettings extends deviceSettings_1.DeviceSettings {
|
|
|
12
12
|
this.minimumMinutes = 0;
|
|
13
13
|
this.maximumHours = 24;
|
|
14
14
|
this.maximumMinutes = 0;
|
|
15
|
-
/**
|
|
16
|
-
* The temperature below which cooling should be stopped
|
|
17
|
-
* @type {number}
|
|
18
|
-
*/
|
|
19
|
-
this.stopCoolingTemperatur = 22;
|
|
20
|
-
/**
|
|
21
|
-
* The temperature above which heating should be stopped
|
|
22
|
-
* @type {number}
|
|
23
|
-
*/
|
|
24
|
-
this.stopHeatingTemperatur = 21.0;
|
|
25
15
|
/**
|
|
26
16
|
* Heating can be forbidden completly e.g. for summer season
|
|
27
17
|
* @type {boolean}
|
|
@@ -44,17 +34,15 @@ class AcSettings extends deviceSettings_1.DeviceSettings {
|
|
|
44
34
|
this.manualDisabled = false;
|
|
45
35
|
}
|
|
46
36
|
fromPartialObject(data) {
|
|
47
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
37
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
48
38
|
this.minimumHours = (_a = data.minimumHours) !== null && _a !== void 0 ? _a : this.minimumHours;
|
|
49
39
|
this.minimumMinutes = (_b = data.minimumMinutes) !== null && _b !== void 0 ? _b : this.minimumMinutes;
|
|
50
40
|
this.maximumHours = (_c = data.maximumHours) !== null && _c !== void 0 ? _c : this.maximumHours;
|
|
51
41
|
this.maximumMinutes = (_d = data.maximumMinutes) !== null && _d !== void 0 ? _d : this.maximumMinutes;
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
54
|
-
this.
|
|
55
|
-
this.
|
|
56
|
-
this.useOwnTemperatureAndAutomatic = (_j = data.useOwnTemperatureAndAutomatic) !== null && _j !== void 0 ? _j : this.useOwnTemperatureAndAutomatic;
|
|
57
|
-
this.manualDisabled = (_k = data.manualDisabled) !== null && _k !== void 0 ? _k : this.manualDisabled;
|
|
42
|
+
this.heatingAllowed = (_e = data.heatingAllowed) !== null && _e !== void 0 ? _e : this.heatingAllowed;
|
|
43
|
+
this.noCoolingOnMovement = (_f = data.noCoolingOnMovement) !== null && _f !== void 0 ? _f : this.noCoolingOnMovement;
|
|
44
|
+
this.useOwnTemperatureAndAutomatic = (_g = data.useOwnTemperatureAndAutomatic) !== null && _g !== void 0 ? _g : this.useOwnTemperatureAndAutomatic;
|
|
45
|
+
this.manualDisabled = (_h = data.manualDisabled) !== null && _h !== void 0 ? _h : this.manualDisabled;
|
|
58
46
|
super.fromPartialObject(data);
|
|
59
47
|
}
|
|
60
48
|
toJSON() {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { DeviceSettings } from './deviceSettings';
|
|
2
|
-
import { TemperatureSettings } from '../temperatureSettings';
|
|
3
|
-
import { iIdHolder } from '../iIdHolder';
|
|
4
2
|
export declare class HeaterSettings extends DeviceSettings {
|
|
5
|
-
automaticPoints: TemperatureSettings[];
|
|
6
3
|
automaticMode: boolean;
|
|
7
4
|
automaticFallBackTemperatur: number;
|
|
8
5
|
useOwnTemperatur: boolean;
|
|
@@ -36,6 +33,4 @@ export declare class HeaterSettings extends DeviceSettings {
|
|
|
36
33
|
pidForcedMinimum: number;
|
|
37
34
|
fromPartialObject(data: Partial<HeaterSettings>): void;
|
|
38
35
|
protected toJSON(): Partial<HeaterSettings>;
|
|
39
|
-
deleteAutomaticPoint(name: string, device: iIdHolder): void;
|
|
40
|
-
setAutomaticPoint(setting: TemperatureSettings, device: iIdHolder): void;
|
|
41
36
|
}
|
|
@@ -6,7 +6,6 @@ const server_1 = require("../../server");
|
|
|
6
6
|
class HeaterSettings extends deviceSettings_1.DeviceSettings {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
9
|
-
this.automaticPoints = [];
|
|
10
9
|
this.automaticMode = true;
|
|
11
10
|
this.automaticFallBackTemperatur = 20;
|
|
12
11
|
this.useOwnTemperatur = true;
|
|
@@ -40,39 +39,20 @@ class HeaterSettings extends deviceSettings_1.DeviceSettings {
|
|
|
40
39
|
this.pidForcedMinimum = 1;
|
|
41
40
|
}
|
|
42
41
|
fromPartialObject(data) {
|
|
43
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
50
|
-
this.
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
53
|
-
this.pidForcedMinimum = (_k = data.pidForcedMinimum) !== null && _k !== void 0 ? _k : this.pidForcedMinimum;
|
|
42
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
43
|
+
this.automaticMode = (_a = data.automaticMode) !== null && _a !== void 0 ? _a : this.automaticMode;
|
|
44
|
+
this.automaticFallBackTemperatur = (_b = data.automaticFallBackTemperatur) !== null && _b !== void 0 ? _b : this.automaticFallBackTemperatur;
|
|
45
|
+
this.useOwnTemperatur = (_c = data.useOwnTemperatur) !== null && _c !== void 0 ? _c : this.useOwnTemperatur;
|
|
46
|
+
this.controlByPid = (_d = data.controlByPid) !== null && _d !== void 0 ? _d : this.controlByPid;
|
|
47
|
+
this.controlByTempDiff = (_e = data.controlByTempDiff) !== null && _e !== void 0 ? _e : this.controlByTempDiff;
|
|
48
|
+
this.seasonalTurnOffActive = (_f = data.seasonalTurnOffActive) !== null && _f !== void 0 ? _f : this.seasonalTurnOffActive;
|
|
49
|
+
this.seasonTurnOffDay = (_g = data.seasonTurnOffDay) !== null && _g !== void 0 ? _g : this.seasonTurnOffDay;
|
|
50
|
+
this.seasonTurnOnDay = (_h = data.seasonTurnOnDay) !== null && _h !== void 0 ? _h : this.seasonTurnOnDay;
|
|
51
|
+
this.pidForcedMinimum = (_j = data.pidForcedMinimum) !== null && _j !== void 0 ? _j : this.pidForcedMinimum;
|
|
54
52
|
super.fromPartialObject(data);
|
|
55
53
|
}
|
|
56
54
|
toJSON() {
|
|
57
55
|
return server_1.Utils.jsonFilter(this);
|
|
58
56
|
}
|
|
59
|
-
deleteAutomaticPoint(name, device) {
|
|
60
|
-
const currentIndex = this.automaticPoints.findIndex((v) => v.name === name);
|
|
61
|
-
if (currentIndex === -1) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
this.automaticPoints.splice(currentIndex, 1);
|
|
65
|
-
this.persist(device);
|
|
66
|
-
}
|
|
67
|
-
setAutomaticPoint(setting, device) {
|
|
68
|
-
const currentIndex = this.automaticPoints.findIndex((v) => v.name === setting.name);
|
|
69
|
-
if (currentIndex === -1) {
|
|
70
|
-
this.automaticPoints.push(setting);
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
this.automaticPoints[currentIndex] = setting;
|
|
74
|
-
}
|
|
75
|
-
this.persist(device);
|
|
76
|
-
}
|
|
77
57
|
}
|
|
78
58
|
exports.HeaterSettings = HeaterSettings;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GroupSettings = void 0;
|
|
4
|
+
const objectSettings_1 = require("../objectSettings");
|
|
5
|
+
class GroupSettings extends objectSettings_1.ObjectSettings {
|
|
6
|
+
}
|
|
7
|
+
exports.GroupSettings = GroupSettings;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TemperatureSettings } from '../temperatureSettings';
|
|
2
|
+
import { iIdHolder } from '../iIdHolder';
|
|
3
|
+
import { GroupSettings } from './groupSettings';
|
|
4
|
+
export declare class HeatGroupSettings extends GroupSettings {
|
|
5
|
+
automaticPoints: TemperatureSettings[];
|
|
6
|
+
automaticMode: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Target temperature when automaticMode is disabled
|
|
9
|
+
* @type {number}
|
|
10
|
+
*/
|
|
11
|
+
manualTemperature: number;
|
|
12
|
+
fromPartialObject(data: Partial<HeatGroupSettings>): void;
|
|
13
|
+
protected toJSON(): Partial<HeatGroupSettings>;
|
|
14
|
+
deleteAutomaticPoint(name: string, device: iIdHolder): void;
|
|
15
|
+
setAutomaticPoint(setting: TemperatureSettings, device: iIdHolder): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HeatGroupSettings = void 0;
|
|
4
|
+
const server_1 = require("../../server");
|
|
5
|
+
const groupSettings_1 = require("./groupSettings");
|
|
6
|
+
class HeatGroupSettings extends groupSettings_1.GroupSettings {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.automaticPoints = [];
|
|
10
|
+
this.automaticMode = true;
|
|
11
|
+
/**
|
|
12
|
+
* Target temperature when automaticMode is disabled
|
|
13
|
+
* @type {number}
|
|
14
|
+
*/
|
|
15
|
+
this.manualTemperature = 20;
|
|
16
|
+
}
|
|
17
|
+
fromPartialObject(data) {
|
|
18
|
+
var _a, _b, _c;
|
|
19
|
+
this.automaticPoints = (_a = data.automaticPoints) !== null && _a !== void 0 ? _a : this.automaticPoints;
|
|
20
|
+
this.automaticMode = (_b = data.automaticMode) !== null && _b !== void 0 ? _b : this.automaticMode;
|
|
21
|
+
this.manualTemperature = (_c = data.manualTemperature) !== null && _c !== void 0 ? _c : this.manualTemperature;
|
|
22
|
+
super.fromPartialObject(data);
|
|
23
|
+
}
|
|
24
|
+
toJSON() {
|
|
25
|
+
return server_1.Utils.jsonFilter(this);
|
|
26
|
+
}
|
|
27
|
+
deleteAutomaticPoint(name, device) {
|
|
28
|
+
const currentIndex = this.automaticPoints.findIndex((v) => v.name === name);
|
|
29
|
+
if (currentIndex === -1) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.automaticPoints.splice(currentIndex, 1);
|
|
33
|
+
this.persist(device);
|
|
34
|
+
}
|
|
35
|
+
setAutomaticPoint(setting, device) {
|
|
36
|
+
const currentIndex = this.automaticPoints.findIndex((v) => v.name === setting.name);
|
|
37
|
+
if (currentIndex === -1) {
|
|
38
|
+
this.automaticPoints.push(setting);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this.automaticPoints[currentIndex] = setting;
|
|
42
|
+
}
|
|
43
|
+
this.persist(device);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.HeatGroupSettings = HeatGroupSettings;
|
|
@@ -87,6 +87,9 @@ class RoomBase {
|
|
|
87
87
|
(_c = this.LightGroup) === null || _c === void 0 ? void 0 : _c.initialize();
|
|
88
88
|
(_d = this.TasterGroup) === null || _d === void 0 ? void 0 : _d.initCallbacks();
|
|
89
89
|
(_e = this.HeatGroup) === null || _e === void 0 ? void 0 : _e.initialize();
|
|
90
|
+
for (const group of this.groupMap.values()) {
|
|
91
|
+
server_1.RoomService.Groups.set(group.id, group);
|
|
92
|
+
}
|
|
90
93
|
}
|
|
91
94
|
persist() {
|
|
92
95
|
var _a;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { HeaterSettings
|
|
2
|
+
import { HeaterSettings } from '../../../models';
|
|
3
3
|
import { iRoomDevice } from './iRoomDevice';
|
|
4
4
|
export interface iHeater extends iRoomDevice {
|
|
5
5
|
settings: HeaterSettings;
|
|
@@ -10,8 +10,6 @@ export interface iHeater extends iRoomDevice {
|
|
|
10
10
|
roomTemperature: number;
|
|
11
11
|
readonly persistHeaterInterval: NodeJS.Timeout;
|
|
12
12
|
seasonTurnOff: boolean;
|
|
13
|
-
deleteAutomaticPoint(name: string): void;
|
|
14
|
-
setAutomaticPoint(setting: TemperatureSettings): void;
|
|
15
13
|
stopAutomaticCheck(): void;
|
|
16
14
|
checkAutomaticChange(): void;
|
|
17
15
|
onTemperaturChange(newTemperatur: number): void;
|
|
@@ -2,12 +2,17 @@ import { GroupType } from './group-type';
|
|
|
2
2
|
import { DeviceCluster } from '../device-cluster';
|
|
3
3
|
import { LogLevel, RoomBase } from '../../../models';
|
|
4
4
|
import { LogDebugType } from '../../services';
|
|
5
|
-
|
|
5
|
+
import { iIdHolder } from '../../../models/iIdHolder';
|
|
6
|
+
import { GroupSettings } from '../../../models/groupSettings/groupSettings';
|
|
7
|
+
export declare class BaseGroup implements iIdHolder {
|
|
6
8
|
roomName: string;
|
|
7
9
|
type: GroupType;
|
|
10
|
+
settings: GroupSettings | undefined;
|
|
11
|
+
get customName(): string;
|
|
12
|
+
id: string;
|
|
8
13
|
constructor(roomName: string, type: GroupType);
|
|
9
14
|
protected _deviceCluster: DeviceCluster;
|
|
10
15
|
get deviceCluster(): DeviceCluster;
|
|
11
16
|
getRoom(): RoomBase;
|
|
12
|
-
|
|
17
|
+
log(level: LogLevel, message: string, debugType?: LogDebugType): void;
|
|
13
18
|
}
|
|
@@ -5,10 +5,15 @@ const group_type_1 = require("./group-type");
|
|
|
5
5
|
const device_cluster_1 = require("../device-cluster");
|
|
6
6
|
const services_1 = require("../../services");
|
|
7
7
|
class BaseGroup {
|
|
8
|
+
get customName() {
|
|
9
|
+
return `${group_type_1.GroupType[this.type]} ${this.getRoom().customName}`;
|
|
10
|
+
}
|
|
8
11
|
constructor(roomName, type) {
|
|
9
12
|
this.roomName = roomName;
|
|
10
13
|
this.type = type;
|
|
14
|
+
this.settings = undefined;
|
|
11
15
|
this._deviceCluster = new device_cluster_1.DeviceCluster();
|
|
16
|
+
this.id = `${this.roomName}-${group_type_1.GroupType[this.type]}`;
|
|
12
17
|
}
|
|
13
18
|
get deviceCluster() {
|
|
14
19
|
return this._deviceCluster;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { BaseGroup } from './base-group';
|
|
2
2
|
import { iHeater, iHumiditySensor, iTemperatureSensor } from '../baseDeviceInterfaces';
|
|
3
3
|
import { AcDevice } from '../../services';
|
|
4
|
+
import { HeatGroupSettings } from '../../../models/groupSettings/heatGroupSettings';
|
|
5
|
+
import { TemperatureSettings } from '../../../models';
|
|
4
6
|
export declare class HeatGroup extends BaseGroup {
|
|
7
|
+
settings: HeatGroupSettings;
|
|
5
8
|
constructor(roomName: string, heaterIds: string[], tempSensorIds: string[], humiditySensorIds: string[], acIds: string[]);
|
|
6
9
|
/**
|
|
7
10
|
* The current measured temperature of the room in Celsius
|
|
@@ -26,5 +29,8 @@ export declare class HeatGroup extends BaseGroup {
|
|
|
26
29
|
* @param {boolean} force Whether this was a manual trigger, thus blocking automatic changes for 1 hour
|
|
27
30
|
*/
|
|
28
31
|
setAc(newDesiredState: boolean, force?: boolean): void;
|
|
32
|
+
deleteAutomaticPoint(name: string): void;
|
|
33
|
+
setAutomaticPoint(setting: TemperatureSettings): void;
|
|
29
34
|
private recalcRoomTemperatur;
|
|
35
|
+
getTargetTemperature(): number;
|
|
30
36
|
}
|
|
@@ -7,10 +7,12 @@ const device_cluster_type_1 = require("../device-cluster-type");
|
|
|
7
7
|
const device_list_1 = require("../device-list");
|
|
8
8
|
const baseDeviceInterfaces_1 = require("../baseDeviceInterfaces");
|
|
9
9
|
const services_1 = require("../../services");
|
|
10
|
+
const heatGroupSettings_1 = require("../../../models/groupSettings/heatGroupSettings");
|
|
10
11
|
const models_1 = require("../../../models");
|
|
11
12
|
class HeatGroup extends base_group_1.BaseGroup {
|
|
12
13
|
constructor(roomName, heaterIds, tempSensorIds, humiditySensorIds, acIds) {
|
|
13
14
|
super(roomName, group_type_1.GroupType.Heating);
|
|
15
|
+
this.settings = new heatGroupSettings_1.HeatGroupSettings();
|
|
14
16
|
this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.Heater, new device_list_1.DeviceList(heaterIds));
|
|
15
17
|
this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.TemperaturSensor, new device_list_1.DeviceList(tempSensorIds));
|
|
16
18
|
this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.HumiditySensor, new device_list_1.DeviceList(humiditySensorIds));
|
|
@@ -139,6 +141,12 @@ class HeatGroup extends base_group_1.BaseGroup {
|
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
143
|
}
|
|
144
|
+
deleteAutomaticPoint(name) {
|
|
145
|
+
this.settings.deleteAutomaticPoint(name, this);
|
|
146
|
+
}
|
|
147
|
+
setAutomaticPoint(setting) {
|
|
148
|
+
this.settings.setAutomaticPoint(setting, this);
|
|
149
|
+
}
|
|
142
150
|
recalcRoomTemperatur() {
|
|
143
151
|
const temp = this.temperature;
|
|
144
152
|
if (temp == baseDeviceInterfaces_1.UNDEFINED_TEMP_VALUE) {
|
|
@@ -154,5 +162,15 @@ class HeatGroup extends base_group_1.BaseGroup {
|
|
|
154
162
|
ac.onTemperaturChange(temp);
|
|
155
163
|
});
|
|
156
164
|
}
|
|
165
|
+
getTargetTemperature() {
|
|
166
|
+
if (!this.settings.automaticMode) {
|
|
167
|
+
return this.settings.manualTemperature;
|
|
168
|
+
}
|
|
169
|
+
const activeSetting = models_1.TemperatureSettings.getActiveSetting(this.settings.automaticPoints, new Date());
|
|
170
|
+
if (!activeSetting) {
|
|
171
|
+
return this.settings.manualTemperature;
|
|
172
|
+
}
|
|
173
|
+
return activeSetting.temperature;
|
|
174
|
+
}
|
|
157
175
|
}
|
|
158
176
|
exports.HeatGroup = HeatGroup;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { HmIPDevice } from './hmIpDevice';
|
|
3
3
|
import { iDisposable } from '../../services';
|
|
4
|
-
import { HeaterSettings
|
|
4
|
+
import { HeaterSettings } from '../../../models';
|
|
5
5
|
import { iHeater, iHumiditySensor, iTemperatureSensor } from '../baseDeviceInterfaces';
|
|
6
6
|
import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
7
7
|
export declare class HmIpHeizgruppe extends HmIPDevice implements iTemperatureSensor, iHumiditySensor, iHeater, iDisposable {
|
|
@@ -36,8 +36,6 @@ export declare class HmIpHeizgruppe extends HmIPDevice implements iTemperatureSe
|
|
|
36
36
|
get roomTemperature(): number;
|
|
37
37
|
set roomTemperature(value: number);
|
|
38
38
|
addHumidityCallback(pCallback: (pValue: number) => void): void;
|
|
39
|
-
deleteAutomaticPoint(name: string): void;
|
|
40
|
-
setAutomaticPoint(setting: TemperatureSettings): void;
|
|
41
39
|
getBelongingHeizungen(): iHeater[];
|
|
42
40
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
43
41
|
stopAutomaticCheck(): void;
|
|
@@ -107,12 +107,6 @@ class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
|
|
|
107
107
|
pCallback(this._humidity);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
deleteAutomaticPoint(name) {
|
|
111
|
-
this.settings.deleteAutomaticPoint(name, this);
|
|
112
|
-
}
|
|
113
|
-
setAutomaticPoint(setting) {
|
|
114
|
-
this.settings.setAutomaticPoint(setting, this);
|
|
115
|
-
}
|
|
116
110
|
getBelongingHeizungen() {
|
|
117
111
|
if (!this.room) {
|
|
118
112
|
return [];
|
|
@@ -135,14 +129,15 @@ class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
|
|
|
135
129
|
}
|
|
136
130
|
}
|
|
137
131
|
checkAutomaticChange() {
|
|
138
|
-
var _a;
|
|
132
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
139
133
|
if (!this._initialSeasonCheckDone) {
|
|
140
134
|
this.checkSeasonTurnOff();
|
|
141
135
|
}
|
|
142
|
-
|
|
136
|
+
const heatGroupSettings = (_b = (_a = this.room) === null || _a === void 0 ? void 0 : _a.HeatGroup) === null || _b === void 0 ? void 0 : _b.settings;
|
|
137
|
+
if (!this.settings.automaticMode || this.seasonTurnOff || (heatGroupSettings === null || heatGroupSettings === void 0 ? void 0 : heatGroupSettings.automaticMode) === false) {
|
|
143
138
|
return;
|
|
144
139
|
}
|
|
145
|
-
const setting = models_1.TemperatureSettings.getActiveSetting(this.settings.automaticPoints, new Date());
|
|
140
|
+
const setting = models_1.TemperatureSettings.getActiveSetting((_f = (_e = (_d = (_c = this.room) === null || _c === void 0 ? void 0 : _c.HeatGroup) === null || _d === void 0 ? void 0 : _d.settings) === null || _e === void 0 ? void 0 : _e.automaticPoints) !== null && _f !== void 0 ? _f : [], new Date());
|
|
146
141
|
if (setting === undefined) {
|
|
147
142
|
this.log(models_1.LogLevel.Warn, `Undefined Heating Timestamp.`);
|
|
148
143
|
this.desiredTemperature = this.settings.automaticFallBackTemperatur;
|
|
@@ -150,7 +145,7 @@ class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
|
|
|
150
145
|
}
|
|
151
146
|
if (this._desiredTemperature !== setting.temperature) {
|
|
152
147
|
this.log(models_1.LogLevel.Debug, `Automatische Temperaturanpassung für ${this.info.customName} auf ${setting.temperature}°C`);
|
|
153
|
-
this.desiredTemperature = (
|
|
148
|
+
this.desiredTemperature = (_g = setting.temperature) !== null && _g !== void 0 ? _g : this.settings.automaticFallBackTemperatur;
|
|
154
149
|
}
|
|
155
150
|
}
|
|
156
151
|
addTempChangeCallback(pCallback) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { ZigbeeDevice } from './zigbeeDevice';
|
|
3
3
|
import { iBatteryDevice, iHeater } from '../../baseDeviceInterfaces';
|
|
4
|
-
import { HeaterSettings
|
|
4
|
+
import { HeaterSettings } from '../../../../models';
|
|
5
5
|
import { DeviceType } from '../../deviceType';
|
|
6
6
|
import { IoBrokerDeviceInfo } from '../../IoBrokerDeviceInfo';
|
|
7
7
|
import { PIDController } from '../../../../liquid-pid';
|
|
@@ -35,8 +35,6 @@ export declare class ZigbeeHeater extends ZigbeeDevice implements iHeater, iBatt
|
|
|
35
35
|
get roomTemperature(): number;
|
|
36
36
|
set roomTemperatur(val: number);
|
|
37
37
|
checkAutomaticChange(): void;
|
|
38
|
-
deleteAutomaticPoint(name: string): void;
|
|
39
|
-
setAutomaticPoint(setting: TemperatureSettings): void;
|
|
40
38
|
stopAutomaticCheck(): void;
|
|
41
39
|
onTemperaturChange(newTemperatur: number): void;
|
|
42
40
|
persistHeater(): void;
|
|
@@ -91,13 +91,15 @@ class ZigbeeHeater extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
91
91
|
this._roomTemperature = val;
|
|
92
92
|
}
|
|
93
93
|
checkAutomaticChange() {
|
|
94
|
+
var _a, _b, _c, _d, _e, _f;
|
|
94
95
|
if (!this._initialSeasonCheckDone) {
|
|
95
96
|
this.checkSeasonTurnOff();
|
|
96
97
|
}
|
|
97
|
-
|
|
98
|
+
const heatGroupSettings = (_b = (_a = this.room) === null || _a === void 0 ? void 0 : _a.HeatGroup) === null || _b === void 0 ? void 0 : _b.settings;
|
|
99
|
+
if (!this.settings.automaticMode || this.seasonTurnOff || (heatGroupSettings === null || heatGroupSettings === void 0 ? void 0 : heatGroupSettings.automaticMode) === false) {
|
|
98
100
|
return;
|
|
99
101
|
}
|
|
100
|
-
const setting = models_1.TemperatureSettings.getActiveSetting(this.settings.automaticPoints, new Date());
|
|
102
|
+
const setting = models_1.TemperatureSettings.getActiveSetting((_f = (_e = (_d = (_c = this.room) === null || _c === void 0 ? void 0 : _c.HeatGroup) === null || _d === void 0 ? void 0 : _d.settings) === null || _e === void 0 ? void 0 : _e.automaticPoints) !== null && _f !== void 0 ? _f : [], new Date());
|
|
101
103
|
if (setting === undefined) {
|
|
102
104
|
this.log(models_1.LogLevel.Warn, `Undefined Heating Timestamp.`);
|
|
103
105
|
this.desiredTemperature = this.settings.automaticFallBackTemperatur;
|
|
@@ -108,12 +110,6 @@ class ZigbeeHeater extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
108
110
|
this.desiredTemperature = setting.temperature;
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
|
-
deleteAutomaticPoint(name) {
|
|
112
|
-
this.settings.deleteAutomaticPoint(name, this);
|
|
113
|
-
}
|
|
114
|
-
setAutomaticPoint(setting) {
|
|
115
|
-
this.settings.setAutomaticPoint(setting, this);
|
|
116
|
-
}
|
|
117
113
|
stopAutomaticCheck() {
|
|
118
114
|
if (this._iAutomaticInterval !== undefined) {
|
|
119
115
|
clearInterval(this._iAutomaticInterval);
|
|
@@ -41,14 +41,14 @@ export declare abstract class AcDevice implements iExcessEnergyConsumer, iRoomDe
|
|
|
41
41
|
* @param {number} timeout
|
|
42
42
|
*/
|
|
43
43
|
deactivateAutomaticChange(timeout?: number): void;
|
|
44
|
-
abstract setDesiredMode(mode: AcMode, writeToDevice: boolean): void;
|
|
44
|
+
abstract setDesiredMode(mode: AcMode, writeToDevice: boolean, temp?: number): void;
|
|
45
45
|
abstract turnOn(): void;
|
|
46
46
|
onTemperaturChange(newTemperatur: number): void;
|
|
47
47
|
persist(): void;
|
|
48
48
|
turnOnForExcessEnergy(): void;
|
|
49
49
|
abstract turnOff(): void;
|
|
50
50
|
turnOffDueToMissingEnergy(): void;
|
|
51
|
-
setState(mode: AcMode, forceTime?: number): void;
|
|
51
|
+
setState(mode: AcMode, desiredTemp?: number, forceTime?: number): void;
|
|
52
52
|
log(level: LogLevel, message: string, debugType?: LogDebugType): void;
|
|
53
53
|
wasActivatedByExcessEnergy(): boolean;
|
|
54
54
|
loadDeviceSettings(): void;
|
|
@@ -96,7 +96,7 @@ class AcDevice {
|
|
|
96
96
|
return this.calculateDesiredMode() !== ac_mode_1.AcMode.Off;
|
|
97
97
|
}
|
|
98
98
|
calculateDesiredMode() {
|
|
99
|
-
var _a, _b, _c, _d, _e, _f;
|
|
99
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
100
100
|
const acOn = this.on;
|
|
101
101
|
if (this.settings.manualDisabled) {
|
|
102
102
|
acOn && this.log(models_1.LogLevel.Info, `We should turn off now, as manual disable force is set.`);
|
|
@@ -107,17 +107,21 @@ class AcDevice {
|
|
|
107
107
|
acOn && this.log(models_1.LogLevel.Info, `We should turn off now, to respect night settings.`);
|
|
108
108
|
return ac_mode_1.AcMode.Off;
|
|
109
109
|
}
|
|
110
|
+
const heatGroup = (_a = this.room) === null || _a === void 0 ? void 0 : _a.HeatGroup;
|
|
110
111
|
if (this.settings.useOwnTemperatureAndAutomatic) {
|
|
111
112
|
// Device is in automatic mode so ignore energy and room temperature
|
|
112
|
-
if (
|
|
113
|
+
if ((heatGroup === null || heatGroup === void 0 ? void 0 : heatGroup.settings.automaticMode) === false) {
|
|
114
|
+
return ac_mode_1.AcMode.Auto;
|
|
115
|
+
}
|
|
116
|
+
if (settings_service_1.SettingsService.heatMode !== config_1.HeatingMode.Sommer && this.settings.heatingAllowed) {
|
|
113
117
|
return ac_mode_1.AcMode.Heating;
|
|
114
118
|
}
|
|
115
|
-
if (!this.settings.noCoolingOnMovement || ((
|
|
119
|
+
if (!this.settings.noCoolingOnMovement || ((_c = (_b = this.room) === null || _b === void 0 ? void 0 : _b.PraesenzGroup) === null || _c === void 0 ? void 0 : _c.anyPresent()) !== true) {
|
|
116
120
|
return ac_mode_1.AcMode.Cooling;
|
|
117
121
|
}
|
|
118
122
|
return ac_mode_1.AcMode.Off;
|
|
119
123
|
}
|
|
120
|
-
if (this.settings.noCoolingOnMovement && ((
|
|
124
|
+
if (this.settings.noCoolingOnMovement && ((_e = (_d = this.room) === null || _d === void 0 ? void 0 : _d.PraesenzGroup) === null || _e === void 0 ? void 0 : _e.anyPresent()) === true) {
|
|
121
125
|
return ac_mode_1.AcMode.Off;
|
|
122
126
|
}
|
|
123
127
|
const temp = this.roomTemperature;
|
|
@@ -125,17 +129,22 @@ class AcDevice {
|
|
|
125
129
|
this.log(models_1.LogLevel.Warn, `Can't calculate AC Mode as we have no room temperature`);
|
|
126
130
|
return ac_mode_1.AcMode.Off;
|
|
127
131
|
}
|
|
128
|
-
|
|
129
|
-
|
|
132
|
+
if (!heatGroup) {
|
|
133
|
+
this.log(models_1.LogLevel.Warn, `Can't calculate AC Mode as we have no heat group`);
|
|
134
|
+
return ac_mode_1.AcMode.Off;
|
|
135
|
+
}
|
|
136
|
+
let threshold = acOn ? 0.5 : 1.5;
|
|
137
|
+
let thresholdHeating = acOn ? 0.5 : 1.5;
|
|
130
138
|
let desiredMode = ac_mode_1.AcMode.Off;
|
|
131
|
-
const excessEnergy = (
|
|
139
|
+
const excessEnergy = (_g = (_f = devices_1.Devices.energymanager) === null || _f === void 0 ? void 0 : _f.excessEnergy) !== null && _g !== void 0 ? _g : -1;
|
|
132
140
|
if ((acOn ? 200 : 1000) < excessEnergy) {
|
|
133
141
|
// As there is plenty of energy to spare we plan to overshoot the target by 1 degree
|
|
134
142
|
threshold = -0.5;
|
|
135
143
|
thresholdHeating = -0.5;
|
|
136
144
|
}
|
|
137
|
-
const
|
|
138
|
-
const
|
|
145
|
+
const targetTemp = heatGroup.getTargetTemperature();
|
|
146
|
+
const coolUntil = targetTemp + threshold;
|
|
147
|
+
const heatUntil = targetTemp - thresholdHeating;
|
|
139
148
|
if (temp > coolUntil && settings_service_1.SettingsService.heatMode === config_1.HeatingMode.Sommer) {
|
|
140
149
|
desiredMode = ac_mode_1.AcMode.Cooling;
|
|
141
150
|
}
|
|
@@ -175,14 +184,14 @@ class AcDevice {
|
|
|
175
184
|
turnOffDueToMissingEnergy() {
|
|
176
185
|
this.turnOff();
|
|
177
186
|
}
|
|
178
|
-
setState(mode, forceTime = 60 * 60 * 1000) {
|
|
187
|
+
setState(mode, desiredTemp, forceTime = 60 * 60 * 1000) {
|
|
179
188
|
this.blockAutomationHandler.disableAutomatic(forceTime);
|
|
180
189
|
this._mode = mode;
|
|
181
190
|
if (mode == ac_mode_1.AcMode.Off) {
|
|
182
191
|
this.turnOff();
|
|
183
192
|
return;
|
|
184
193
|
}
|
|
185
|
-
this.setDesiredMode(mode, false);
|
|
194
|
+
this.setDesiredMode(mode, false, desiredTemp);
|
|
186
195
|
this.turnOn();
|
|
187
196
|
}
|
|
188
197
|
log(level, message, debugType = log_service_1.LogDebugType.None) {
|
|
@@ -207,7 +216,6 @@ class AcDevice {
|
|
|
207
216
|
}, 5000, this);
|
|
208
217
|
}
|
|
209
218
|
automaticCheck() {
|
|
210
|
-
var _a;
|
|
211
219
|
if (this.blockAutomationHandler.automaticBlockActive) {
|
|
212
220
|
// We aren't allowed to turn on or off anyway --> exit
|
|
213
221
|
return;
|
|
@@ -217,11 +225,7 @@ class AcDevice {
|
|
|
217
225
|
// Device already in desired state --> do nothing
|
|
218
226
|
return;
|
|
219
227
|
}
|
|
220
|
-
|
|
221
|
-
this.setDesiredMode(ac_mode_1.AcMode.Heating, false);
|
|
222
|
-
this.turnOn();
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
228
|
+
this.setDesiredMode(desiredMode, false);
|
|
225
229
|
if (desiredMode == ac_mode_1.AcMode.Off) {
|
|
226
230
|
this.turnOff();
|
|
227
231
|
return;
|
|
@@ -4,7 +4,6 @@ import { AcMode } from './ac-mode';
|
|
|
4
4
|
import { DeviceType } from '../../devices';
|
|
5
5
|
export declare class OwnDaikinDevice extends AcDevice {
|
|
6
6
|
desiredState: boolean;
|
|
7
|
-
desiredTemp: number;
|
|
8
7
|
desiredHum: number | 'AUTO';
|
|
9
8
|
desiredMode: number;
|
|
10
9
|
deviceType: DeviceType;
|
|
@@ -14,7 +13,7 @@ export declare class OwnDaikinDevice extends AcDevice {
|
|
|
14
13
|
get device(): DaikinAC | undefined;
|
|
15
14
|
get on(): boolean;
|
|
16
15
|
set device(device: DaikinAC | undefined);
|
|
17
|
-
setDesiredMode(mode: AcMode, writeToDevice?: boolean): void;
|
|
16
|
+
setDesiredMode(mode: AcMode, writeToDevice?: boolean, desiredTemp?: number): void;
|
|
18
17
|
turnOn(): void;
|
|
19
18
|
turnOff(): void;
|
|
20
19
|
protected automaticCheck(): void;
|
|
@@ -15,7 +15,6 @@ class OwnDaikinDevice extends ac_device_1.AcDevice {
|
|
|
15
15
|
constructor(name, roomName, ip, device) {
|
|
16
16
|
super(name, roomName, ip, acDeviceType_1.AcDeviceType.Daikin);
|
|
17
17
|
this.desiredState = daikin_controller_1.Power.OFF;
|
|
18
|
-
this.desiredTemp = 21;
|
|
19
18
|
this.desiredHum = 'AUTO';
|
|
20
19
|
this.desiredMode = daikin_controller_1.Mode.COLD;
|
|
21
20
|
this.deviceType = devices_1.DeviceType.Daikin;
|
|
@@ -41,7 +40,7 @@ class OwnDaikinDevice extends ac_device_1.AcDevice {
|
|
|
41
40
|
}
|
|
42
41
|
void this.updateInfo();
|
|
43
42
|
}
|
|
44
|
-
setDesiredMode(mode, writeToDevice = true) {
|
|
43
|
+
setDesiredMode(mode, writeToDevice = true, desiredTemp) {
|
|
45
44
|
let newMode = -1;
|
|
46
45
|
switch (mode) {
|
|
47
46
|
case ac_mode_1.AcMode.Heating:
|
|
@@ -60,7 +59,7 @@ class OwnDaikinDevice extends ac_device_1.AcDevice {
|
|
|
60
59
|
this.desiredMode = newMode;
|
|
61
60
|
this._mode = mode;
|
|
62
61
|
if (writeToDevice) {
|
|
63
|
-
this.setDesiredInfo();
|
|
62
|
+
this.setDesiredInfo(false, desiredTemp);
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
turnOn() {
|
|
@@ -81,22 +80,22 @@ class OwnDaikinDevice extends ac_device_1.AcDevice {
|
|
|
81
80
|
super.automaticCheck();
|
|
82
81
|
});
|
|
83
82
|
}
|
|
84
|
-
setDesiredInfo(retry = false) {
|
|
85
|
-
var _a;
|
|
86
|
-
let targetTemp = this.
|
|
83
|
+
setDesiredInfo(retry = false, forceTemp) {
|
|
84
|
+
var _a, _b, _c, _d;
|
|
85
|
+
let targetTemp = (_c = (_b = (_a = this.room) === null || _a === void 0 ? void 0 : _a.HeatGroup) === null || _b === void 0 ? void 0 : _b.getTargetTemperature()) !== null && _c !== void 0 ? _c : 21;
|
|
87
86
|
if (this.desiredMode == daikin_controller_1.Mode.HOT) {
|
|
88
|
-
targetTemp = this.settings.useOwnTemperatureAndAutomatic ?
|
|
87
|
+
targetTemp = this.settings.useOwnTemperatureAndAutomatic ? targetTemp + 1 : 29;
|
|
89
88
|
}
|
|
90
89
|
else if (this.desiredMode == daikin_controller_1.Mode.COLD) {
|
|
91
|
-
targetTemp = this.settings.useOwnTemperatureAndAutomatic ?
|
|
90
|
+
targetTemp = this.settings.useOwnTemperatureAndAutomatic ? targetTemp - 1 : 16;
|
|
92
91
|
}
|
|
93
92
|
const changeObject = {
|
|
94
93
|
power: this.desiredState,
|
|
95
94
|
mode: this.desiredMode,
|
|
96
95
|
targetHumidity: this.desiredHum,
|
|
97
|
-
targetTemperature: targetTemp,
|
|
96
|
+
targetTemperature: forceTemp !== null && forceTemp !== void 0 ? forceTemp : targetTemp,
|
|
98
97
|
};
|
|
99
|
-
(
|
|
98
|
+
(_d = this.device) === null || _d === void 0 ? void 0 : _d.setACControlInfo(changeObject, (err, res) => {
|
|
100
99
|
var _a;
|
|
101
100
|
if (err !== null) {
|
|
102
101
|
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Warn, `Setting Ac Info for ${this.name} failed: ${err} `);
|