hoffmation-base 3.0.0-beta.3 → 3.0.0-beta.5
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/dachsSettings.d.ts +8 -0
- package/lib/models/deviceSettings/dachsSettings.js +12 -1
- package/lib/server/devices/dachs/dachs.d.ts +3 -1
- package/lib/server/devices/dachs/dachs.js +19 -5
- package/lib/server/devices/device-cluster.js +6 -0
- package/lib/server/devices/deviceType.d.ts +1 -0
- package/lib/server/devices/deviceType.js +1 -0
- package/lib/server/devices/devices.js +3 -0
- package/lib/server/devices/zigbee/index.d.ts +1 -0
- package/lib/server/devices/zigbee/index.js +3 -0
- package/lib/server/devices/zigbee/zigbeeSodaHandle.js +2 -2
- package/lib/server/devices/zigbee/zigbeeTuyaMotion.d.ts +7 -0
- package/lib/server/devices/zigbee/zigbeeTuyaMotion.js +18 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -37,6 +37,14 @@ export declare class DachsDeviceSettings extends ActuatorSettings {
|
|
|
37
37
|
* Defines the desired minimum temperature for warm water.
|
|
38
38
|
*/
|
|
39
39
|
warmWaterDesiredMinTemp: number;
|
|
40
|
+
/**
|
|
41
|
+
* Defines the desired minimum temperature for heat storage during winter.
|
|
42
|
+
*/
|
|
43
|
+
winterMinimumHeatStorageTemp: number;
|
|
44
|
+
/**
|
|
45
|
+
* Defines the desired minimum temperature for heat storage during winter.
|
|
46
|
+
*/
|
|
47
|
+
winterMinimumPreNightHeatStorageTemp: number;
|
|
40
48
|
fromPartialObject(data: Partial<DachsDeviceSettings>): void;
|
|
41
49
|
protected toJSON(): Partial<DachsDeviceSettings>;
|
|
42
50
|
}
|
|
@@ -43,9 +43,17 @@ class DachsDeviceSettings extends actuatorSettings_1.ActuatorSettings {
|
|
|
43
43
|
* Defines the desired minimum temperature for warm water.
|
|
44
44
|
*/
|
|
45
45
|
this.warmWaterDesiredMinTemp = 45;
|
|
46
|
+
/**
|
|
47
|
+
* Defines the desired minimum temperature for heat storage during winter.
|
|
48
|
+
*/
|
|
49
|
+
this.winterMinimumHeatStorageTemp = 55;
|
|
50
|
+
/**
|
|
51
|
+
* Defines the desired minimum temperature for heat storage during winter.
|
|
52
|
+
*/
|
|
53
|
+
this.winterMinimumPreNightHeatStorageTemp = 65;
|
|
46
54
|
}
|
|
47
55
|
fromPartialObject(data) {
|
|
48
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
56
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
49
57
|
this.refreshIntervalTime = (_a = data.refreshIntervalTime) !== null && _a !== void 0 ? _a : this.refreshIntervalTime;
|
|
50
58
|
this.batteryLevelBeforeNightTurnOnThreshold =
|
|
51
59
|
(_b = data.batteryLevelBeforeNightTurnOnThreshold) !== null && _b !== void 0 ? _b : this.batteryLevelBeforeNightTurnOnThreshold;
|
|
@@ -55,6 +63,9 @@ class DachsDeviceSettings extends actuatorSettings_1.ActuatorSettings {
|
|
|
55
63
|
(_e = data.batteryLevelPreventStartThreshold) !== null && _e !== void 0 ? _e : this.batteryLevelPreventStartThreshold;
|
|
56
64
|
this.batteryLevelAllowStartThreshold = (_f = data.batteryLevelAllowStartThreshold) !== null && _f !== void 0 ? _f : this.batteryLevelAllowStartThreshold;
|
|
57
65
|
this.warmWaterDesiredMinTemp = (_g = data.warmWaterDesiredMinTemp) !== null && _g !== void 0 ? _g : this.warmWaterDesiredMinTemp;
|
|
66
|
+
this.winterMinimumHeatStorageTemp = (_h = data.winterMinimumHeatStorageTemp) !== null && _h !== void 0 ? _h : this.winterMinimumHeatStorageTemp;
|
|
67
|
+
this.winterMinimumPreNightHeatStorageTemp =
|
|
68
|
+
(_j = data.winterMinimumPreNightHeatStorageTemp) !== null && _j !== void 0 ? _j : this.winterMinimumPreNightHeatStorageTemp;
|
|
58
69
|
super.fromPartialObject(data);
|
|
59
70
|
}
|
|
60
71
|
toJSON() {
|
|
@@ -87,7 +87,9 @@ export declare class Dachs implements iBaseDevice, iActuator {
|
|
|
87
87
|
*/
|
|
88
88
|
private onBatteryLevelChange;
|
|
89
89
|
private checkAllDesiredStates;
|
|
90
|
-
private
|
|
90
|
+
private onHeatStorageTempChange;
|
|
91
|
+
private onWarmWaterTempChange;
|
|
92
|
+
private checkWwPumpDesiredState;
|
|
91
93
|
private checkHeatingRod;
|
|
92
94
|
private shouldDachsBeStarted;
|
|
93
95
|
private checkAlternativeActuator;
|
|
@@ -63,8 +63,8 @@ class Dachs {
|
|
|
63
63
|
const energyManager = devices_1.Devices.energymanager;
|
|
64
64
|
energyManager.battery.addBatteryLevelCallback(this.onBatteryLevelChange.bind(this));
|
|
65
65
|
}
|
|
66
|
-
this.warmWaterSensor.addTempChangeCallback(this.
|
|
67
|
-
this.heatStorageTempSensor.addTempChangeCallback(this.
|
|
66
|
+
this.warmWaterSensor.addTempChangeCallback(this.onWarmWaterTempChange.bind(this));
|
|
67
|
+
this.heatStorageTempSensor.addTempChangeCallback(this.onHeatStorageTempChange.bind(this));
|
|
68
68
|
}
|
|
69
69
|
/** @inheritDoc */
|
|
70
70
|
get info() {
|
|
@@ -220,6 +220,7 @@ class Dachs {
|
|
|
220
220
|
const shouldDachsBeStarted = this.shouldDachsBeStarted(action, batteryLevel);
|
|
221
221
|
this.checkHeatingRod(action, batteryLevel);
|
|
222
222
|
this.checkAlternativeActuator(shouldDachsBeStarted, action);
|
|
223
|
+
this.checkWwPumpDesiredState(action);
|
|
223
224
|
if (!shouldDachsBeStarted) {
|
|
224
225
|
return;
|
|
225
226
|
}
|
|
@@ -227,7 +228,15 @@ class Dachs {
|
|
|
227
228
|
setStateCommand.overrideCommandSource = models_1.CommandSource.Force;
|
|
228
229
|
this.setActuator(setStateCommand);
|
|
229
230
|
}
|
|
230
|
-
|
|
231
|
+
onHeatStorageTempChange(action) {
|
|
232
|
+
var _a, _b;
|
|
233
|
+
this.checkAllDesiredStates(action, (_b = (_a = devices_1.Devices.energymanager) === null || _a === void 0 ? void 0 : _a.batteryLevel) !== null && _b !== void 0 ? _b : 0);
|
|
234
|
+
}
|
|
235
|
+
onWarmWaterTempChange(action) {
|
|
236
|
+
var _a, _b;
|
|
237
|
+
this.checkAllDesiredStates(action, (_b = (_a = devices_1.Devices.energymanager) === null || _a === void 0 ? void 0 : _a.batteryLevel) !== null && _b !== void 0 ? _b : 0);
|
|
238
|
+
}
|
|
239
|
+
checkWwPumpDesiredState(action) {
|
|
231
240
|
var _a, _b;
|
|
232
241
|
if (this.warmWaterPump === undefined) {
|
|
233
242
|
// We have no control over the warm water pump --> nothing to do
|
|
@@ -288,7 +297,7 @@ class Dachs {
|
|
|
288
297
|
this.heatingRod.setActuator(setAction);
|
|
289
298
|
}
|
|
290
299
|
shouldDachsBeStarted(action, batteryLevel) {
|
|
291
|
-
var _a;
|
|
300
|
+
var _a, _b;
|
|
292
301
|
if (this.blockDachsStart !== undefined) {
|
|
293
302
|
if (batteryLevel > this.settings.batteryLevelPreventStartThreshold) {
|
|
294
303
|
const blockAction = new models_1.ActuatorSetStateCommand(action, true, `Battery reached ${batteryLevel}%, Dachs should not run any more`, null);
|
|
@@ -301,7 +310,7 @@ class Dachs {
|
|
|
301
310
|
this.blockDachsStart.setActuator(liftAction);
|
|
302
311
|
}
|
|
303
312
|
else if (((_a = services_1.SettingsService.settings.heaterSettings) === null || _a === void 0 ? void 0 : _a.mode) === config_1.HeatingMode.Winter &&
|
|
304
|
-
this.heatStorageTempSensor.temperatureSensor.temperature <
|
|
313
|
+
this.heatStorageTempSensor.temperatureSensor.temperature < this.settings.winterMinimumPreNightHeatStorageTemp &&
|
|
305
314
|
services_1.Utils.dateByTimeSpan(21, 30) < new Date()) {
|
|
306
315
|
const liftWinterAction = new models_1.ActuatorSetStateCommand(action, false, `Battery at ${batteryLevel}% but it is winter, we are nearing night and heat storage is kinda cold: Dachs is now allowed to run if needed`, null);
|
|
307
316
|
this.blockDachsStart.setActuator(liftWinterAction);
|
|
@@ -315,6 +324,11 @@ class Dachs {
|
|
|
315
324
|
// We are already running
|
|
316
325
|
return false;
|
|
317
326
|
}
|
|
327
|
+
if (((_b = services_1.SettingsService.settings.heaterSettings) === null || _b === void 0 ? void 0 : _b.mode) === config_1.HeatingMode.Winter &&
|
|
328
|
+
this.heatStorageTempSensor.temperatureSensor.temperature < this.settings.winterMinimumHeatStorageTemp) {
|
|
329
|
+
// It is winter and heat storage is kinda cold --> Start
|
|
330
|
+
return true;
|
|
331
|
+
}
|
|
318
332
|
const dayType = services_1.TimeCallbackService.dayType(new services_1.SunTimeOffsets());
|
|
319
333
|
if ((dayType === models_1.TimeOfDay.Daylight || dayType === models_1.TimeOfDay.BeforeSunrise) &&
|
|
320
334
|
batteryLevel > this.settings.batteryLevelTurnOnThreshold) {
|
|
@@ -65,6 +65,11 @@ class DeviceCluster {
|
|
|
65
65
|
case deviceType_1.DeviceType.HmIpGriff:
|
|
66
66
|
clusterTypes.push(device_cluster_type_1.DeviceClusterType.Handle);
|
|
67
67
|
break;
|
|
68
|
+
case deviceType_1.DeviceType.ZigbeeSodaHandle:
|
|
69
|
+
clusterTypes.push(device_cluster_type_1.DeviceClusterType.Handle);
|
|
70
|
+
clusterTypes.push(device_cluster_type_1.DeviceClusterType.TemperaturSensor);
|
|
71
|
+
clusterTypes.push(device_cluster_type_1.DeviceClusterType.HumiditySensor);
|
|
72
|
+
break;
|
|
68
73
|
case deviceType_1.DeviceType.HmIpHeizgruppe:
|
|
69
74
|
clusterTypes.push(device_cluster_type_1.DeviceClusterType.Heater);
|
|
70
75
|
clusterTypes.push(device_cluster_type_1.DeviceClusterType.TemperaturSensor);
|
|
@@ -78,6 +83,7 @@ class DeviceCluster {
|
|
|
78
83
|
case deviceType_1.DeviceType.HmIpBewegung:
|
|
79
84
|
case deviceType_1.DeviceType.ZigbeeAquaraMotion:
|
|
80
85
|
case deviceType_1.DeviceType.ZigbeeSonoffMotion:
|
|
86
|
+
case deviceType_1.DeviceType.ZigbeeTuyaMotion:
|
|
81
87
|
case deviceType_1.DeviceType.HmIpPraezenz:
|
|
82
88
|
clusterTypes.push(device_cluster_type_1.DeviceClusterType.MotionDetection);
|
|
83
89
|
break;
|
|
@@ -43,6 +43,7 @@ var DeviceType;
|
|
|
43
43
|
DeviceType[DeviceType["ZigbeeUbisysLampe"] = 225] = "ZigbeeUbisysLampe";
|
|
44
44
|
DeviceType[DeviceType["ZigbeeInnr142C"] = 226] = "ZigbeeInnr142C";
|
|
45
45
|
DeviceType[DeviceType["ZigbeeSodaHandle"] = 227] = "ZigbeeSodaHandle";
|
|
46
|
+
DeviceType[DeviceType["ZigbeeTuyaMotion"] = 228] = "ZigbeeTuyaMotion";
|
|
46
47
|
DeviceType[DeviceType["JsEnergyManager"] = 301] = "JsEnergyManager";
|
|
47
48
|
DeviceType[DeviceType["RoomScene"] = 401] = "RoomScene";
|
|
48
49
|
DeviceType[DeviceType["ShellyTrv"] = 402] = "ShellyTrv";
|
|
@@ -223,6 +223,9 @@ class Devices {
|
|
|
223
223
|
case 'TuyaValve':
|
|
224
224
|
d = new zigbee_1.ZigbeeTuyaValve(zigbeeInfo);
|
|
225
225
|
break;
|
|
226
|
+
case 'TuyaMotion':
|
|
227
|
+
d = new zigbee_1.ZigbeeTuyaMotion(zigbeeInfo);
|
|
228
|
+
break;
|
|
226
229
|
case 'EuroHeater':
|
|
227
230
|
d = new zigbee_1.ZigbeeEuroHeater(zigbeeInfo);
|
|
228
231
|
break;
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ZigbeeTuyaMotion = void 0;
|
|
17
18
|
__exportStar(require("./BaseDevices/index"), exports);
|
|
18
19
|
__exportStar(require("./zigbeeAqaraMagnetContact"), exports);
|
|
19
20
|
__exportStar(require("./zigbeeAqaraOpple3Switch"), exports);
|
|
@@ -41,3 +42,5 @@ __exportStar(require("./zigbeeTuyaValve"), exports);
|
|
|
41
42
|
__exportStar(require("./zigbeeUbisysActuator"), exports);
|
|
42
43
|
__exportStar(require("./zigbeeUbisysLampe"), exports);
|
|
43
44
|
__exportStar(require("./zigbeeUbisysShutter"), exports);
|
|
45
|
+
var zigbeeTuyaMotion_1 = require("./zigbeeTuyaMotion");
|
|
46
|
+
Object.defineProperty(exports, "ZigbeeTuyaMotion", { enumerable: true, get: function () { return zigbeeTuyaMotion_1.ZigbeeTuyaMotion; } });
|
|
@@ -81,7 +81,7 @@ class ZigbeeSodaHandle extends BaseDevices_1.ZigbeeWindowHandle {
|
|
|
81
81
|
if (!this.window) {
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
|
-
const command = new models_1.WindowSetDesiredPositionCommand(models_1.CommandSource.Manual,
|
|
84
|
+
const command = new models_1.WindowSetDesiredPositionCommand(models_1.CommandSource.Manual, 100, 'Button on handle was pressed');
|
|
85
85
|
this.window.setDesiredPosition(command);
|
|
86
86
|
}
|
|
87
87
|
onButtonRightPressed() {
|
|
@@ -89,7 +89,7 @@ class ZigbeeSodaHandle extends BaseDevices_1.ZigbeeWindowHandle {
|
|
|
89
89
|
if (!this.window) {
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
|
-
const command = new models_1.WindowSetDesiredPositionCommand(models_1.CommandSource.Manual,
|
|
92
|
+
const command = new models_1.WindowSetDesiredPositionCommand(models_1.CommandSource.Manual, 0, 'Button on handle was pressed');
|
|
93
93
|
this.window.setDesiredPosition(command);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ZigbeeMotionSensor } from './BaseDevices';
|
|
2
|
+
import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
3
|
+
export declare class ZigbeeTuyaMotion extends ZigbeeMotionSensor {
|
|
4
|
+
constructor(pInfo: IoBrokerDeviceInfo);
|
|
5
|
+
/** @inheritDoc */
|
|
6
|
+
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ZigbeeTuyaMotion = void 0;
|
|
4
|
+
const BaseDevices_1 = require("./BaseDevices");
|
|
5
|
+
const deviceType_1 = require("../deviceType");
|
|
6
|
+
const models_1 = require("../../../models");
|
|
7
|
+
class ZigbeeTuyaMotion extends BaseDevices_1.ZigbeeMotionSensor {
|
|
8
|
+
constructor(pInfo) {
|
|
9
|
+
super(pInfo, deviceType_1.DeviceType.ZigbeeTuyaMotion);
|
|
10
|
+
this._needsMovementResetFallback = false;
|
|
11
|
+
}
|
|
12
|
+
/** @inheritDoc */
|
|
13
|
+
update(idSplit, state, initial = false) {
|
|
14
|
+
this.log(models_1.LogLevel.DeepTrace, `Motion update: ID: ${idSplit.join('.')} JSON: ${JSON.stringify(state)}`);
|
|
15
|
+
super.update(idSplit, state, initial, true);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.ZigbeeTuyaMotion = ZigbeeTuyaMotion;
|