Skip to content

Commit

Permalink
v.2.5.7b
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantin Panchenko <kpanchen@konstantech.com>
  • Loading branch information
kpanchen committed Mar 19, 2020
1 parent bc6b132 commit fdeb19f
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 7 deletions.
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

_This is a Open HAB 2 Binding for Lennox iComfort WiFi system / thermostat (Note this will not work with newer system S30/E30)._

_(Some additional resources will be provided later)_

## Supported Things

This binding supports two things:<br />
1. Thermostat display (currently under development, no Channels currently supported for the thing, Building and Owner information planned)<br />
1. Thermostat display (currently under development, only Alarm Channels currently supported for the thing)<br />
2. Heating / Cooling Zone (multiple zones supported).


Expand Down Expand Up @@ -62,10 +60,12 @@ Temperature - Current zone temperature (Read Only)<br />
Humidity - Current zone humidity (Read Only)<br />
SystemStatus - Current system status (Read Only)<br />
OperationMode - Current operation mode (Read / Write)<br />
UnifiedOperationMode - Similar to OperationMode, compatible with Google Assistant (Read / Write)<br />
AwayMode - Current away status (Read / Write)<br />
FanMode - Current fan mode (Read / Write)<br />
CoolSetPoint - Cool set point for the zone (Read / Write)<br />
HeatSetPoint - Heat set point for the zone (Read / Write)<br />
SetPoint - Heat or Cool set point for the zone (Read / Write)<br />


