hoffmation-base 3.8.0 → 4.1.0
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/action/index.d.ts +1 -0
- package/lib/action/index.js +3 -1
- package/lib/action/soilSensorChangeAction.d.ts +16 -0
- package/lib/action/soilSensorChangeAction.js +15 -0
- package/lib/devices/dachs/dachs.d.ts +79 -2
- package/lib/devices/dachs/dachs.js +214 -18
- package/lib/devices/device-cluster.js +7 -0
- package/lib/devices/devices.d.ts +36 -1
- package/lib/devices/devices.js +67 -0
- package/lib/devices/jsObject/jsObjectEnergyManager.d.ts +16 -1
- package/lib/devices/jsObject/jsObjectEnergyManager.js +23 -0
- package/lib/devices/sharedFunctions/index.d.ts +1 -0
- package/lib/devices/sharedFunctions/index.js +1 -0
- package/lib/devices/sharedFunctions/soilSensor.d.ts +23 -0
- package/lib/devices/sharedFunctions/soilSensor.js +58 -0
- package/lib/devices/victron/victron-device.d.ts +83 -1
- package/lib/devices/victron/victron-device.js +151 -2
- package/lib/devices/victron/victron-morning-release.d.ts +16 -0
- package/lib/devices/victron/victron-morning-release.js +2 -0
- package/lib/devices/zigbee/BaseDevices/index.d.ts +1 -0
- package/lib/devices/zigbee/BaseDevices/index.js +1 -0
- package/lib/devices/zigbee/BaseDevices/zigbeeSoilSensor.d.ts +33 -0
- package/lib/devices/zigbee/BaseDevices/zigbeeSoilSensor.js +62 -0
- package/lib/devices/zigbee/index.d.ts +1 -0
- package/lib/devices/zigbee/index.js +1 -0
- package/lib/devices/zigbee/zigbeeCooloSoilSensor.d.ts +44 -0
- package/lib/devices/zigbee/zigbeeCooloSoilSensor.js +81 -0
- package/lib/enums/DeviceCapability.d.ts +2 -0
- package/lib/enums/DeviceCapability.js +2 -0
- package/lib/enums/commandType.d.ts +1 -0
- package/lib/enums/commandType.js +1 -0
- package/lib/enums/device-cluster-type.d.ts +2 -1
- package/lib/enums/device-cluster-type.js +1 -0
- package/lib/enums/deviceType.d.ts +1 -0
- package/lib/enums/deviceType.js +1 -0
- package/lib/interfaces/baseDevices/iAirQualityCollector.d.ts +2 -1
- package/lib/interfaces/baseDevices/iAirQualityReadings.d.ts +50 -0
- package/lib/interfaces/baseDevices/iAirQualityReadings.js +2 -0
- package/lib/interfaces/baseDevices/iAirQualitySensor.d.ts +1 -54
- package/lib/interfaces/baseDevices/iAirQualitySensor.js +0 -5
- package/lib/interfaces/baseDevices/iEnergyManager.d.ts +43 -0
- package/lib/interfaces/baseDevices/iHumidityCollector.d.ts +0 -1
- package/lib/interfaces/baseDevices/iHumidityCollector.js +0 -2
- package/lib/interfaces/baseDevices/iSoilCollector.d.ts +23 -0
- package/lib/interfaces/baseDevices/iSoilCollector.js +2 -0
- package/lib/interfaces/baseDevices/iSoilSensor.d.ts +32 -0
- package/lib/interfaces/baseDevices/iSoilSensor.js +2 -0
- package/lib/interfaces/baseDevices/iTemperatureCollector.d.ts +0 -1
- package/lib/interfaces/baseDevices/iTemperatureCollector.js +0 -2
- package/lib/interfaces/baseDevices/index.d.ts +7 -0
- package/lib/interfaces/baseDevices/index.js +7 -0
- package/lib/interfaces/baseDevices/undefinedAirQualityValue.d.ts +4 -0
- package/lib/interfaces/baseDevices/undefinedAirQualityValue.js +7 -0
- package/lib/interfaces/baseDevices/undefinedHumidityValue.d.ts +4 -0
- package/lib/interfaces/baseDevices/undefinedHumidityValue.js +7 -0
- package/lib/interfaces/baseDevices/undefinedSoilMoistureValue.d.ts +6 -0
- package/lib/interfaces/baseDevices/undefinedSoilMoistureValue.js +9 -0
- package/lib/interfaces/baseDevices/undefinedTempValue.d.ts +4 -0
- package/lib/interfaces/baseDevices/undefinedTempValue.js +7 -0
- package/lib/interfaces/dachs/KeyListEntity.d.ts +0 -5
- package/lib/interfaces/dachs/KeyListEntityResponse.d.ts +6 -0
- package/lib/interfaces/dachs/KeyListEntityResponse.js +2 -0
- package/lib/interfaces/dachs/index.d.ts +1 -0
- package/lib/interfaces/dachs/index.js +1 -0
- package/lib/interfaces/deviceSettings/iDachsDeviceSettings.d.ts +15 -0
- package/lib/interfaces/iActuatorStateSample.d.ts +13 -0
- package/lib/interfaces/iActuatorStateSample.js +2 -0
- package/lib/interfaces/iBatteryLevelSample.d.ts +13 -0
- package/lib/interfaces/iBatteryLevelSample.js +2 -0
- package/lib/interfaces/iConsumptionWindowSample.d.ts +26 -0
- package/lib/interfaces/iConsumptionWindowSample.js +2 -0
- package/lib/interfaces/iDachsHistoryGateResult.d.ts +29 -0
- package/lib/interfaces/iDachsHistoryGateResult.js +2 -0
- package/lib/interfaces/iEnergyHistoryBasis.d.ts +26 -0
- package/lib/interfaces/iEnergyHistoryBasis.js +2 -0
- package/lib/interfaces/iEnergyHistoryEstimate.d.ts +21 -0
- package/lib/interfaces/iEnergyHistoryEstimate.js +2 -0
- package/lib/interfaces/iEnergyHistoryFeatures.d.ts +21 -0
- package/lib/interfaces/iEnergyHistoryFeatures.js +2 -0
- package/lib/interfaces/iEnergyHistoryModel.d.ts +21 -0
- package/lib/interfaces/iEnergyHistoryModel.js +2 -0
- package/lib/interfaces/iEnergyHistoryOptions.d.ts +29 -0
- package/lib/interfaces/iEnergyHistoryOptions.js +2 -0
- package/lib/interfaces/iEnergyHistoryOutlook.d.ts +41 -0
- package/lib/interfaces/iEnergyHistoryOutlook.js +2 -0
- package/lib/interfaces/iEnergyHistorySample.d.ts +19 -0
- package/lib/interfaces/iEnergyHistorySample.js +2 -0
- package/lib/interfaces/iFossilGeneratorRun.d.ts +22 -0
- package/lib/interfaces/iFossilGeneratorRun.js +2 -0
- package/lib/interfaces/iFossilGeneratorSource.d.ts +21 -0
- package/lib/interfaces/iFossilGeneratorSource.js +2 -0
- package/lib/interfaces/iMorningReserveVerdict.d.ts +38 -0
- package/lib/interfaces/iMorningReserveVerdict.js +2 -0
- package/lib/interfaces/iPersist.d.ts +69 -1
- package/lib/interfaces/iProjectedSocBand.d.ts +7 -0
- package/lib/interfaces/iProjectedSocBand.js +2 -0
- package/lib/interfaces/iSoilMoistureSample.d.ts +13 -0
- package/lib/interfaces/iSoilMoistureSample.js +2 -0
- package/lib/interfaces/iWeatherDaySummary.d.ts +33 -0
- package/lib/interfaces/iWeatherDaySummary.js +2 -0
- package/lib/interfaces/index.d.ts +17 -0
- package/lib/interfaces/index.js +17 -0
- package/lib/services/dbo/actuator-state-row.d.ts +14 -0
- package/lib/services/dbo/actuator-state-row.js +2 -0
- package/lib/services/dbo/battery-level-row.d.ts +16 -0
- package/lib/services/dbo/battery-level-row.js +2 -0
- package/lib/services/dbo/energy-consumption-row.d.ts +16 -0
- package/lib/services/dbo/energy-consumption-row.js +2 -0
- package/lib/services/dbo/postgreSqlPersist.d.ts +52 -1
- package/lib/services/dbo/postgreSqlPersist.js +392 -27
- package/lib/services/dbo/soil-moisture-row.d.ts +14 -0
- package/lib/services/dbo/soil-moisture-row.js +2 -0
- package/lib/services/dbo/weather-day-summary-row.d.ts +20 -0
- package/lib/services/dbo/weather-day-summary-row.js +2 -0
- package/lib/services/energy/energy-history-service.d.ts +168 -0
- package/lib/services/energy/energy-history-service.js +499 -0
- package/lib/services/energy/index.d.ts +1 -0
- package/lib/services/energy/index.js +17 -0
- package/lib/services/energy/plant-energy-dials.d.ts +22 -0
- package/lib/services/energy/plant-energy-dials.js +2 -0
- package/lib/services/https-service.d.ts +48 -2
- package/lib/services/https-service.js +136 -10
- package/lib/services/index.d.ts +1 -0
- package/lib/services/index.js +1 -0
- package/lib/services/time-callback-service.d.ts +12 -0
- package/lib/services/time-callback-service.js +16 -2
- package/lib/services/weather/index.d.ts +1 -0
- package/lib/services/weather/index.js +1 -0
- package/lib/services/weather/open-weather-day-summary.d.ts +25 -0
- package/lib/services/weather/open-weather-day-summary.js +2 -0
- package/lib/services/weather/weather-day-summary-fetcher.d.ts +6 -0
- package/lib/services/weather/weather-day-summary-fetcher.js +2 -0
- package/lib/services/weather/weather-history-backfill.d.ts +94 -0
- package/lib/services/weather/weather-history-backfill.js +247 -0
- package/lib/services/weather/weather-service.js +29 -4
- package/lib/settings-service-instance.js +5 -2
- package/lib/settingsObjects/deviceSettings/dachsSettings.d.ts +6 -0
- package/lib/settingsObjects/deviceSettings/dachsSettings.js +14 -1
- package/lib/settingsObjects/deviceSettings/victronDeviceSettings.d.ts +116 -0
- package/lib/settingsObjects/deviceSettings/victronDeviceSettings.js +150 -5
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/dayMs.d.ts +7 -0
- package/lib/utils/dayMs.js +10 -0
- package/lib/utils/energy-history-dials.d.ts +19 -0
- package/lib/utils/energy-history-dials.js +2 -0
- package/lib/utils/energy-history-utils.d.ts +143 -0
- package/lib/utils/energy-history-utils.js +470 -0
- package/lib/utils/energy-manager-utils.d.ts +123 -1
- package/lib/utils/energy-manager-utils.js +226 -0
- package/lib/utils/index.d.ts +4 -0
- package/lib/utils/index.js +4 -0
- package/lib/utils/model-shadow.d.ts +61 -0
- package/lib/utils/model-shadow.js +83 -0
- package/lib/utils/morning-reserve-dials.d.ts +21 -0
- package/lib/utils/morning-reserve-dials.js +2 -0
- package/lib/utils/morning-verdict.d.ts +5 -0
- package/lib/utils/morning-verdict.js +2 -0
- package/lib/utils/utils.d.ts +0 -1
- package/lib/utils/utils.js +5 -5
- package/package.json +3 -2
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { iHumidityCollector, iHumiditySensor, iTemperatureCollector } from '../../interfaces';
|
|
2
|
+
import { HumiditySensorChangeAction, TemperatureSensorChangeAction } from '../../action';
|
|
3
|
+
import { ZigbeeSoilSensor } from './BaseDevices';
|
|
4
|
+
import { TemperatureSensor } from '../sharedFunctions';
|
|
5
|
+
import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
6
|
+
/**
|
|
7
|
+
* The COOLO CS-201Z soil sensor.
|
|
8
|
+
*
|
|
9
|
+
* Beyond the soil moisture and battery of {@link ZigbeeSoilSensor} it measures the air around it, so it adds
|
|
10
|
+
* the ambient temperature and humidity axes. Those are three separate quantities: `soil_moisture` and
|
|
11
|
+
* `humidity` are both percentages and can be told apart by nothing but which state they arrived on - the
|
|
12
|
+
* device reported 15 % soil against 91 % air on the same message.
|
|
13
|
+
*
|
|
14
|
+
* The configuration states the device exposes (`soil_calibration`, `soil_warning`, `temperature_calibration`,
|
|
15
|
+
* `temperature_sampling`, `soil_sampling`, `temperature_unit`) and the `dry` flag it derives from its own
|
|
16
|
+
* threshold are deliberately not mapped. They stay reachable through `stateMap` and `send_payload`.
|
|
17
|
+
*/
|
|
18
|
+
export declare class ZigbeeCooloSoilSensor extends ZigbeeSoilSensor implements iTemperatureCollector, iHumidityCollector {
|
|
19
|
+
/** @inheritDoc */
|
|
20
|
+
temperatureSensor: TemperatureSensor;
|
|
21
|
+
/** @inheritDoc */
|
|
22
|
+
humiditySensor: iHumiditySensor;
|
|
23
|
+
constructor(pInfo: IoBrokerDeviceInfo);
|
|
24
|
+
/** @inheritDoc */
|
|
25
|
+
get roomTemperature(): number;
|
|
26
|
+
/** @inheritDoc */
|
|
27
|
+
set roomTemperature(value: number);
|
|
28
|
+
/** @inheritDoc */
|
|
29
|
+
get humidity(): number;
|
|
30
|
+
/** @inheritDoc */
|
|
31
|
+
get iTemperature(): number;
|
|
32
|
+
/** @inheritDoc */
|
|
33
|
+
get sTemperature(): string;
|
|
34
|
+
/** @inheritDoc */
|
|
35
|
+
addHumidityCallback(pCallback: (action: HumiditySensorChangeAction) => void): void;
|
|
36
|
+
/** @inheritDoc */
|
|
37
|
+
addTempChangeCallback(pCallback: (action: TemperatureSensorChangeAction) => void): void;
|
|
38
|
+
/** @inheritDoc */
|
|
39
|
+
onTemperaturChange(newTemperatur: number): void;
|
|
40
|
+
/** @inheritDoc */
|
|
41
|
+
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
42
|
+
/** @inheritDoc */
|
|
43
|
+
dispose(): void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ZigbeeCooloSoilSensor = void 0;
|
|
4
|
+
const BaseDevices_1 = require("./BaseDevices");
|
|
5
|
+
const sharedFunctions_1 = require("../sharedFunctions");
|
|
6
|
+
const enums_1 = require("../../enums");
|
|
7
|
+
/**
|
|
8
|
+
* The COOLO CS-201Z soil sensor.
|
|
9
|
+
*
|
|
10
|
+
* Beyond the soil moisture and battery of {@link ZigbeeSoilSensor} it measures the air around it, so it adds
|
|
11
|
+
* the ambient temperature and humidity axes. Those are three separate quantities: `soil_moisture` and
|
|
12
|
+
* `humidity` are both percentages and can be told apart by nothing but which state they arrived on - the
|
|
13
|
+
* device reported 15 % soil against 91 % air on the same message.
|
|
14
|
+
*
|
|
15
|
+
* The configuration states the device exposes (`soil_calibration`, `soil_warning`, `temperature_calibration`,
|
|
16
|
+
* `temperature_sampling`, `soil_sampling`, `temperature_unit`) and the `dry` flag it derives from its own
|
|
17
|
+
* threshold are deliberately not mapped. They stay reachable through `stateMap` and `send_payload`.
|
|
18
|
+
*/
|
|
19
|
+
class ZigbeeCooloSoilSensor extends BaseDevices_1.ZigbeeSoilSensor {
|
|
20
|
+
constructor(pInfo) {
|
|
21
|
+
super(pInfo, enums_1.DeviceType.ZigbeeCooloSoilSensor);
|
|
22
|
+
/** @inheritDoc */
|
|
23
|
+
this.temperatureSensor = new sharedFunctions_1.TemperatureSensor(this);
|
|
24
|
+
/** @inheritDoc */
|
|
25
|
+
this.humiditySensor = new sharedFunctions_1.HumiditySensor(this);
|
|
26
|
+
this.deviceCapabilities.push(enums_1.DeviceCapability.temperatureSensor);
|
|
27
|
+
this.deviceCapabilities.push(enums_1.DeviceCapability.humiditySensor);
|
|
28
|
+
}
|
|
29
|
+
/** @inheritDoc */
|
|
30
|
+
get roomTemperature() {
|
|
31
|
+
return this.temperatureSensor.roomTemperature;
|
|
32
|
+
}
|
|
33
|
+
/** @inheritDoc */
|
|
34
|
+
set roomTemperature(value) {
|
|
35
|
+
this.temperatureSensor.roomTemperature = value;
|
|
36
|
+
}
|
|
37
|
+
/** @inheritDoc */
|
|
38
|
+
get humidity() {
|
|
39
|
+
return this.humiditySensor.humidity;
|
|
40
|
+
}
|
|
41
|
+
/** @inheritDoc */
|
|
42
|
+
get iTemperature() {
|
|
43
|
+
return this.temperatureSensor.temperature;
|
|
44
|
+
}
|
|
45
|
+
/** @inheritDoc */
|
|
46
|
+
get sTemperature() {
|
|
47
|
+
return `${this.temperatureSensor.temperature}°C`;
|
|
48
|
+
}
|
|
49
|
+
/** @inheritDoc */
|
|
50
|
+
addHumidityCallback(pCallback) {
|
|
51
|
+
this.humiditySensor.addHumidityCallback(pCallback);
|
|
52
|
+
}
|
|
53
|
+
/** @inheritDoc */
|
|
54
|
+
addTempChangeCallback(pCallback) {
|
|
55
|
+
this.temperatureSensor.addTempChangeCallback(pCallback);
|
|
56
|
+
}
|
|
57
|
+
/** @inheritDoc */
|
|
58
|
+
onTemperaturChange(newTemperatur) {
|
|
59
|
+
this.roomTemperature = newTemperatur;
|
|
60
|
+
}
|
|
61
|
+
/** @inheritDoc */
|
|
62
|
+
update(idSplit, state, initial = false) {
|
|
63
|
+
// The base class handles `soil_moisture` and `battery`; these two are the air around the pot.
|
|
64
|
+
super.update(idSplit, state, initial);
|
|
65
|
+
switch (idSplit[3]) {
|
|
66
|
+
case 'humidity':
|
|
67
|
+
this.humiditySensor.humidity = state.val;
|
|
68
|
+
break;
|
|
69
|
+
case 'temperature':
|
|
70
|
+
this.temperatureSensor.temperature = state.val;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/** @inheritDoc */
|
|
75
|
+
dispose() {
|
|
76
|
+
this.temperatureSensor.dispose();
|
|
77
|
+
this.humiditySensor.dispose();
|
|
78
|
+
super.dispose();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.ZigbeeCooloSoilSensor = ZigbeeCooloSoilSensor;
|
|
@@ -27,6 +27,8 @@ var DeviceCapability;
|
|
|
27
27
|
DeviceCapability[DeviceCapability["garageDoorOpener"] = 21] = "garageDoorOpener";
|
|
28
28
|
DeviceCapability[DeviceCapability["magnetSensor"] = 22] = "magnetSensor";
|
|
29
29
|
DeviceCapability[DeviceCapability["airQualitySensor"] = 23] = "airQualitySensor";
|
|
30
|
+
DeviceCapability[DeviceCapability["fossilGenerator"] = 24] = "fossilGenerator";
|
|
31
|
+
DeviceCapability[DeviceCapability["soilSensor"] = 25] = "soilSensor";
|
|
30
32
|
DeviceCapability[DeviceCapability["bluetoothDetector"] = 101] = "bluetoothDetector";
|
|
31
33
|
DeviceCapability[DeviceCapability["trackableDevice"] = 102] = "trackableDevice";
|
|
32
34
|
DeviceCapability[DeviceCapability["scene"] = 103] = "scene";
|
|
@@ -29,6 +29,7 @@ export declare enum CommandType {
|
|
|
29
29
|
RoomRestoreLightCommand = "RoomRestoreLightCommand",
|
|
30
30
|
RoomSetLightTimeBasedCommand = "RoomSetLightTimeBasedCommand",
|
|
31
31
|
ShutterPositionChangedAction = "ShutterPositionChangedAction",
|
|
32
|
+
SoilSensorChangeAction = "SoilSensorChangeAction",
|
|
32
33
|
ShutterSetLevelCommand = "ShutterSetLevelCommand",
|
|
33
34
|
ShutterSunriseUpCommand = "ShutterSunriseUpCommand",
|
|
34
35
|
SunsetDownCommand = "SunsetDownCommand",
|
package/lib/enums/commandType.js
CHANGED
|
@@ -33,6 +33,7 @@ var CommandType;
|
|
|
33
33
|
CommandType["RoomRestoreLightCommand"] = "RoomRestoreLightCommand";
|
|
34
34
|
CommandType["RoomSetLightTimeBasedCommand"] = "RoomSetLightTimeBasedCommand";
|
|
35
35
|
CommandType["ShutterPositionChangedAction"] = "ShutterPositionChangedAction";
|
|
36
|
+
CommandType["SoilSensorChangeAction"] = "SoilSensorChangeAction";
|
|
36
37
|
CommandType["ShutterSetLevelCommand"] = "ShutterSetLevelCommand";
|
|
37
38
|
CommandType["ShutterSunriseUpCommand"] = "ShutterSunriseUpCommand";
|
|
38
39
|
CommandType["SunsetDownCommand"] = "SunsetDownCommand";
|
|
@@ -24,4 +24,5 @@ var DeviceClusterType;
|
|
|
24
24
|
DeviceClusterType[DeviceClusterType["WLED"] = 19] = "WLED";
|
|
25
25
|
DeviceClusterType[DeviceClusterType["Tv"] = 20] = "Tv";
|
|
26
26
|
DeviceClusterType[DeviceClusterType["Camera"] = 21] = "Camera";
|
|
27
|
+
DeviceClusterType[DeviceClusterType["SoilSensor"] = 22] = "SoilSensor";
|
|
27
28
|
})(DeviceClusterType || (exports.DeviceClusterType = DeviceClusterType = {}));
|
package/lib/enums/deviceType.js
CHANGED
|
@@ -45,6 +45,7 @@ var DeviceType;
|
|
|
45
45
|
DeviceType[DeviceType["ZigbeeSodaHandle"] = 227] = "ZigbeeSodaHandle";
|
|
46
46
|
DeviceType[DeviceType["ZigbeeTuyaMotion"] = 228] = "ZigbeeTuyaMotion";
|
|
47
47
|
DeviceType[DeviceType["ZigbeeAqaraPresence"] = 229] = "ZigbeeAqaraPresence";
|
|
48
|
+
DeviceType[DeviceType["ZigbeeCooloSoilSensor"] = 230] = "ZigbeeCooloSoilSensor";
|
|
48
49
|
DeviceType[DeviceType["JsEnergyManager"] = 301] = "JsEnergyManager";
|
|
49
50
|
DeviceType[DeviceType["RoomScene"] = 401] = "RoomScene";
|
|
50
51
|
DeviceType[DeviceType["ShellyTrv"] = 402] = "ShellyTrv";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { iRoomDevice } from './iRoomDevice';
|
|
2
2
|
import { AirQualitySensorChangeAction } from '../../action';
|
|
3
|
-
import { iAirQualityReadings
|
|
3
|
+
import { iAirQualityReadings } from './iAirQualityReadings';
|
|
4
|
+
import { iAirQualitySensor } from './iAirQualitySensor';
|
|
4
5
|
/**
|
|
5
6
|
* This interface represents a device measuring air quality.
|
|
6
7
|
*
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The set of air quality metrics a sensor can report.
|
|
3
|
+
*
|
|
4
|
+
* Devices differ widely in what they measure, so every member is always present but defaults to
|
|
5
|
+
* `UNDEFINED_AIR_QUALITY_VALUE` until the device reports it. This mirrors the sentinel approach of
|
|
6
|
+
* `UNDEFINED_TEMP_VALUE` and spares consumers a null check on every metric; use
|
|
7
|
+
* {@link iAirQualitySensor.reports} to tell "not measured" apart from a measured zero.
|
|
8
|
+
*/
|
|
9
|
+
export interface iAirQualityReadings {
|
|
10
|
+
/**
|
|
11
|
+
* The air quality index as calculated by the device (lower is better)
|
|
12
|
+
*/
|
|
13
|
+
aqi: number;
|
|
14
|
+
/**
|
|
15
|
+
* The carbon dioxide concentration in ppm
|
|
16
|
+
*/
|
|
17
|
+
co2: number;
|
|
18
|
+
/**
|
|
19
|
+
* The nitrogen oxide index (1 equals background level)
|
|
20
|
+
*/
|
|
21
|
+
nox: number;
|
|
22
|
+
/**
|
|
23
|
+
* Particulate matter up to 1.0 µm in µg/m³
|
|
24
|
+
*/
|
|
25
|
+
pm1p0: number;
|
|
26
|
+
/**
|
|
27
|
+
* Particulate matter up to 2.5 µm in µg/m³
|
|
28
|
+
*/
|
|
29
|
+
pm2p5: number;
|
|
30
|
+
/**
|
|
31
|
+
* Particulate matter up to 4.0 µm in µg/m³
|
|
32
|
+
*/
|
|
33
|
+
pm4p0: number;
|
|
34
|
+
/**
|
|
35
|
+
* Particulate matter up to 10.0 µm in µg/m³
|
|
36
|
+
*/
|
|
37
|
+
pm10p0: number;
|
|
38
|
+
/**
|
|
39
|
+
* The total volatile organic compounds in ppb
|
|
40
|
+
*/
|
|
41
|
+
tvoc: number;
|
|
42
|
+
/**
|
|
43
|
+
* The vape detection reading of the device
|
|
44
|
+
*/
|
|
45
|
+
vape: number;
|
|
46
|
+
/**
|
|
47
|
+
* The volatile organic compounds index (100 equals background level)
|
|
48
|
+
*/
|
|
49
|
+
voc: number;
|
|
50
|
+
}
|
|
@@ -1,59 +1,6 @@
|
|
|
1
1
|
import { iJsonOmitKeys } from '../iJsonOmitKeys';
|
|
2
2
|
import { AirQualitySensorChangeAction } from '../../action';
|
|
3
|
-
|
|
4
|
-
* The value reported for a metric the sensor does not measure or has not reported yet.
|
|
5
|
-
*/
|
|
6
|
-
export declare const UNDEFINED_AIR_QUALITY_VALUE = -1;
|
|
7
|
-
/**
|
|
8
|
-
* The set of air quality metrics a sensor can report.
|
|
9
|
-
*
|
|
10
|
-
* Devices differ widely in what they measure, so every member is always present but defaults to
|
|
11
|
-
* {@link UNDEFINED_AIR_QUALITY_VALUE} until the device reports it. This mirrors the sentinel approach of
|
|
12
|
-
* {@link UNDEFINED_TEMP_VALUE} and spares consumers a null check on every metric; use
|
|
13
|
-
* {@link iAirQualitySensor.reports} to tell "not measured" apart from a measured zero.
|
|
14
|
-
*/
|
|
15
|
-
export interface iAirQualityReadings {
|
|
16
|
-
/**
|
|
17
|
-
* The air quality index as calculated by the device (lower is better)
|
|
18
|
-
*/
|
|
19
|
-
aqi: number;
|
|
20
|
-
/**
|
|
21
|
-
* The carbon dioxide concentration in ppm
|
|
22
|
-
*/
|
|
23
|
-
co2: number;
|
|
24
|
-
/**
|
|
25
|
-
* The nitrogen oxide index (1 equals background level)
|
|
26
|
-
*/
|
|
27
|
-
nox: number;
|
|
28
|
-
/**
|
|
29
|
-
* Particulate matter up to 1.0 µm in µg/m³
|
|
30
|
-
*/
|
|
31
|
-
pm1p0: number;
|
|
32
|
-
/**
|
|
33
|
-
* Particulate matter up to 2.5 µm in µg/m³
|
|
34
|
-
*/
|
|
35
|
-
pm2p5: number;
|
|
36
|
-
/**
|
|
37
|
-
* Particulate matter up to 4.0 µm in µg/m³
|
|
38
|
-
*/
|
|
39
|
-
pm4p0: number;
|
|
40
|
-
/**
|
|
41
|
-
* Particulate matter up to 10.0 µm in µg/m³
|
|
42
|
-
*/
|
|
43
|
-
pm10p0: number;
|
|
44
|
-
/**
|
|
45
|
-
* The total volatile organic compounds in ppb
|
|
46
|
-
*/
|
|
47
|
-
tvoc: number;
|
|
48
|
-
/**
|
|
49
|
-
* The vape detection reading of the device
|
|
50
|
-
*/
|
|
51
|
-
vape: number;
|
|
52
|
-
/**
|
|
53
|
-
* The volatile organic compounds index (100 equals background level)
|
|
54
|
-
*/
|
|
55
|
-
voc: number;
|
|
56
|
-
}
|
|
3
|
+
import { iAirQualityReadings } from './iAirQualityReadings';
|
|
57
4
|
/**
|
|
58
5
|
* Common handling for a device measuring air quality.
|
|
59
6
|
*/
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UNDEFINED_AIR_QUALITY_VALUE = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* The value reported for a metric the sensor does not measure or has not reported yet.
|
|
6
|
-
*/
|
|
7
|
-
exports.UNDEFINED_AIR_QUALITY_VALUE = -1;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { iBaseDevice } from './iBaseDevice';
|
|
2
2
|
import { iDisposable } from '../iDisposeable';
|
|
3
|
+
import { iEnergyHistoryOutlook } from '../iEnergyHistoryOutlook';
|
|
3
4
|
import { iExcessEnergyConsumer } from './iExcessEnergyConsumer';
|
|
5
|
+
import { iMorningReserveVerdict } from '../iMorningReserveVerdict';
|
|
4
6
|
/**
|
|
5
7
|
* Interface for devices that can manage energy consumption and production.
|
|
6
8
|
*
|
|
@@ -17,6 +19,47 @@ export interface iEnergyManager extends iBaseDevice, iDisposable {
|
|
|
17
19
|
* Whether the Energy Manager actively blocks AC
|
|
18
20
|
*/
|
|
19
21
|
readonly acBlocked: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* What the plant's own recorded history says about the coming morning low, or `undefined` while this
|
|
24
|
+
* manager cannot say anything about it - no battery, no stated capacity, or no charge level to project
|
|
25
|
+
* from.
|
|
26
|
+
*
|
|
27
|
+
* **Read, not asked with a charge level.** The level of the plant's battery is the manager's own, and a
|
|
28
|
+
* consumer that handed one in could hand in a different number than the manager itself reads. It is also
|
|
29
|
+
* why the guard against the "no reading" marker of {@link iBatteryDevice.batteryLevel} lives here, once,
|
|
30
|
+
* rather than in every consumer.
|
|
31
|
+
*
|
|
32
|
+
* **Free to read.** This getter must stay pure arithmetic over what was already read, so that a consumer
|
|
33
|
+
* asking on every one of its own decisions costs no query and no request quota. The reading itself is driven
|
|
34
|
+
* separately, from the manager's own loop.
|
|
35
|
+
*
|
|
36
|
+
* **Delegate, do not implement.** `EnergyManagerUtils.morningOutlook(this)` answers it for any manager, and
|
|
37
|
+
* `EnergyManagerUtils.refreshEnergyHistory(this)` in the manager's loop drives the reading - the same pair
|
|
38
|
+
* both managers in this repository use. There is one energy manager per installation, so the shared
|
|
39
|
+
* implementation keeps one reading and one shadow record; a manager that builds its own would pay the
|
|
40
|
+
* bounded weather backfill twice and split that record in half.
|
|
41
|
+
*
|
|
42
|
+
* The answer states facts about the plant and no arithmetic on them. The judgement that goes with it is
|
|
43
|
+
* {@link morningReserveVerdict}; read that one unless you genuinely need the raw quantities.
|
|
44
|
+
*/
|
|
45
|
+
readonly morningOutlook: iEnergyHistoryOutlook | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the plant expects the coming morning to hold the reserve its battery must not fall below, or
|
|
48
|
+
* `undefined` while it can say neither.
|
|
49
|
+
*
|
|
50
|
+
* **The judgement belongs here, not to the asking consumer.** How low the morning may get is a property of
|
|
51
|
+
* the battery, and how little sun still counts as none a property of the plant's photovoltaic - a fuel
|
|
52
|
+
* burning generator and an air conditioner do not want different answers to that. Where they differ is how
|
|
53
|
+
* sure they want to be before they act, and that is {@link iMorningReserveVerdict.measured}: the verdicts
|
|
54
|
+
* that need no fitted model may move something, the modelled ones are reported and left alone.
|
|
55
|
+
*
|
|
56
|
+
* **Free to read**, for the same reason {@link morningOutlook} is - pure arithmetic over what was already
|
|
57
|
+
* read.
|
|
58
|
+
*
|
|
59
|
+
* **Delegate, do not implement.** `EnergyManagerUtils.morningReserveVerdict(this, this.morningOutlook)`
|
|
60
|
+
* answers it for any manager.
|
|
61
|
+
*/
|
|
62
|
+
readonly morningReserveVerdict: iMorningReserveVerdict | undefined;
|
|
20
63
|
/**
|
|
21
64
|
* The total wattaage being injected into the grid at the moment of last calculation.
|
|
22
65
|
*/
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { iRoomDevice } from './iRoomDevice';
|
|
2
2
|
import { HumiditySensorChangeAction } from '../../action';
|
|
3
3
|
import { iHumiditySensor } from './iHumiditySensor';
|
|
4
|
-
export declare const UNDEFINED_HUMIDITY_VALUE = -1;
|
|
5
4
|
/**
|
|
6
5
|
* This interface represents a humidity sensor device.
|
|
7
6
|
*
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { iRoomDevice } from './iRoomDevice';
|
|
2
|
+
import { SoilSensorChangeAction } from '../../action';
|
|
3
|
+
import { iSoilSensor } from './iSoilSensor';
|
|
4
|
+
/**
|
|
5
|
+
* This interface represents a device measuring the moisture of the soil it sits in.
|
|
6
|
+
*
|
|
7
|
+
* For devices with {@link DeviceCapability.soilSensor} capability.
|
|
8
|
+
*/
|
|
9
|
+
export interface iSoilCollector extends iRoomDevice {
|
|
10
|
+
/**
|
|
11
|
+
* Service which handles common aspects of the soil sensor like persisting
|
|
12
|
+
*/
|
|
13
|
+
readonly soilSensor: iSoilSensor;
|
|
14
|
+
/**
|
|
15
|
+
* The current soil moisture in percent
|
|
16
|
+
*/
|
|
17
|
+
readonly soilMoisture: number;
|
|
18
|
+
/**
|
|
19
|
+
* Add a callback that is called when the soil moisture changes
|
|
20
|
+
* @param pCallback - The callback to fire
|
|
21
|
+
*/
|
|
22
|
+
addSoilMoistureCallback(pCallback: (action: SoilSensorChangeAction) => void): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { iJsonOmitKeys } from '../iJsonOmitKeys';
|
|
2
|
+
import { SoilSensorChangeAction } from '../../action';
|
|
3
|
+
/**
|
|
4
|
+
* Common handling for a device measuring the moisture of the soil it sits in.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately its own axis rather than a second {@link iHumiditySensor}: a device can measure the moisture of
|
|
7
|
+
* the soil and the humidity of the air around it at the same time, and those are two different quantities that
|
|
8
|
+
* happen to share a unit. Sharing the slot would force one of the two readings out.
|
|
9
|
+
*/
|
|
10
|
+
export interface iSoilSensor extends iJsonOmitKeys {
|
|
11
|
+
/**
|
|
12
|
+
* The current soil moisture in percent, or {@link UNDEFINED_SOIL_MOISTURE_VALUE} while nothing was reported
|
|
13
|
+
*/
|
|
14
|
+
soilMoisture: number;
|
|
15
|
+
/**
|
|
16
|
+
* Persists the current soil moisture to the database
|
|
17
|
+
*/
|
|
18
|
+
persist(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Adds a callback to be called when the soil moisture changes
|
|
21
|
+
* @param pCallback - The callback to be called
|
|
22
|
+
*/
|
|
23
|
+
addSoilMoistureCallback(pCallback: (action: SoilSensorChangeAction) => void): void;
|
|
24
|
+
/**
|
|
25
|
+
* Frees up the resources of this sensor
|
|
26
|
+
*/
|
|
27
|
+
dispose(): void;
|
|
28
|
+
/**
|
|
29
|
+
* @returns The serializable representation of this sensor
|
|
30
|
+
*/
|
|
31
|
+
toJSON(): Partial<iSoilSensor>;
|
|
32
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { iRoomDevice } from './iRoomDevice';
|
|
2
2
|
import { TemperatureSensorChangeAction } from '../../action';
|
|
3
3
|
import { iTemperatureSensor } from './iTemperatureSensor';
|
|
4
|
-
export declare const UNDEFINED_TEMP_VALUE = -99;
|
|
5
4
|
/**
|
|
6
5
|
* This interface represents a temperature sensor device.
|
|
7
6
|
*
|
|
@@ -13,7 +13,14 @@ export * from './iGarageDoorOpener';
|
|
|
13
13
|
export * from './iHandle';
|
|
14
14
|
export * from './iHeater';
|
|
15
15
|
export * from './iAirQualityCollector';
|
|
16
|
+
export * from './iAirQualityReadings';
|
|
16
17
|
export * from './iAirQualitySensor';
|
|
18
|
+
export * from './iSoilCollector';
|
|
19
|
+
export * from './iSoilSensor';
|
|
20
|
+
export * from './undefinedAirQualityValue';
|
|
21
|
+
export * from './undefinedHumidityValue';
|
|
22
|
+
export * from './undefinedSoilMoistureValue';
|
|
23
|
+
export * from './undefinedTempValue';
|
|
17
24
|
export * from './iHumidityCollector';
|
|
18
25
|
export * from './iIlluminationSensor';
|
|
19
26
|
export * from './iLamp';
|
|
@@ -28,7 +28,14 @@ __exportStar(require("./iGarageDoorOpener"), exports);
|
|
|
28
28
|
__exportStar(require("./iHandle"), exports);
|
|
29
29
|
__exportStar(require("./iHeater"), exports);
|
|
30
30
|
__exportStar(require("./iAirQualityCollector"), exports);
|
|
31
|
+
__exportStar(require("./iAirQualityReadings"), exports);
|
|
31
32
|
__exportStar(require("./iAirQualitySensor"), exports);
|
|
33
|
+
__exportStar(require("./iSoilCollector"), exports);
|
|
34
|
+
__exportStar(require("./iSoilSensor"), exports);
|
|
35
|
+
__exportStar(require("./undefinedAirQualityValue"), exports);
|
|
36
|
+
__exportStar(require("./undefinedHumidityValue"), exports);
|
|
37
|
+
__exportStar(require("./undefinedSoilMoistureValue"), exports);
|
|
38
|
+
__exportStar(require("./undefinedTempValue"), exports);
|
|
32
39
|
__exportStar(require("./iHumidityCollector"), exports);
|
|
33
40
|
__exportStar(require("./iIlluminationSensor"), exports);
|
|
34
41
|
__exportStar(require("./iLamp"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UNDEFINED_AIR_QUALITY_VALUE = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The value reported for a metric the sensor does not measure or has not reported yet.
|
|
6
|
+
*/
|
|
7
|
+
exports.UNDEFINED_AIR_QUALITY_VALUE = -1;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UNDEFINED_SOIL_MOISTURE_VALUE = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The value reported while a device has no soil moisture reading of its own yet.
|
|
6
|
+
*
|
|
7
|
+
* Negative on purpose: soil moisture is a percentage, so no reading the sensor can take collides with it.
|
|
8
|
+
*/
|
|
9
|
+
exports.UNDEFINED_SOIL_MOISTURE_VALUE = -1;
|
|
@@ -20,3 +20,4 @@ __exportStar(require("./influxDbConnectionOptions"), exports);
|
|
|
20
20
|
__exportStar(require("./IReadKeyList"), exports);
|
|
21
21
|
__exportStar(require("./IWriteKeyList"), exports);
|
|
22
22
|
__exportStar(require("./KeyListEntity"), exports);
|
|
23
|
+
__exportStar(require("./KeyListEntityResponse"), exports);
|
|
@@ -73,6 +73,21 @@ export interface iDachsDeviceSettings extends iActuatorSettings {
|
|
|
73
73
|
* Defines the desired minimum temperature for heat storage during winter.
|
|
74
74
|
*/
|
|
75
75
|
winterMinimumPreNightHeatStorageTemp: number;
|
|
76
|
+
/**
|
|
77
|
+
* Defines the desired maximum temperature for warm water using dachs outside of winter heating mode.
|
|
78
|
+
* Applies in place of {@link warmWaterDesiredMaxTemp} whenever the heating mode is not winter.
|
|
79
|
+
*/
|
|
80
|
+
summerWarmWaterDesiredMaxTemp: number;
|
|
81
|
+
/**
|
|
82
|
+
* The rated electrical output of the unit in watt, used to remove its own contribution from a historical day.
|
|
83
|
+
* @default 5500
|
|
84
|
+
*/
|
|
85
|
+
dachsRatedElectricalWattage: number;
|
|
86
|
+
/**
|
|
87
|
+
* The share of the produced electrical energy that reaches the battery.
|
|
88
|
+
* @default 0.8
|
|
89
|
+
*/
|
|
90
|
+
dachsConversionFactor: number;
|
|
76
91
|
/**
|
|
77
92
|
*
|
|
78
93
|
*/
|