[ecobee] Add air quality channels for Ecobee Smart Thermostat Premium (#13705)

* [ecobee] Add air quality channels for Ecobee Smart Thermostat Premium

Signed-off-by: Rob Nielsen <rob.nielsen@yahoo.com>
This commit is contained in:
robnielsen
2022-11-14 14:29:34 -06:00
committed by GitHub
parent 11d3c641e5
commit 0276d32897
8 changed files with 88 additions and 0 deletions

View File

@@ -224,6 +224,10 @@ public class EcobeeBindingConstants {
public static final String CH_DESIRED_HEAT_RANGE_HIGH = "desiredHeatRangeHigh";
public static final String CH_DESIRED_COOL_RANGE_LOW = "desiredCoolRangeLow";
public static final String CH_DESIRED_COOL_RANGE_HIGH = "desiredCoolRangeHigh";
public static final String CH_ACTUAL_AQ_ACCURACY = "actualAQAccuracy";
public static final String CH_ACTUAL_AQ_SCORE = "actualAQScore";
public static final String CH_ACTUAL_CO2 = "actualCO2";
public static final String CH_ACTUAL_VOC = "actualVOC";
// Thermostat bridge SETTINGS channels
public static final String CH_HVAC_MODE = "hvacMode";

View File

@@ -81,6 +81,26 @@ public class ExtendedRuntimeDTO {
*/
public List<Integer> desiredDehumidity;
/*
* The last three 5 minute actual air quality accuracy readings
*/
public List<Integer> actualAQAccuracy;
/*
* The last three 5 minute actual air quality score readings
*/
public List<Integer> actualAQScore;
/*
* The last three 5 minute actual CO2 readings
*/
public List<Integer> actualCO2;
/*
* The last three 5 minute actual VOC readings
*/
public List<Integer> actualVOC;
/*
* The last three 5 minute desired Demand Management temeprature offsets.
* This value is Demand Management adjustment value which was applied by

View File

@@ -152,4 +152,24 @@ public class RuntimeDTO {
* minimum and maximim, e.g. [650,920].
*/
public List<Integer> desiredCoolRange;
/*
* The current air quality accuracy
*/
public Integer actualAQAccuracy;
/*
* The current air quality score
*/
public Integer actualAQScore;
/*
* The current CO2 in ppm
*/
public Integer actualCO2;
/*
* The current VOC in ppb
*/
public Integer actualVOC;
}

View File

@@ -417,6 +417,10 @@ public class EcobeeThermostatBridgeHandler extends BaseBridgeHandler {
updateChannel(grp + CH_DESIRED_COOL_RANGE_HIGH,
EcobeeUtils.undefOrTemperature(runtime.desiredCoolRange.get(1)));
}
updateChannel(grp + CH_ACTUAL_AQ_ACCURACY, EcobeeUtils.undefOrLong(runtime.actualAQAccuracy));
updateChannel(grp + CH_ACTUAL_AQ_SCORE, EcobeeUtils.undefOrLong(runtime.actualAQScore));
updateChannel(grp + CH_ACTUAL_CO2, EcobeeUtils.undefOrQuantity(runtime.actualCO2, Units.PARTS_PER_MILLION));
updateChannel(grp + CH_ACTUAL_VOC, EcobeeUtils.undefOrQuantity(runtime.actualVOC, Units.PARTS_PER_BILLION));
}
private void updateSettings(@Nullable SettingsDTO settings) {

View File

@@ -70,6 +70,10 @@ public final class EcobeeUtils {
return (value == null || isUnknown(value)) ? UnDefType.UNDEF : new DecimalType(value.doubleValue());
}
public static State undefOrLong(@Nullable Number value) {
return (value == null || isUnknown(value)) ? UnDefType.UNDEF : new DecimalType(value.longValue());
}
public static State undefOrQuantity(@Nullable Number value, Unit<?> unit) {
return (value == null || isUnknown(value)) ? UnDefType.UNDEF : new QuantityType<>(value, unit);
}

View File

@@ -70,8 +70,12 @@ channel-group-type.ecobee.weather.label = Weather
# channel types
channel-type.ecobee.actualAQAccuracy.label = Actual Air Quality Accuracy
channel-type.ecobee.actualAQScore.label = Actual Air Quality Score
channel-type.ecobee.actualHumidity.label = Actual Humidity
channel-type.ecobee.actualTemperature.label = Actual Temperature
channel-type.ecobee.actualCO2.label = Actual CO2
channel-type.ecobee.actualVOC.label = Actual VOC
channel-type.ecobee.alertAcknowledgeRef.label = Acknowledge Ref
channel-type.ecobee.alertAcknowledgement.label = Acknowledgement
channel-type.ecobee.alertDate.label = Date

View File

@@ -202,6 +202,10 @@
<channel id="desiredHeatRangeHigh" typeId="desiredHeatRangeHigh"/>
<channel id="desiredCoolRangeLow" typeId="desiredCoolRangeLow"/>
<channel id="desiredCoolRangeHigh" typeId="desiredCoolRangeHigh"/>
<channel id="actualAQAccuracy" typeId="actualAQAccuracy"/>
<channel id="actualAQScore" typeId="actualAQScore"/>
<channel id="actualCO2" typeId="actualCO2"/>
<channel id="actualVOC" typeId="actualVOC"/>
</channels>
</channel-group-type>
@@ -315,6 +319,26 @@
<label>Desired Cool Range High</label>
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="actualAQAccuracy" advanced="true">
<item-type>Number</item-type>
<label>Actual Air Quality Accuracy</label>
<state readOnly="true" pattern="%d"/>
</channel-type>
<channel-type id="actualAQScore" advanced="true">
<item-type>Number</item-type>
<label>Actual Air Quality Score</label>
<state readOnly="true" pattern="%d"/>
</channel-type>
<channel-type id="actualCO2" advanced="true">
<item-type>Number:Dimensionless</item-type>
<label>Actual CO2</label>
<state readOnly="true" pattern="%d %unit%"/>
</channel-type>
<channel-type id="actualVOC" advanced="true">
<item-type>Number:Dimensionless</item-type>
<label>Actual VOC</label>
<state readOnly="true" pattern="%d %unit%"/>
</channel-type>
<channel-group-type id="settings">
<label>Thermostat Settings</label>