## Full Example
Expand Down Expand Up @@ -94,7 +94,7 @@ Number:Temperature Thermostat_Heat_Point "Heat Set Point [%.1f %unit%]" <temp
```

```
Thermostat items:
//Thermostat items:
String Alarm_Description "Alarm Description [%s]" <alarm> (gWholeHouse) {channel="icomfortwifi:thermostat:demoaccount:thermostat_1:alertsAndReminders#AlarmDescription"}
Number Alarm_Code "Alarm Code [%s]" <alarm> (gWholeHouse) {channel="icomfortwifi:thermostat:demoaccount:thermostat_1:alertsAndReminders#AlarmNbr"}
String Alarm_Type "Alarm Type [%s]" <alarm> (gWholeHouse) {channel="icomfortwifi:thermostat:demoaccount:thermostat_1:alertsAndReminders#AlarmType"}
Expand All @@ -104,6 +104,7 @@ Number Alarm_Number "Alarm Number [%s]" <alarm> (gWholeHouse) {channel="icomfort
```

Sitemap example:

```
Text item=Thermostat_Temperature
Text item=Thermostat_Humudity
Expand All @@ -123,6 +124,18 @@ Text item=Alarm_DateTimeSet
Setpoint item=Alarm_Number
```

Items example for Google Assistant (for more details see Google Assistant for OpenHAB 2 documentation):

```
Group gHomeThermostatGA "House Thermostat" { ga="Thermostat" [modes="off,heat,cool,heatcool,eco", roomHint="Living Room"] }
String Thermostate_Mode_GA "Thermostat Mode" (gHomeThermostatGA) {ga="thermostatMode", channel="icomfortwifi:zone:demoaccount:home_zone_1:UnifiedOperationMode"} //Available modes listed on the Group item
Number Thermostate_Temp_GA "House Temperature" (gHomeThermostatGA) {ga="thermostatTemperatureAmbient", channel="icomfortwifi:zone:demoaccount:home_zone_1:Temperature"}
Number Thermostate_Humid_GA "House Humidity" (gHomeThermostatGA) {ga="thermostatHumidityAmbient", channel="icomfortwifi:zone:demoaccount:home_zone_1:Humidity"} //Won't be shown in Google Home App, but will be return with voice responce
Number Thermostate_Setpoint_GA "House Setpoint" (gHomeThermostatGA) {ga="thermostatTemperatureSetpoint", channel="icomfortwifi:zone:demoaccount:home_zone_1:SetPoint"} //Temperature Set Point for Cool or Heat mode
Number Thermostate_Setpoint_High_GA "House Setpoint High" (gHomeThermostatGA) {ga="thermostatTemperatureSetpointHigh", channel="icomfortwifi:zone:demoaccount:home_zone_1::CoolSetPoint"} //Temperature high (cooling) set point in auto-select Cool/Heat mode
Number Thermostate_Setpoint_Low_GA "House Setpoint Low" (gHomeThermostatGA) {ga="thermostatTemperatureSetpointLow", channel="icomfortwifi:zone:demoaccount:home_zone_1::HeatSetPoint"} //Temperature low (heating) set point in auto-select Cool/Heat mode
```

## Foot note!

This binding is based on Nest binding and EVO Home binding, all the credits for original code goes to the original authors.<br />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,23 @@ public void update(ThingStatus tcsStatus, ZoneStatus zoneStatus) {
new StringType(zoneStatus.operationMode.toString()));
if (zoneStatus.awayMode == AwayStatus.AWAY_ON) {
updateState(iComfortWiFiBindingConstants.ZONE_UNIFIED_OPERATION_MODE_CHANNEL,
new StringType(zoneStatus.awayMode.toString()));
new StringType(UnifiedOperationMode.ECO.toString()));
} else if (zoneStatus.operationMode == OperationMode.OFF) {
updateState(iComfortWiFiBindingConstants.ZONE_UNIFIED_OPERATION_MODE_CHANNEL,
new StringType(UnifiedOperationMode.OFF.toString()));
} else if (zoneStatus.operationMode == OperationMode.HEAT_ONLY) {
updateState(iComfortWiFiBindingConstants.ZONE_UNIFIED_OPERATION_MODE_CHANNEL,
new StringType(UnifiedOperationMode.HEAT.toString()));
updateState(iComfortWiFiBindingConstants.ZONE_SET_POINT_CHANNEL, new QuantityType<>(
zoneStatus.heatSetPoint, zoneStatus.preferredTemperatureUnit.getTemperatureUnit()));
} else if (zoneStatus.operationMode == OperationMode.COOL_ONLY) {
updateState(iComfortWiFiBindingConstants.ZONE_UNIFIED_OPERATION_MODE_CHANNEL,
new StringType(UnifiedOperationMode.COOL.toString()));
updateState(iComfortWiFiBindingConstants.ZONE_SET_POINT_CHANNEL, new QuantityType<>(
zoneStatus.coolSetPoint, zoneStatus.preferredTemperatureUnit.getTemperatureUnit()));
} else if (zoneStatus.operationMode == OperationMode.HEAT_OR_COOL) {
updateState(iComfortWiFiBindingConstants.ZONE_UNIFIED_OPERATION_MODE_CHANNEL,
new StringType(UnifiedOperationMode.ECO.toString()));
new StringType(UnifiedOperationMode.HEAT_COOL.toString()));
}
updateState(iComfortWiFiBindingConstants.ZONE_AWAY_MODE_CHANNEL,
new StringType(zoneStatus.awayMode.toString()));
Expand Down Expand Up @@ -128,24 +132,30 @@ public void handleCommand(ChannelUID channelUID, Command command) {

if ((command.toString().toLowerCase().equals(UnifiedOperationMode.ECO.toString()))
&& (zoneStatus.awayMode == AwayStatus.AWAY_OFF)) {
logger.debug("Setting Heating Zone to Away mode with command {}", command.toString());
bridge.setZoneAwayMode(zoneStatus, AwayStatus.AWAY_ON.getAwayValue());
} else if (command.toString().toLowerCase().equals(UnifiedOperationMode.OFF.toString())) {
logger.debug("Setting Heating Zone to Off mode with command {}", command.toString());
bridge.setZoneAwayMode(zoneStatus, AwayStatus.AWAY_OFF.getAwayValue());
bridge.setZoneFanMode(zoneStatus, FanMode.AUTO.getFanModeValue());
bridge.setZoneOperationMode(zoneStatus, OperationMode.OFF.getOperationModeValue());
} else if (command.toString().toLowerCase().equals(UnifiedOperationMode.COOL.toString())) {
logger.debug("Setting Heating Zone to Cool mode with command {}", command.toString());
bridge.setZoneAwayMode(zoneStatus, AwayStatus.AWAY_OFF.getAwayValue());
bridge.setZoneFanMode(zoneStatus, FanMode.AUTO.getFanModeValue());
bridge.setZoneOperationMode(zoneStatus, OperationMode.COOL_ONLY.getOperationModeValue());
} else if (command.toString().toLowerCase().equals(UnifiedOperationMode.HEAT.toString())) {
logger.debug("Setting Heating Zone to Heat mode with command {}", command.toString());
bridge.setZoneAwayMode(zoneStatus, AwayStatus.AWAY_OFF.getAwayValue());
bridge.setZoneFanMode(zoneStatus, FanMode.AUTO.getFanModeValue());
bridge.setZoneOperationMode(zoneStatus, OperationMode.HEAT_ONLY.getOperationModeValue());
} else if (command.toString().toLowerCase().equals(UnifiedOperationMode.HEAT_COOL.toString())) {
logger.debug("Setting Heating Zone to HeatCool mode with command {}", command.toString());
bridge.setZoneAwayMode(zoneStatus, AwayStatus.AWAY_OFF.getAwayValue());
bridge.setZoneFanMode(zoneStatus, FanMode.AUTO.getFanModeValue());
bridge.setZoneOperationMode(zoneStatus, OperationMode.HEAT_OR_COOL.getOperationModeValue());
} else if (command.toString().toLowerCase().equals(UnifiedOperationMode.FAN_ONLY.toString())) {
logger.debug("Setting Heating Zone to Fan Only mode with command {}", command.toString());
bridge.setZoneAwayMode(zoneStatus, AwayStatus.AWAY_OFF.getAwayValue());
bridge.setZoneOperationMode(zoneStatus, OperationMode.OFF.getOperationModeValue());
bridge.setZoneFanMode(zoneStatus, FanMode.CIRCULATE.getFanModeValue());
Expand All @@ -162,6 +172,16 @@ public void handleCommand(ChannelUID channelUID, Command command) {
} else if (iComfortWiFiBindingConstants.ZONE_HEAT_SET_POINT_CHANNEL.equals(channelId)
&& command instanceof QuantityType) {
bridge.setZoneHeatingPoint(zoneStatus, ((QuantityType<Temperature>) command).doubleValue());
} else if (iComfortWiFiBindingConstants.ZONE_SET_POINT_CHANNEL.equals(channelId)
&& command instanceof QuantityType) {
if (zoneStatus.operationMode == OperationMode.HEAT_ONLY) {
bridge.setZoneHeatingPoint(zoneStatus, ((QuantityType<Temperature>) command).doubleValue());
} else if (zoneStatus.operationMode == OperationMode.COOL_ONLY) {
bridge.setZoneCoolingPoint(zoneStatus, ((QuantityType<Temperature>) command).doubleValue());
} else {
logger.debug("Zone is not in Heat or Cool mode, cannot use Temperature Set Point");
}

} else if (iComfortWiFiBindingConstants.ZONE_OPERATION_MODE_CHANNEL.equals(channelId)) {
bridge.setZoneOperationMode(zoneStatus,
OperationMode.valueOf(command.toString()).getOperationModeValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public class iComfortWiFiBindingConstants {
public static final String ZONE_FAN_MODE_CHANNEL = "FanMode";
public static final String ZONE_COOL_SET_POINT_CHANNEL = "CoolSetPoint";
public static final String ZONE_HEAT_SET_POINT_CHANNEL = "HeatSetPoint";
public static final String ZONE_SET_POINT_CHANNEL = "SetPoint"; // To set heat only / cool only point

// TCS Channels
public static final String TCS_ALARM_DESCRIPTION_CHANNEL = "alertsAndReminders#AlarmDescription";
Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/ESH-INF/thing/channels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@
<category>Temperature</category>
<state step="0.5" pattern="%.1f %unit%" readOnly="false"/>
</channel-type>

<channel-type id="setPoint">
<item-type>Number:Temperature</item-type>
<label>Temperature Set Point</label>
<description>Gets or sets the heat or cool set point of this zone automatically.</description>
<category>Temperature</category>
<state step="0.5" pattern="%.1f %unit%" readOnly="false"/>
</channel-type>

<channel-type id="alarmDescription">
<item-type>String</item-type>
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/ESH-INF/thing/thing-types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
<channel id="AwayMode" typeId="awayMode" />
<channel id="FanMode" typeId="fanMode" />
<channel id="CoolSetPoint" typeId="coolSetPoint" />
<channel id="HeatSetPoint" typeId="heatSetPoint" />
<channel id="HeatSetPoint" typeId="heatSetPoint" />
<channel id="SetPoint" typeId="setPoint" />
</channels>
<config-description>
<parameter name="id" type="text" required="true" readOnly="true">
Expand Down

0 comments on commit fdeb19f

Please sign in to comment.