homebridge-virtual-accessories 3.15.0 → 3.16.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/config.schema.json +97 -23
- package/dist/accessories/virtualAccessoryAirPurifier.d.ts +1 -1
- package/dist/accessories/virtualAccessoryAirPurifier.js +31 -15
- package/dist/accessories/virtualAccessoryAirPurifier.js.map +1 -1
- package/dist/accessories/virtualAccessoryHeaterCooler.d.ts +4 -10
- package/dist/accessories/virtualAccessoryHeaterCooler.js +118 -117
- package/dist/accessories/virtualAccessoryHeaterCooler.js.map +1 -1
- package/dist/accessories/virtualAccessoryHumidifierDehumidifier.d.ts +5 -6
- package/dist/accessories/virtualAccessoryHumidifierDehumidifier.js +106 -77
- package/dist/accessories/virtualAccessoryHumidifierDehumidifier.js.map +1 -1
- package/dist/accessories/virtualAccessoryThermostat.d.ts +37 -0
- package/dist/accessories/virtualAccessoryThermostat.js +333 -0
- package/dist/accessories/virtualAccessoryThermostat.js.map +1 -0
- package/dist/accessoryFactory.js +4 -0
- package/dist/accessoryFactory.js.map +1 -1
- package/dist/characteristicsUtils.d.ts +18 -6
- package/dist/characteristicsUtils.js +69 -20
- package/dist/characteristicsUtils.js.map +1 -1
- package/dist/configuration/accessories/configurationHumidifierDehumidifier.d.ts +1 -0
- package/dist/configuration/accessories/configurationHumidifierDehumidifier.js +1 -0
- package/dist/configuration/accessories/configurationHumidifierDehumidifier.js.map +1 -1
- package/dist/configuration/accessories/configurationThermostat.d.ts +22 -0
- package/dist/configuration/accessories/configurationThermostat.js +94 -0
- package/dist/configuration/accessories/configurationThermostat.js.map +1 -0
- package/dist/configuration/configurationAccessory.d.ts +2 -0
- package/dist/configuration/configurationAccessory.js +10 -1
- package/dist/configuration/configurationAccessory.js.map +1 -1
- package/dist/configuration/configurationMeasurementSensor.d.ts +0 -1
- package/dist/configuration/configurationMeasurementSensor.js +0 -15
- package/dist/configuration/configurationMeasurementSensor.js.map +1 -1
- package/dist/configuration/schema.d.ts +1 -0
- package/dist/configuration/schema.js +1 -0
- package/dist/configuration/schema.js.map +1 -1
- package/dist/sensors/measurementSensor.js +0 -1
- package/dist/sensors/measurementSensor.js.map +1 -1
- package/dist/sensors/virtualSensorTemperature.d.ts +2 -1
- package/dist/sensors/virtualSensorTemperature.js +14 -0
- package/dist/sensors/virtualSensorTemperature.js.map +1 -1
- package/package.json +2 -2
package/config.schema.json
CHANGED
|
@@ -149,6 +149,7 @@
|
|
|
149
149
|
{ "title": "Speaker", "enum": ["speaker"] },
|
|
150
150
|
{ "title": "Switch", "enum": ["switch"] },
|
|
151
151
|
{ "title": "Television", "enum": ["television"] },
|
|
152
|
+
{ "title": "Thermostat", "enum": ["thermostat"] },
|
|
152
153
|
{ "title": "Valve", "enum": ["valve"] },
|
|
153
154
|
{ "title": "Window", "enum": ["window"] },
|
|
154
155
|
{ "title": "Window Covering (Blinds, Shades)", "enum": ["windowcovering"] }
|
|
@@ -159,7 +160,7 @@
|
|
|
159
160
|
"description": "Accessory state survives Homebridge restart",
|
|
160
161
|
"type": "boolean",
|
|
161
162
|
"condition": {
|
|
162
|
-
"functionBody": "return ['airpurifier', 'door', 'fan', 'garagedoor', 'heatercooler', 'humidifierdehumidifier', 'lightbulb', 'lock', 'securitysystem', 'speaker', 'switch', 'television', 'valve', 'window', 'windowcovering'].includes(model.devices[arrayIndices].accessoryType);"
|
|
163
|
+
"functionBody": "return ['airpurifier', 'door', 'fan', 'garagedoor', 'heatercooler', 'humidifierdehumidifier', 'lightbulb', 'lock', 'securitysystem', 'speaker', 'switch', 'television', 'thermostat', 'valve', 'window', 'windowcovering'].includes(model.devices[arrayIndices].accessoryType);"
|
|
163
164
|
}
|
|
164
165
|
},
|
|
165
166
|
"airPurifier": {
|
|
@@ -486,6 +487,13 @@
|
|
|
486
487
|
{ "title": "Humidifier and Dehumidifier", "enum": ["auto"] }
|
|
487
488
|
]
|
|
488
489
|
},
|
|
490
|
+
"hasFan": {
|
|
491
|
+
"title": "Has Fan",
|
|
492
|
+
"type": "boolean",
|
|
493
|
+
"condition": {
|
|
494
|
+
"functionBody": "return model.devices[arrayIndices].humidifierDehumidifier && ['humidifier', 'dehumidifier', 'auto'].includes(model.devices[arrayIndices].humidifierDehumidifier.type);"
|
|
495
|
+
}
|
|
496
|
+
},
|
|
489
497
|
"humidifierThreshold": {
|
|
490
498
|
"title": "Humidifying Threshold *",
|
|
491
499
|
"description": "Humidity level below which the humidifier turns on (0% - 100%)",
|
|
@@ -807,6 +815,87 @@
|
|
|
807
815
|
"functionBody": "return model.devices[arrayIndices].accessoryType === 'television';"
|
|
808
816
|
}
|
|
809
817
|
},
|
|
818
|
+
"thermostat": {
|
|
819
|
+
"title": "Thermostat",
|
|
820
|
+
"type": "object",
|
|
821
|
+
"properties": {
|
|
822
|
+
"temperatureDisplayUnits": {
|
|
823
|
+
"title": "Temperature Display Units *",
|
|
824
|
+
"type": "string",
|
|
825
|
+
"oneOf": [
|
|
826
|
+
{ "title": "Celsius (ºC)", "enum": ["celsius"] },
|
|
827
|
+
{ "title": "Fahrenheit (ºF)", "enum": ["fahrenheit"] }
|
|
828
|
+
]
|
|
829
|
+
},
|
|
830
|
+
"heatingThresholdCelsius": {
|
|
831
|
+
"title": "Heating Threshold ºC *",
|
|
832
|
+
"description": "Temperature level below which the thermostat turns on (0ºC - 25ºC)",
|
|
833
|
+
"type": "integer",
|
|
834
|
+
"minimum": 0,
|
|
835
|
+
"maximum": 25,
|
|
836
|
+
"condition": {
|
|
837
|
+
"functionBody": "return model.devices[arrayIndices].thermostat && model.devices[arrayIndices].thermostat.temperatureDisplayUnits === 'celsius';"
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
"coolingThresholdCelsius": {
|
|
841
|
+
"title": "Cooling Threshold ºC *",
|
|
842
|
+
"description": "Temperature level above which the thermostat turns on (10ºC - 35ºC)",
|
|
843
|
+
"type": "integer",
|
|
844
|
+
"minimum": 10,
|
|
845
|
+
"maximum": 35,
|
|
846
|
+
"condition": {
|
|
847
|
+
"functionBody": "return model.devices[arrayIndices].thermostat && model.devices[arrayIndices].thermostat.temperatureDisplayUnits === 'celsius';"
|
|
848
|
+
}
|
|
849
|
+
},
|
|
850
|
+
"heatingThresholdFahrenheit": {
|
|
851
|
+
"title": "Heating Threshold ºF *",
|
|
852
|
+
"description": "Temperature level below which the thermostat turns on (32ºF - 77ºF)",
|
|
853
|
+
"type": "integer",
|
|
854
|
+
"minimum": 32,
|
|
855
|
+
"maximum": 77,
|
|
856
|
+
"condition": {
|
|
857
|
+
"functionBody": "return model.devices[arrayIndices].thermostat && model.devices[arrayIndices].thermostat.temperatureDisplayUnits === 'fahrenheit';"
|
|
858
|
+
}
|
|
859
|
+
},
|
|
860
|
+
"coolingThresholdFahrenheit": {
|
|
861
|
+
"title": "Cooling Threshold ºF *",
|
|
862
|
+
"description": "Temperature level above which the thermostat turns on (50ºF - 95ºF)",
|
|
863
|
+
"type": "integer",
|
|
864
|
+
"minimum": 50,
|
|
865
|
+
"maximum": 95,
|
|
866
|
+
"condition": {
|
|
867
|
+
"functionBody": "return model.devices[arrayIndices].thermostat && model.devices[arrayIndices].thermostat.temperatureDisplayUnits === 'fahrenheit';"
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
},
|
|
871
|
+
"condition": {
|
|
872
|
+
"functionBody": "return model.devices[arrayIndices].accessoryType === 'thermostat';"
|
|
873
|
+
},
|
|
874
|
+
"allOf": [
|
|
875
|
+
{
|
|
876
|
+
"if": {
|
|
877
|
+
"properties": {
|
|
878
|
+
"temperatureDisplayUnits": { "const": "celsius" }
|
|
879
|
+
},
|
|
880
|
+
"required": [ "temperatureDisplayUnits" ]
|
|
881
|
+
},
|
|
882
|
+
"then": {
|
|
883
|
+
"required": [ "heatingThresholdCelsius", "coolingThresholdCelsius" ]
|
|
884
|
+
}
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
"if": {
|
|
888
|
+
"properties": {
|
|
889
|
+
"temperatureDisplayUnits": { "const": "fahrenheit" }
|
|
890
|
+
},
|
|
891
|
+
"required": [ "temperatureDisplayUnits" ]
|
|
892
|
+
},
|
|
893
|
+
"then": {
|
|
894
|
+
"required": [ "heatingThresholdFahrenheit", "coolingThresholdFahrenheit" ]
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
]
|
|
898
|
+
},
|
|
810
899
|
"valve": {
|
|
811
900
|
"title": "Valve",
|
|
812
901
|
"type": "object",
|
|
@@ -913,20 +1002,18 @@
|
|
|
913
1002
|
"properties": {
|
|
914
1003
|
"type": {
|
|
915
1004
|
"title": "Type *",
|
|
916
|
-
"description": "
|
|
1005
|
+
"description": "Measurement sensor type",
|
|
917
1006
|
"type": "string",
|
|
918
1007
|
"oneOf": [
|
|
919
1008
|
{ "title": "Humidity", "enum": ["humidity"] },
|
|
920
1009
|
{ "title": "Temperature", "enum": ["temperature"] }
|
|
921
1010
|
]
|
|
922
1011
|
},
|
|
923
|
-
"
|
|
924
|
-
"title": "
|
|
925
|
-
"
|
|
926
|
-
"
|
|
927
|
-
|
|
928
|
-
{ "title": "Fahrenheit (ºF)", "enum": ["fahrenheit"] }
|
|
929
|
-
],
|
|
1012
|
+
"": {
|
|
1013
|
+
"title": " ",
|
|
1014
|
+
"description": "Note: Temperature units are set in Homebridge UI under Settings - Display (default: Celsius).",
|
|
1015
|
+
"type": "object",
|
|
1016
|
+
"properties": {},
|
|
930
1017
|
"condition": {
|
|
931
1018
|
"functionBody": "return model.devices[arrayIndices].measurement && model.devices[arrayIndices].measurement.type === 'temperature';"
|
|
932
1019
|
}
|
|
@@ -934,20 +1021,7 @@
|
|
|
934
1021
|
},
|
|
935
1022
|
"condition": {
|
|
936
1023
|
"functionBody": "return model.devices[arrayIndices].accessoryType === 'measurement';"
|
|
937
|
-
}
|
|
938
|
-
"allOf": [
|
|
939
|
-
{
|
|
940
|
-
"if": {
|
|
941
|
-
"properties": {
|
|
942
|
-
"type": { "const": "temperature" }
|
|
943
|
-
},
|
|
944
|
-
"required": [ "type" ]
|
|
945
|
-
},
|
|
946
|
-
"then": {
|
|
947
|
-
"required": [ "temperatureUnits" ]
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
]
|
|
1024
|
+
}
|
|
951
1025
|
},
|
|
952
1026
|
"resetTimer": {
|
|
953
1027
|
"title": "Reset Timer",
|
|
@@ -18,7 +18,7 @@ export declare class AirPurifier extends Accessory {
|
|
|
18
18
|
getRotationSpeedHandler(): Promise<CharacteristicValue>;
|
|
19
19
|
setRotationSpeedHandler(value: CharacteristicValue): Promise<void>;
|
|
20
20
|
protected getJsonState(): string;
|
|
21
|
-
private
|
|
21
|
+
private updateAccessoryOperationalCondition;
|
|
22
22
|
static get CURRENTLY_INACTIVE(): number;
|
|
23
23
|
static get CURRENTLY_IDLE(): number;
|
|
24
24
|
static get CURRENTLY_PURIFYING_AIR(): number;
|
|
@@ -36,7 +36,7 @@ export class AirPurifier extends Accessory {
|
|
|
36
36
|
this.setCurrentAirPurifierState(CurrentAirPurifierState);
|
|
37
37
|
this.setTargetAirPurifierState(TargetAirPurifierState);
|
|
38
38
|
this.setRotationSpeed(RotationSpeed);
|
|
39
|
-
this.
|
|
39
|
+
this.updateAccessoryOperationalCondition();
|
|
40
40
|
// Last register handlers
|
|
41
41
|
this.service.getCharacteristic(CharacteristicType.Active)
|
|
42
42
|
.onSet(this.setActiveHandler.bind(this))
|
|
@@ -63,7 +63,7 @@ export class AirPurifier extends Accessory {
|
|
|
63
63
|
let Active = value;
|
|
64
64
|
Active = this.updateActive(Active);
|
|
65
65
|
this.log.info(`[${this.accessoryName}] Setting Active: ${AirPurifier.getActiveName(Active)}`);
|
|
66
|
-
this.
|
|
66
|
+
this.updateAccessoryOperationalCondition();
|
|
67
67
|
}
|
|
68
68
|
// CurrentAirPurifierState
|
|
69
69
|
async getCurrentAirPurifierStateHandler() {
|
|
@@ -81,9 +81,7 @@ export class AirPurifier extends Accessory {
|
|
|
81
81
|
let TargetAirPurifierState = value;
|
|
82
82
|
TargetAirPurifierState = this.updateTargetAirPurifierState(TargetAirPurifierState);
|
|
83
83
|
this.log.info(`[${this.accessoryName}] Setting Target Air Purifier State: ${AirPurifier.getTargetStateName(TargetAirPurifierState)}`);
|
|
84
|
-
this.
|
|
85
|
-
const CurrentAirPurifierState = this.getCurrentAirPurifierState();
|
|
86
|
-
this.log.info(`[${this.accessoryName}] Setting Current Air Purifier State: ${AirPurifier.getCurrentStateName(CurrentAirPurifierState)}`);
|
|
84
|
+
this.updateAccessoryOperationalCondition();
|
|
87
85
|
}
|
|
88
86
|
// RotationSpeed
|
|
89
87
|
async getRotationSpeedHandler() {
|
|
@@ -95,7 +93,7 @@ export class AirPurifier extends Accessory {
|
|
|
95
93
|
let RotationSpeed = value;
|
|
96
94
|
RotationSpeed = this.updateRotationSpeed(RotationSpeed);
|
|
97
95
|
this.log.info(`[${this.accessoryName}] Setting Rotation Speed: ${RotationSpeed}%`);
|
|
98
|
-
this.
|
|
96
|
+
this.updateAccessoryOperationalCondition();
|
|
99
97
|
}
|
|
100
98
|
// Abstract methods impl
|
|
101
99
|
getJsonState() {
|
|
@@ -107,19 +105,37 @@ export class AirPurifier extends Accessory {
|
|
|
107
105
|
const json = JSON.stringify(jsonState);
|
|
108
106
|
return json;
|
|
109
107
|
}
|
|
110
|
-
|
|
108
|
+
updateAccessoryOperationalCondition() {
|
|
111
109
|
const Active = this.getActive();
|
|
112
110
|
const TargetAirPurifierState = this.getTargetAirPurifierState();
|
|
111
|
+
const RotationSpeed = this.getRotationSpeed();
|
|
113
112
|
let CurrentAirPurifierState = this.getCurrentAirPurifierState();
|
|
114
|
-
if (Active === AirPurifier.
|
|
115
|
-
CurrentAirPurifierState = AirPurifier.
|
|
113
|
+
if (Active === AirPurifier.INACTIVE) {
|
|
114
|
+
CurrentAirPurifierState = AirPurifier.CURRENTLY_INACTIVE;
|
|
116
115
|
}
|
|
117
|
-
else { // (
|
|
118
|
-
if (TargetAirPurifierState === AirPurifier.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
116
|
+
else { // (Active === AirPurifier.ACTIVE)
|
|
117
|
+
if (TargetAirPurifierState === AirPurifier.MANUAL) {
|
|
118
|
+
if (RotationSpeed === 0) {
|
|
119
|
+
CurrentAirPurifierState = AirPurifier.CURRENTLY_IDLE;
|
|
120
|
+
}
|
|
121
|
+
else { // (RotationSpeed > 0)
|
|
122
|
+
CurrentAirPurifierState = AirPurifier.CURRENTLY_PURIFYING_AIR;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
else if (TargetAirPurifierState === AirPurifier.AUTO) {
|
|
126
|
+
// If the sensors detect that AirQuality < ThresholdPurifyingAirQuality
|
|
127
|
+
CurrentAirPurifierState = AirPurifier.CURRENTLY_PURIFYING_AIR;
|
|
128
|
+
// Once the sensors report that AirQuality >= ThresholdPurifyingAirQuality
|
|
129
|
+
// CurrentAirPurifierState = AirPurifier.CURRENTLY_IDLE;
|
|
130
|
+
// TODO: Add an air quality sensor
|
|
131
|
+
// Standard Air Quality Thresholds
|
|
132
|
+
// Air Quality Level | PM2.5 Concentration | US EPA AQI Range | Typical Auto Mode Behavior
|
|
133
|
+
// Good (Green). | 0 – 12 µg/m³ | 0 – 50 | Idle / Sleep Mode (Fan is either off or running
|
|
134
|
+
// on its lowest, silent setting)
|
|
135
|
+
// Moderate (Yellow) | 12.1 – 35 µg/m³. | 51 – 100 | Low to Medium Speed (The purifier actively
|
|
136
|
+
// kicks on or ramps up to clear light pollution)
|
|
137
|
+
// Unhealthy (Orange/Red) | > 35.5 µg/m³ | > 100 | High / Turbo Speed (The fan runs at maximum
|
|
138
|
+
// capacity to aggressively filter the air)
|
|
123
139
|
}
|
|
124
140
|
}
|
|
125
141
|
CurrentAirPurifierState = this.updateCurrentAirPurifierState(CurrentAirPurifierState);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtualAccessoryAirPurifier.js","sourceRoot":"","sources":["../../src/accessories/virtualAccessoryAirPurifier.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BAAC,IAAI,GAAG,QAAQ,CAAC;gBAAC,MAAM;YAAC,CAAC;YACpD,KAAK,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;gBAAC,IAAI,GAAG,MAAM,CAAC;gBAAC,MAAM;YAAC,CAAC;YAChD,OAAO,CAAC,CAAC,CAAC;gBAAC,IAAI,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;YAAC,CAAC;QACrC,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -7,12 +7,6 @@ import { UpdatableMeasurementSensor } from '../sensors/updatableSensor.js';
|
|
|
7
7
|
* HeaterCooler - Accessory implementation
|
|
8
8
|
*/
|
|
9
9
|
export declare class HeaterCooler extends Accessory implements UpdatableMeasurementSensor {
|
|
10
|
-
private readonly stateStorageKey;
|
|
11
|
-
private readonly targetStateStorageKey;
|
|
12
|
-
private readonly heatingThresholdStorageKey;
|
|
13
|
-
private readonly coolingThresholdStorageKey;
|
|
14
|
-
private readonly temperatureDisplayUnitsStorageKey;
|
|
15
|
-
private readonly fanRotatioSpeedStorageKey;
|
|
16
10
|
private deviceType;
|
|
17
11
|
private hasFan;
|
|
18
12
|
constructor(platform: VirtualAccessoriesPlatform, accessory: PlatformAccessory, accessoryConfiguration: AccessoryConfiguration);
|
|
@@ -22,22 +16,22 @@ export declare class HeaterCooler extends Accessory implements UpdatableMeasurem
|
|
|
22
16
|
getTargetHeaterCoolerStateHandler(): Promise<CharacteristicValue>;
|
|
23
17
|
setTargetHeaterCoolerStateHandler(value: CharacteristicValue): Promise<void>;
|
|
24
18
|
getCurrentTemperatureHandler(): Promise<CharacteristicValue>;
|
|
19
|
+
getTemperatureDisplayUnitsHandler(): Promise<CharacteristicValue>;
|
|
20
|
+
setTemperatureDisplayUnitsHandler(value: CharacteristicValue): Promise<void>;
|
|
25
21
|
getCoolingThresholdTemperatureHandler(): Promise<CharacteristicValue>;
|
|
26
22
|
setCoolingThresholdTemperatureHandler(value: CharacteristicValue): Promise<void>;
|
|
27
23
|
getHeatingThresholdTemperatureHandler(): Promise<CharacteristicValue>;
|
|
28
24
|
setHeatingThresholdTemperatureHandler(value: CharacteristicValue): Promise<void>;
|
|
29
|
-
getTemperatureDisplayUnitsHandler(): Promise<CharacteristicValue>;
|
|
30
|
-
setTemperatureDisplayUnitsHandler(value: CharacteristicValue): Promise<void>;
|
|
31
25
|
getRotationSpeedHandler(): Promise<CharacteristicValue>;
|
|
32
26
|
setRotationSpeedHandler(value: CharacteristicValue): Promise<void>;
|
|
33
27
|
protected getJsonState(): string;
|
|
34
28
|
private heats;
|
|
35
29
|
private cools;
|
|
36
|
-
private
|
|
30
|
+
private updateAccessoryOperationalCondition;
|
|
37
31
|
/**
|
|
38
32
|
* Ensure all the property values are set, then remove as required
|
|
39
33
|
*/
|
|
40
|
-
private
|
|
34
|
+
private updateServiceProperties;
|
|
41
35
|
private getCurrentStateLabels;
|
|
42
36
|
private getTargetStateLabels;
|
|
43
37
|
private displayTemperature;
|