mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-25 14:55:55 +01:00
[venstarthermostat] more functions issue enhancement 10823 (#11305)
* Adding several functions to binding to mimic local API Signed-off-by: raveydavies <matthew.davies@skynet.be> * Adding functionality according to API Signed-off-by: raveydavies <matthew.davies@skynet.be> * Updating Read me with new capability Signed-off-by: raveydavies <matthew.davies@skynet.be> * Additional commit with requested changes to pull request Signed-off-by: raveydavies <matthew.davies@skynet.be> * Updates to address all comments on previous commit. Signed-off-by: raveydavies <matthew.davies@skynet.be> * Updates as requested in review. Signed-off-by: raveydavies <matthew.davies@skynet.be> * Corrections for check style warnings Signed-off-by: raveydavies <matthew.davies@skynet.be> * Updates to address feedback from lolodomo. Signed-off-by: raveydavies <matthew.davies@skynet.be> * Changes to address feedback from lolodomo's review Signed-off-by: raveydavies <matthew.davies@skynet.be> * FanState changed to Switch, Exception handling added as per review. Signed-off-by: raveydavies <matthew.davies@skynet.be>
This commit is contained in:
parent
82ac5ee2d9
commit
6c6c93e8f0
@ -41,21 +41,64 @@ After adding the Inbox item, enter the user name and password from the physical
|
||||
|
||||
### Channels
|
||||
|
||||
| Channel | Type | Description | Notes |
|
||||
|--------------------|--------------------|------------------------------|--------------------------------------------------------|
|
||||
| awayMode | String | Home or Away Mode | |
|
||||
| awayModeRaw | Number | Away Mode Raw (Read Only) | 0 (Home) 1 (Away) |
|
||||
| systemMode | String | System Mode | |
|
||||
| systemModeRaw | Number | System Mode Raw (Read Only) | 0 (Off) 1 (Heat) 2 (Cool) 3 (Auto) |
|
||||
| systemState | String | System State (Read Only) | |
|
||||
| systemStateRaw | Number | System State Raw (Read Only) | 0 (Idle) 1 (Heating) 2 (Cooling) 3 (Lockout) 4 (Error) |
|
||||
| heatingSetpoint | Number:Temperature | Heating Set Point | |
|
||||
| coolingSetpoint | Number:Temperature | Cooling Set Point | |
|
||||
| temperature | Number:Temperature | Current Temperature | |
|
||||
| outdoorTemperature | Number:Temperature | Outdoor Temperature | |
|
||||
| humidity | Number | Humidity | |
|
||||
| Channel | Type | Description | Notes |
|
||||
|--------------------|--------------------|---------------------------------------|--------------------------------------------------------|
|
||||
| awayMode | String | Home or Away Mode | |
|
||||
| awayModeRaw | Number | Away Mode Raw (Read Only) | 0 (Home) 1 (Away) |
|
||||
| systemMode | String | System Mode | |
|
||||
| systemModeRaw | Number | System Mode Raw (Read Only) | 0 (Off) 1 (Heat) 2 (Cool) 3 (Auto) |
|
||||
| systemState | String | System State (Read Only) | |
|
||||
| systemStateRaw | Number | System State Raw (Read Only) | 0 (Idle) 1 (Heating) 2 (Cooling) 3 (Lockout) 4 (Error) |
|
||||
| heatingSetpoint | Number:Temperature | Heating Set Point | |
|
||||
| coolingSetpoint | Number:Temperature | Cooling Set Point | |
|
||||
| temperature | Number:Temperature | Current Temperature | |
|
||||
| outdoorTemperature | Number:Temperature | Outdoor Temperature | |
|
||||
| humidity | Number | Humidity | |
|
||||
| fanMode | String | Fan Mode | |
|
||||
| fanModeRaw | Number | Fan Mode Raw (Read Only) | 0 (Auto) 1 (On) |
|
||||
| fanState | String | Fan State (Read Only) | |
|
||||
| fanStateRaw | Number | Fan State Raw (Read Only) | 0 (Off) 1 (On) |
|
||||
| scheduleMode | String | Current Schedule Mode | |
|
||||
| scheduleModeRaw | Number | Current Schedule mode Raw (Read Only) | 0(Disabled) 1(Enabled) |
|
||||
| schedulePart | String | Current Schedule Part | |
|
||||
| schedulePartRaw | Number | Schedule Part Raw (Read Only) | 0(Morning) 1(Day) 2(Evening) 3 (Night) 255 (Inactive) |
|
||||
|
||||
|
||||
### Runtime data
|
||||
|
||||
The Venstar thermostat provides data about how many minutes the system has been running in each of the different modes (heat1, heat2, cool1, cool2, aux1, aux2, free cool) every day for the last 7 days.
|
||||
A time stamp is provided with each runtime data set which represents the end of each day.
|
||||
The binding reads the runtime data and time stamps and provides them all as separate channels.
|
||||
|
||||
| Channel | Type | Description | Notes |
|
||||
|------------------------|----------------------|----------------------------------------------|------------------------------------------------------------|
|
||||
| timestampDay0 | DateTime | Time Stamp of last runtime update | This is always the current time today |
|
||||
| timestampDay1 | DateTime | Time Stamp of 00:00, end of yesterday | This represents the end of 1 day ago |
|
||||
| timestampDay2 | DateTime | Time Stamp of 00:00 end of 2 days ago | This represents the end of 2 days ago |
|
||||
| timestampDay3 | DateTime | Time Stamp of 00:00, end of 3 days ago | This represents the end of 3 days ago |
|
||||
| timestampDay4 | DateTime | Time Stamp of 00:00, end of 4 days ago | This represents the end of 4 days ago |
|
||||
| timestampDay5 | DateTime | Time Stamp of 00:00, end of 5 days ago | This represents the end of 5 days ago |
|
||||
| timestampDay6 | DateTime | Time Stamp of 00:00, end of 6 days ago | This represents the end of 6 days ago |
|
||||
| heat1RuntimeDay0 | Number:Dimensionless | Runtime in heat1 mode (minutes) today | This is the runtime between the Day 1 and Day 0 timestamps |
|
||||
| heat1RuntimeDay1 | Number:Dimensionless | Runtime in heat1 mode (minutes) yesterday | This is the runtime between the Day 2 and Day 1 timestamps |
|
||||
| heat1RuntimeDay2 | Number:Dimensionless | Runtime in heat1 mode (minutes) 2 days ago | This is the runtime between the Day 3 and Day 2 timestamps |
|
||||
| heat1RuntimeDay3 | Number:Dimensionless | Runtime in heat1 mode (minutes) 3 days ago | This is the runtime between the Day 4 and Day 3 timestamps |
|
||||
| heat1RuntimeDay4 | Number:Dimensionless | Runtime in heat1 mode (minutes) 4 days ago | This is the runtime between the Day 5 and Day 4 timestamps |
|
||||
| heat1RuntimeDay5 | Number:Dimensionless | Runtime in heat1 mode (minutes) 5 days ago | This is the runtime between the Day 6 and Day 5 timestamps |
|
||||
| heat1RuntimeDay6 | Number:Dimensionless | Runtime in heat1 mode (minutes) 6 days ago | This is the runtime in the 24hrs up to the Day 6 timestamp |
|
||||
| | | | |
|
||||
| heat2RuntimeDay0..6 | Number:Dimensionless | Similar Runtimes in heat2 mode (minutes) | |
|
||||
| | | | |
|
||||
| cool1RuntimeDay0..6 | Number:Dimensionless | Similar Runtimes in cool1 mode (minutes) | |
|
||||
| | | | |
|
||||
| cool2RuntimeDay0..6 | Number:Dimensionless | Similar Runtimes in cool2 mode (minutes) | |
|
||||
| | | | |
|
||||
| aux1RuntimeDay0..6 | Number:Dimensionless | Similar Runtimes in aux1 mode (minutes) | |
|
||||
| | | | |
|
||||
| aux2RuntimeDay0..6 | Number:Dimensionless | Similar Runtimes in aux2 mode (minutes) | |
|
||||
| | | | |
|
||||
| freeCoolRuntimeDay0..6 | Number:Dimensionless | Similar Runtimes in free cool mode (minutes) | |
|
||||
|
||||
## Example
|
||||
|
||||
### thermostat.things
|
||||
@ -71,10 +114,22 @@ Thing venstarthermostat:colorTouchThermostat:001122334455 "Venstar Thermostat (G
|
||||
Number:Temperature Guest_HVAC_Temperature "Temperature [%d °F]" {channel="venstarthermostat:colorTouchThermostat:001122334455:temperature"}
|
||||
Number:Temperature Guest_HVAC_HeatSetpoint "Heat Setpoint [%d °F]" {channel="venstarthermostat:colorTouchThermostat:001122334455:heatingSetpoint"}
|
||||
Number:Temperature Guest_HVAC_CoolSetpoint "Cool Setpoint [%d °F]" {channel="venstarthermostat:colorTouchThermostat:001122334455:coolingSetpoint"}
|
||||
Number Guest_HVAC_Mode "Mode [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:systemMode"}
|
||||
String Guest_HVAC_Mode "System Mode [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:systemMode"}
|
||||
Number Guest_HVAC_Humidity "Humidity [%d %%]" {channel="venstarthermostat:colorTouchThermostat:001122334455:humidity"}
|
||||
Number Guest_HVAC_State "State [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:systemState"}
|
||||
Number Guest_Away_Mode "Mode [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:awayMode"}
|
||||
String Guest_HVAC_State "State [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:systemState"}
|
||||
String Guest_Away_Mode "Away Mode [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:awayMode"}
|
||||
String Guest_Fan_Mode "Fan Mode [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:fanMode"}
|
||||
String Guest_Fan_State "Fan State [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:fanState"}
|
||||
String Guest_Schedule_Mode "Schedule Mode [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:scheduleMode"}
|
||||
String Guest_Schedule_Part "Schedule Part [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:schedulePart"}
|
||||
DateTime Guest_timestampDay0 "Date/Time Last Update [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:timestampDay0"}
|
||||
Number Guest_heat1RuntimeDay0 "Heat1 Day0 Run Time [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:heat1RuntimeDay0"}
|
||||
Number Guest_heat2RuntimeDay0 "Heat2 Day 0 Run Time [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:heat2RuntimeDay0"}
|
||||
Number Guest_cool1RuntimeDay0 "Cool1 Day 0 Run Time [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:cool1RuntimeDay0"}
|
||||
Number Guest_cool2RuntimeDay0 "Cool2 Day 0 Run Time [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:cool2RuntimeDay0"}
|
||||
Number Guest_aux1RuntimeDay0 "Aux1 Day 0 Run Time [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:aux1RuntimeDay0"}
|
||||
Number Guest_aux2RuntimeDay0 "Aux2 Day 0 Run Time [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:aux2RuntimeDay0"}
|
||||
Number Guest_freeCoolRuntimeDay0 "Free Cool Day 0 Run Time [%s]" {channel="venstarthermostat:colorTouchThermostat:001122334455:freeCoolRuntimeDay0"}
|
||||
```
|
||||
|
||||
### thermostat.sitemap
|
||||
@ -88,6 +143,19 @@ sitemap demo label="Venstar Color Thermostat Demo"
|
||||
Switch item=Guest_HVAC_Mode mappings=[off=Off,heat=Heat,cool=Cool,auto=Auto]
|
||||
Switch item=Guest_Away_Mode mappings=[home=Home,away=Away]
|
||||
Text item=Guest_HVAC_State
|
||||
Switch item=Guest_Fan_Mode mappings=[auto=Auto, on=On]
|
||||
Text item=Guest_Fan_State
|
||||
Switch item=Guest_Schedule_Mode mappings=[enabled=Enabled,disabled=Disabled]
|
||||
Text item=Guest_Schedule_Part
|
||||
Text item=Guest_timestampDay0
|
||||
Text item=Guest_heat1RuntimeDay0
|
||||
Text item=Guest_heat2RuntimeDay0
|
||||
Text item=Guest_cool1RuntimeDay0
|
||||
Text item=Guest_cool2RuntimeDay0
|
||||
Text item=Guest_aux1RuntimeDay0
|
||||
Text item=Guest_aux2RuntimeDay0
|
||||
Text item=Guest_freeCoolRuntimeDay0
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -24,6 +24,7 @@ import org.openhab.core.thing.ThingTypeUID;
|
||||
*
|
||||
* @author William Welliver - Initial contribution
|
||||
* @author Matthew Davies - added awayMode and awayModeRaw to include thermostat away mode in binding
|
||||
* @author Matthew Davies - added more binding functionality to get close to the API functionality
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public class VenstarThermostatBindingConstants {
|
||||
@ -47,6 +48,23 @@ public class VenstarThermostatBindingConstants {
|
||||
public static final String CHANNEL_SYSTEM_MODE_RAW = "systemModeRaw";
|
||||
public static final String CHANNEL_AWAY_MODE = "awayMode";
|
||||
public static final String CHANNEL_AWAY_MODE_RAW = "awayModeRaw";
|
||||
public static final String CHANNEL_FAN_MODE = "fanMode";
|
||||
public static final String CHANNEL_FAN_MODE_RAW = "fanModeRaw";
|
||||
public static final String CHANNEL_FAN_STATE = "fanState";
|
||||
public static final String CHANNEL_FAN_STATE_RAW = "fanStateRaw";
|
||||
public static final String CHANNEL_SCHEDULE_MODE = "scheduleMode";
|
||||
public static final String CHANNEL_SCHEDULE_MODE_RAW = "scheduleModeRaw";
|
||||
public static final String CHANNEL_SCHEDULE_PART = "schedulePart";
|
||||
public static final String CHANNEL_SCHEDULE_PART_RAW = "schedulePartRaw";
|
||||
public static final String CHANNEL_TIMESTAMP_RUNTIME_DAY = "timestampDay";
|
||||
public static final String CHANNEL_HEAT1_RUNTIME_DAY = "heat1RuntimeDay";
|
||||
public static final String CHANNEL_HEAT2_RUNTIME_DAY = "heat2RuntimeDay";
|
||||
public static final String CHANNEL_COOL1_RUNTIME_DAY = "cool1RuntimeDay";
|
||||
public static final String CHANNEL_COOL2_RUNTIME_DAY = "cool2RuntimeDay";
|
||||
public static final String CHANNEL_AUX1_RUNTIME_DAY = "aux1RuntimeDay";
|
||||
public static final String CHANNEL_AUX2_RUNTIME_DAY = "aux2RuntimeDay";
|
||||
public static final String CHANNEL_FC_RUNTIME_DAY = "freeCoolRuntimeDay";
|
||||
// add query/runtimes and query/alerts - these will need an additional class similar to Venstar.infodata - more work
|
||||
|
||||
public static final String CONFIG_USERNAME = "username";
|
||||
public static final String CONFIG_PASSWORD = "password";
|
||||
|
@ -44,7 +44,7 @@ public enum VenstarAwayMode {
|
||||
return friendlyName;
|
||||
}
|
||||
|
||||
public static VenstarAwayMode fromInt(int mode) {
|
||||
public static VenstarAwayMode fromInt(int mode) throws IllegalArgumentException {
|
||||
for (VenstarAwayMode am : values()) {
|
||||
if (am.mode == mode) {
|
||||
return am;
|
||||
|
@ -30,6 +30,10 @@ public class VenstarAwayModeSerializer implements JsonDeserializer<VenstarAwayMo
|
||||
public VenstarAwayMode deserialize(JsonElement element, Type arg1, JsonDeserializationContext arg2)
|
||||
throws JsonParseException {
|
||||
int key = element.getAsInt();
|
||||
return VenstarAwayMode.fromInt(key);
|
||||
try {
|
||||
return VenstarAwayMode.fromInt(key);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new JsonParseException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Copyright (c) 2010-2021 Contributors to the openHAB project
|
||||
*
|
||||
* See the NOTICE file(s) distributed with this work for additional
|
||||
* information.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.openhab.binding.venstarthermostat.internal.dto;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
|
||||
/**
|
||||
* The {@link VenstarFanMode} represents the value of the fan mode returned
|
||||
* from the REST API.
|
||||
*
|
||||
* @author Matthew Davies - Initial contribution
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public enum VenstarFanMode {
|
||||
AUTO(0, "auto", "Auto"),
|
||||
ON(1, "on", "On");
|
||||
|
||||
private int mode;
|
||||
private String name;
|
||||
private String friendlyName;
|
||||
|
||||
VenstarFanMode(int mode, String name, String friendlyName) {
|
||||
this.mode = mode;
|
||||
this.name = name;
|
||||
this.friendlyName = friendlyName;
|
||||
}
|
||||
|
||||
public int mode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
public String modeName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String friendlyName() {
|
||||
return friendlyName;
|
||||
}
|
||||
|
||||
public static VenstarFanMode fromInt(int mode) throws IllegalArgumentException {
|
||||
for (VenstarFanMode fm : values()) {
|
||||
if (fm.mode == mode) {
|
||||
return fm;
|
||||
}
|
||||
}
|
||||
|
||||
throw (new IllegalArgumentException("Invalid fan mode " + mode));
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Copyright (c) 2010-2021 Contributors to the openHAB project
|
||||
*
|
||||
* See the NOTICE file(s) distributed with this work for additional
|
||||
* information.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.openhab.binding.venstarthermostat.internal.dto;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
/**
|
||||
* The {@link VenstarFanModeSerializer} parses fan mode values
|
||||
* from the REST API JSON.
|
||||
*
|
||||
* @author Matthew Davies - Initial contribution
|
||||
*/
|
||||
|
||||
public class VenstarFanModeSerializer implements JsonDeserializer<VenstarFanMode> {
|
||||
@Override
|
||||
public VenstarFanMode deserialize(JsonElement element, Type arg1, JsonDeserializationContext arg2)
|
||||
throws JsonParseException {
|
||||
int key = element.getAsInt();
|
||||
try {
|
||||
return VenstarFanMode.fromInt(key);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new JsonParseException(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Copyright (c) 2010-2021 Contributors to the openHAB project
|
||||
*
|
||||
* See the NOTICE file(s) distributed with this work for additional
|
||||
* information.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.openhab.binding.venstarthermostat.internal.dto;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
|
||||
/**
|
||||
* The {@link VenstarFanState} represents the state of the fan returned
|
||||
* from the REST API.
|
||||
*
|
||||
* @author Matthew Davies - Initial contribution
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public enum VenstarFanState {
|
||||
OFF(0, "off", "Off"),
|
||||
ON(1, "on", "On");
|
||||
|
||||
private int state;
|
||||
private String name;
|
||||
private String friendlyName;
|
||||
|
||||
VenstarFanState(int state, String name, String friendlyName) {
|
||||
this.state = state;
|
||||
this.name = name;
|
||||
this.friendlyName = friendlyName;
|
||||
}
|
||||
|
||||
public int state() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public String stateName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String friendlyName() {
|
||||
return friendlyName;
|
||||
}
|
||||
|
||||
public static VenstarFanState fromInt(int state) throws IllegalArgumentException {
|
||||
for (VenstarFanState fs : values()) {
|
||||
if (fs.state == state) {
|
||||
return fs;
|
||||
}
|
||||
}
|
||||
|
||||
throw (new IllegalArgumentException("Invalid fan state " + state));
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Copyright (c) 2010-2021 Contributors to the openHAB project
|
||||
*
|
||||
* See the NOTICE file(s) distributed with this work for additional
|
||||
* information.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.openhab.binding.venstarthermostat.internal.dto;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
/**
|
||||
* The {@link VenstarFanStateSerializer} parses system mode values
|
||||
* from the REST API JSON.
|
||||
*
|
||||
* @author Matthew Davies - Initial contribution
|
||||
*/
|
||||
public class VenstarFanStateSerializer implements JsonDeserializer<VenstarFanState> {
|
||||
@Override
|
||||
public VenstarFanState deserialize(JsonElement element, Type arg1, JsonDeserializationContext arg2)
|
||||
throws JsonParseException {
|
||||
|
||||
int key = element.getAsInt();
|
||||
try {
|
||||
return VenstarFanState.fromInt(key);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new JsonParseException(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -19,26 +19,35 @@ package org.openhab.binding.venstarthermostat.internal.dto;
|
||||
* @author Matthew Davies - added VenstarAwayMode to include away mode in binding
|
||||
*/
|
||||
public class VenstarInfoData {
|
||||
double cooltemp;
|
||||
double heattemp;
|
||||
private double cooltemp;
|
||||
private double heattemp;
|
||||
|
||||
VenstarSystemState state;
|
||||
VenstarSystemMode mode;
|
||||
VenstarAwayMode away;
|
||||
int tempunits;
|
||||
private VenstarSystemState state;
|
||||
private VenstarSystemMode mode;
|
||||
private VenstarAwayMode away;
|
||||
private VenstarFanMode fan;
|
||||
private VenstarFanState fanstate;
|
||||
private VenstarScheduleMode schedule;
|
||||
private VenstarSchedulePart schedulepart;
|
||||
private int tempunits;
|
||||
|
||||
public VenstarInfoData() {
|
||||
super();
|
||||
}
|
||||
|
||||
public VenstarInfoData(double cooltemp, double heattemp, VenstarSystemState state, VenstarSystemMode mode,
|
||||
VenstarAwayMode away) {
|
||||
VenstarAwayMode away, VenstarFanMode fan, VenstarFanState fanstate, VenstarScheduleMode schedule,
|
||||
VenstarSchedulePart schedulepart) {
|
||||
super();
|
||||
this.cooltemp = cooltemp;
|
||||
this.heattemp = heattemp;
|
||||
this.state = state;
|
||||
this.mode = mode;
|
||||
this.away = away;
|
||||
this.fan = fan;
|
||||
this.fanstate = fanstate;
|
||||
this.schedule = schedule;
|
||||
this.schedulepart = schedulepart;
|
||||
}
|
||||
|
||||
public double getCooltemp() {
|
||||
@ -57,19 +66,19 @@ public class VenstarInfoData {
|
||||
this.heattemp = heattemp;
|
||||
}
|
||||
|
||||
public VenstarSystemState getState() {
|
||||
public VenstarSystemState getSystemState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(VenstarSystemState state) {
|
||||
public void setSystemState(VenstarSystemState state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public VenstarSystemMode getMode() {
|
||||
public VenstarSystemMode getSystemMode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
public void setMode(VenstarSystemMode mode) {
|
||||
public void setSystemMode(VenstarSystemMode mode) {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
@ -81,11 +90,43 @@ public class VenstarInfoData {
|
||||
this.tempunits = tempunits;
|
||||
}
|
||||
|
||||
public VenstarAwayMode getAway() {
|
||||
public VenstarAwayMode getAwayMode() {
|
||||
return away;
|
||||
}
|
||||
|
||||
public void setAwayMode(VenstarAwayMode away) {
|
||||
this.away = away;
|
||||
}
|
||||
|
||||
public VenstarFanMode getFanMode() {
|
||||
return fan;
|
||||
}
|
||||
|
||||
public void setFanMode(VenstarFanMode fan) {
|
||||
this.fan = fan;
|
||||
}
|
||||
|
||||
public VenstarFanState getFanState() {
|
||||
return fanstate;
|
||||
}
|
||||
|
||||
public void setFanState(VenstarFanState fanstate) {
|
||||
this.fanstate = fanstate;
|
||||
}
|
||||
|
||||
public VenstarScheduleMode getScheduleMode() {
|
||||
return schedule;
|
||||
}
|
||||
|
||||
public void setScheduleMode(VenstarScheduleMode schedule) {
|
||||
this.schedule = schedule;
|
||||
}
|
||||
|
||||
public VenstarSchedulePart getSchedulePart() {
|
||||
return schedulepart;
|
||||
}
|
||||
|
||||
public void setSchedulePart(VenstarSchedulePart schedulepart) {
|
||||
this.schedulepart = schedulepart;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,96 @@
|
||||
/**
|
||||
* Copyright (c) 2010-2021 Contributors to the openHAB project
|
||||
*
|
||||
* See the NOTICE file(s) distributed with this work for additional
|
||||
* information.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.openhab.binding.venstarthermostat.internal.dto;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
|
||||
/**
|
||||
* The {@link VenstarRunTime} represents one Runtime from the RuntimeData returned from the REST API
|
||||
*
|
||||
* @author Matthew Davies - Initial contribution
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public class VenstarRuntime {
|
||||
private long ts;
|
||||
private int heat1;
|
||||
private int heat2;
|
||||
private int cool1;
|
||||
private int cool2;
|
||||
private int aux1;
|
||||
private int aux2;
|
||||
private int fc;
|
||||
|
||||
public long getTimeStamp() {
|
||||
return ts;
|
||||
}
|
||||
|
||||
public void setTimeStamp(long ts) {
|
||||
this.ts = ts;
|
||||
}
|
||||
|
||||
public int getHeat1Runtime() {
|
||||
return heat1;
|
||||
}
|
||||
|
||||
public void setHeat1Runtime(int heat1) {
|
||||
this.heat1 = heat1;
|
||||
}
|
||||
|
||||
public int getHeat2Runtime() {
|
||||
return heat2;
|
||||
}
|
||||
|
||||
public void setHeat2Runtime(int heat2) {
|
||||
this.heat2 = heat2;
|
||||
}
|
||||
|
||||
public int getCool1Runtime() {
|
||||
return cool1;
|
||||
}
|
||||
|
||||
public void setCool1Runtime(int cool1) {
|
||||
this.cool1 = cool1;
|
||||
}
|
||||
|
||||
public int getCool2Runtime() {
|
||||
return cool2;
|
||||
}
|
||||
|
||||
public void setCool2Runtime(int cool2) {
|
||||
this.cool2 = cool2;
|
||||
}
|
||||
|
||||
public int getAux1Runtime() {
|
||||
return aux1;
|
||||
}
|
||||
|
||||
public void setAux1Runtime(int aux1) {
|
||||
this.aux1 = aux1;
|
||||
}
|
||||
|
||||
public int getAux2Runtime() {
|
||||
return aux2;
|
||||
}
|
||||
|
||||
public void setAux2Runtime(int aux2) {
|
||||
this.aux2 = aux2;
|
||||
}
|
||||
|
||||
public int getFreeCoolRuntime() {
|
||||
return fc;
|
||||
}
|
||||
|
||||
public void setFreeCoolRuntime(int fc) {
|
||||
this.fc = fc;
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
/**
|
||||
* Copyright (c) 2010-2021 Contributors to the openHAB project
|
||||
*
|
||||
* See the NOTICE file(s) distributed with this work for additional
|
||||
* information.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.openhab.binding.venstarthermostat.internal.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
|
||||
/**
|
||||
* The {@link VenstarRunTimeData} represents the list of runtimes returned from the REST API.
|
||||
*
|
||||
* @author Matthew Davies - Initial contribution
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public class VenstarRuntimeData {
|
||||
private List<VenstarRuntime> runtimes;
|
||||
|
||||
public VenstarRuntimeData() {
|
||||
super();
|
||||
runtimes = List.of();
|
||||
}
|
||||
|
||||
public VenstarRuntimeData(List<VenstarRuntime> runtimes) {
|
||||
super();
|
||||
this.runtimes = runtimes;
|
||||
}
|
||||
|
||||
public List<VenstarRuntime> getRuntimes() {
|
||||
return runtimes;
|
||||
}
|
||||
|
||||
public void setRuntimes(List<VenstarRuntime> runtimes) {
|
||||
this.runtimes = runtimes;
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Copyright (c) 2010-2021 Contributors to the openHAB project
|
||||
*
|
||||
* See the NOTICE file(s) distributed with this work for additional
|
||||
* information.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.openhab.binding.venstarthermostat.internal.dto;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
|
||||
/**
|
||||
* The {@link VenstarScheduleMode} represents the value of the schedule mode returned
|
||||
* from the REST API.
|
||||
*
|
||||
* @author Matthew Davies - Initial contribution
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public enum VenstarScheduleMode {
|
||||
DISABLED(0, "disabled", "Disabled"),
|
||||
ENABLED(1, "enabled", "Enabled");
|
||||
|
||||
private int mode;
|
||||
private String name;
|
||||
private String friendlyName;
|
||||
|
||||
VenstarScheduleMode(int mode, String name, String friendlyName) {
|
||||
this.mode = mode;
|
||||
this.name = name;
|
||||
this.friendlyName = friendlyName;
|
||||
}
|
||||
|
||||
public int mode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
public String modeName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String friendlyName() {
|
||||
return friendlyName;
|
||||
}
|
||||
|
||||
public static VenstarScheduleMode fromInt(int mode) throws IllegalArgumentException {
|
||||
for (VenstarScheduleMode sm : values()) {
|
||||
if (sm.mode == mode) {
|
||||
return sm;
|
||||
}
|
||||
}
|
||||
|
||||
throw (new IllegalArgumentException("Invalid schedule mode " + mode));
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Copyright (c) 2010-2021 Contributors to the openHAB project
|
||||
*
|
||||
* See the NOTICE file(s) distributed with this work for additional
|
||||
* information.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.openhab.binding.venstarthermostat.internal.dto;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
/**
|
||||
* The {@link VenstarScheduleModeSerializer} parses schedule mode values
|
||||
* from the REST API JSON.
|
||||
*
|
||||
* @author Matthew Davies - Initial contribution
|
||||
*/
|
||||
public class VenstarScheduleModeSerializer implements JsonDeserializer<VenstarScheduleMode> {
|
||||
@Override
|
||||
public VenstarScheduleMode deserialize(JsonElement element, Type arg1, JsonDeserializationContext arg2)
|
||||
throws JsonParseException {
|
||||
int key = element.getAsInt();
|
||||
try {
|
||||
return VenstarScheduleMode.fromInt(key);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new JsonParseException(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
/**
|
||||
* Copyright (c) 2010-2021 Contributors to the openHAB project
|
||||
*
|
||||
* See the NOTICE file(s) distributed with this work for additional
|
||||
* information.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.openhab.binding.venstarthermostat.internal.dto;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
|
||||
/**
|
||||
* The {@link VenstarSchedulePart} represents the schedule part (part of day) returned
|
||||
* from the REST API.
|
||||
*
|
||||
* @author Matthew Davies - Initial contribution
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public enum VenstarSchedulePart {
|
||||
MORNING(0, "morning", "Morning"),
|
||||
DAY(1, "day", "Day"),
|
||||
EVENING(2, "evening", "Evening"),
|
||||
NIGHT(3, "night", "Night"),
|
||||
INACTIVE(255, "inactive", "Inactive");
|
||||
|
||||
private int part;
|
||||
private String name;
|
||||
private String friendlyName;
|
||||
|
||||
VenstarSchedulePart(int part, String name, String friendlyName) {
|
||||
this.part = part;
|
||||
this.name = name;
|
||||
this.friendlyName = friendlyName;
|
||||
}
|
||||
|
||||
public int part() {
|
||||
return part;
|
||||
}
|
||||
|
||||
public String partName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String friendlyName() {
|
||||
return friendlyName;
|
||||
}
|
||||
|
||||
public static VenstarSchedulePart fromInt(int part) throws IllegalArgumentException {
|
||||
for (VenstarSchedulePart sp : values()) {
|
||||
if (sp.part == part) {
|
||||
return sp;
|
||||
}
|
||||
}
|
||||
|
||||
throw (new IllegalArgumentException("Invalid schedule part " + part));
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Copyright (c) 2010-2021 Contributors to the openHAB project
|
||||
*
|
||||
* See the NOTICE file(s) distributed with this work for additional
|
||||
* information.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.openhab.binding.venstarthermostat.internal.dto;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
/**
|
||||
* The {@link VenstarSchedulePartSerializer} parses Schedule Part values
|
||||
* from the REST API JSON.
|
||||
*
|
||||
* @author Matthew Davies - Initial contribution
|
||||
*/
|
||||
public class VenstarSchedulePartSerializer implements JsonDeserializer<VenstarSchedulePart> {
|
||||
@Override
|
||||
public VenstarSchedulePart deserialize(JsonElement element, Type arg1, JsonDeserializationContext arg2)
|
||||
throws JsonParseException {
|
||||
int key = element.getAsInt();
|
||||
try {
|
||||
return VenstarSchedulePart.fromInt(key);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new JsonParseException(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -12,12 +12,15 @@
|
||||
*/
|
||||
package org.openhab.binding.venstarthermostat.internal.dto;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
|
||||
/**
|
||||
* The {@link VenstarSystemMode} represents the value of the system mode returned
|
||||
* from the REST API.
|
||||
*
|
||||
* @author William Welliver - Initial contribution
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public enum VenstarSystemMode {
|
||||
OFF(0, "off", "Off"),
|
||||
HEAT(1, "heat", "Heat"),
|
||||
@ -46,7 +49,7 @@ public enum VenstarSystemMode {
|
||||
return friendlyName;
|
||||
}
|
||||
|
||||
public static VenstarSystemMode fromInt(int mode) {
|
||||
public static VenstarSystemMode fromInt(int mode) throws IllegalArgumentException {
|
||||
for (VenstarSystemMode sm : values()) {
|
||||
if (sm.mode == mode) {
|
||||
return sm;
|
||||
|
@ -24,12 +24,17 @@ import com.google.gson.JsonParseException;
|
||||
* from the REST API JSON.
|
||||
*
|
||||
* @author William Welliver - Initial contribution
|
||||
* @author Matthew Davies - added IllegalArgumentException handling
|
||||
*/
|
||||
public class VenstarSystemModeSerializer implements JsonDeserializer<VenstarSystemMode> {
|
||||
@Override
|
||||
public VenstarSystemMode deserialize(JsonElement element, Type arg1, JsonDeserializationContext arg2)
|
||||
throws JsonParseException {
|
||||
int key = element.getAsInt();
|
||||
return VenstarSystemMode.fromInt(key);
|
||||
try {
|
||||
return VenstarSystemMode.fromInt(key);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new JsonParseException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,12 +12,15 @@
|
||||
*/
|
||||
package org.openhab.binding.venstarthermostat.internal.dto;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
|
||||
/**
|
||||
* The {@link VenstarSystemState} represents the value of the system state
|
||||
* returneda from the REST API.
|
||||
*
|
||||
* @author William Welliver - Initial contribution
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public enum VenstarSystemState {
|
||||
IDLE(0, "idle", "Idle"),
|
||||
HEATING(1, "heating", "Heating"),
|
||||
@ -47,7 +50,7 @@ public enum VenstarSystemState {
|
||||
return friendlyName;
|
||||
}
|
||||
|
||||
public static VenstarSystemState fromInt(int state) {
|
||||
public static VenstarSystemState fromInt(int state) throws IllegalArgumentException {
|
||||
for (VenstarSystemState ss : values()) {
|
||||
if (ss.state == state) {
|
||||
return ss;
|
||||
|
@ -24,12 +24,17 @@ import com.google.gson.JsonParseException;
|
||||
* from the REST API JSON.
|
||||
*
|
||||
* @author William Welliver - Initial contribution
|
||||
* @author Matthew Davies - added IllegalArgumentException handling
|
||||
*/
|
||||
public class VenstarSystemStateSerializer implements JsonDeserializer<VenstarSystemState> {
|
||||
@Override
|
||||
public VenstarSystemState deserialize(JsonElement element, Type arg1, JsonDeserializationContext arg2)
|
||||
throws JsonParseException {
|
||||
int key = element.getAsInt();
|
||||
return VenstarSystemState.fromInt(key);
|
||||
try {
|
||||
return VenstarSystemState.fromInt(key);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new JsonParseException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,10 @@ import java.math.RoundingMode;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@ -49,8 +53,18 @@ import org.eclipse.jetty.util.ssl.SslContextFactory;
|
||||
import org.openhab.binding.venstarthermostat.internal.VenstarThermostatConfiguration;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarAwayMode;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarAwayModeSerializer;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarFanMode;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarFanModeSerializer;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarFanState;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarFanStateSerializer;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarInfoData;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarResponse;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarRuntime;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarRuntimeData;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarScheduleMode;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarScheduleModeSerializer;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarSchedulePart;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarSchedulePartSerializer;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarSensor;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarSensorData;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarSystemMode;
|
||||
@ -58,7 +72,9 @@ import org.openhab.binding.venstarthermostat.internal.dto.VenstarSystemModeSeria
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarSystemState;
|
||||
import org.openhab.binding.venstarthermostat.internal.dto.VenstarSystemStateSerializer;
|
||||
import org.openhab.core.config.core.status.ConfigStatusMessage;
|
||||
import org.openhab.core.library.types.DateTimeType;
|
||||
import org.openhab.core.library.types.DecimalType;
|
||||
import org.openhab.core.library.types.OnOffType;
|
||||
import org.openhab.core.library.types.QuantityType;
|
||||
import org.openhab.core.library.types.StringType;
|
||||
import org.openhab.core.library.unit.ImperialUnits;
|
||||
@ -90,13 +106,12 @@ import com.google.gson.JsonSyntaxException;
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public class VenstarThermostatHandler extends ConfigStatusThingHandler {
|
||||
|
||||
private static final int TIMEOUT_SECONDS = 30;
|
||||
private static final int UPDATE_AFTER_COMMAND_SECONDS = 2;
|
||||
|
||||
private Logger log = LoggerFactory.getLogger(VenstarThermostatHandler.class);
|
||||
private List<VenstarSensor> sensorData = new ArrayList<>();
|
||||
private VenstarInfoData infoData = new VenstarInfoData();
|
||||
private VenstarRuntimeData runtimeData = new VenstarRuntimeData();
|
||||
private Map<String, State> stateMap = Collections.synchronizedMap(new HashMap<>());
|
||||
private @Nullable Future<?> updatesTask;
|
||||
private @Nullable URL baseURL;
|
||||
@ -112,7 +127,11 @@ public class VenstarThermostatHandler extends ConfigStatusThingHandler {
|
||||
httpClient = new HttpClient(new SslContextFactory.Client(true));
|
||||
gson = new GsonBuilder().registerTypeAdapter(VenstarSystemState.class, new VenstarSystemStateSerializer())
|
||||
.registerTypeAdapter(VenstarSystemMode.class, new VenstarSystemModeSerializer())
|
||||
.registerTypeAdapter(VenstarAwayMode.class, new VenstarAwayModeSerializer()).create();
|
||||
.registerTypeAdapter(VenstarAwayMode.class, new VenstarAwayModeSerializer())
|
||||
.registerTypeAdapter(VenstarFanMode.class, new VenstarFanModeSerializer())
|
||||
.registerTypeAdapter(VenstarFanState.class, new VenstarFanStateSerializer())
|
||||
.registerTypeAdapter(VenstarScheduleMode.class, new VenstarScheduleModeSerializer())
|
||||
.registerTypeAdapter(VenstarSchedulePart.class, new VenstarSchedulePartSerializer()).create();
|
||||
|
||||
log.trace("VenstarThermostatHandler for thing {}", getThing().getUID());
|
||||
}
|
||||
@ -168,25 +187,63 @@ public class VenstarThermostatHandler extends ConfigStatusThingHandler {
|
||||
setCoolingSetpoint(value);
|
||||
} else if (channelUID.getId().equals(CHANNEL_SYSTEM_MODE)) {
|
||||
VenstarSystemMode value;
|
||||
if (command instanceof StringType) {
|
||||
value = VenstarSystemMode.valueOf(((StringType) command).toString().toUpperCase());
|
||||
} else {
|
||||
value = VenstarSystemMode.fromInt(((DecimalType) command).intValue());
|
||||
try {
|
||||
if (command instanceof StringType) {
|
||||
value = VenstarSystemMode.valueOf(((StringType) command).toString().toUpperCase());
|
||||
} else {
|
||||
value = VenstarSystemMode.fromInt(((DecimalType) command).intValue());
|
||||
}
|
||||
log.debug("Setting system mode to {}", value);
|
||||
setSystemMode(value);
|
||||
updateIfChanged(CHANNEL_SYSTEM_MODE_RAW, new StringType(value.toString()));
|
||||
} catch (IllegalArgumentException e) {
|
||||
log.warn("Invalid System Mode");
|
||||
}
|
||||
log.debug("Setting system mode to {}", value);
|
||||
setSystemMode(value);
|
||||
updateIfChanged(CHANNEL_SYSTEM_MODE_RAW, new StringType(value.toString()));
|
||||
} else if (channelUID.getId().equals(CHANNEL_AWAY_MODE)) {
|
||||
VenstarAwayMode value;
|
||||
if (command instanceof StringType) {
|
||||
value = VenstarAwayMode.valueOf(((StringType) command).toString().toUpperCase());
|
||||
} else {
|
||||
value = VenstarAwayMode.fromInt(((DecimalType) command).intValue());
|
||||
try {
|
||||
if (command instanceof StringType) {
|
||||
value = VenstarAwayMode.valueOf(((StringType) command).toString().toUpperCase());
|
||||
} else {
|
||||
value = VenstarAwayMode.fromInt(((DecimalType) command).intValue());
|
||||
}
|
||||
log.debug("Setting away mode to {}", value);
|
||||
setAwayMode(value);
|
||||
updateIfChanged(CHANNEL_AWAY_MODE_RAW, new StringType(value.toString()));
|
||||
} catch (IllegalArgumentException e) {
|
||||
log.warn("Invalid Away Mode");
|
||||
}
|
||||
|
||||
} else if (channelUID.getId().equals(CHANNEL_FAN_MODE)) {
|
||||
VenstarFanMode value;
|
||||
try {
|
||||
if (command instanceof StringType) {
|
||||
value = VenstarFanMode.valueOf(((StringType) command).toString().toUpperCase());
|
||||
} else {
|
||||
value = VenstarFanMode.fromInt(((DecimalType) command).intValue());
|
||||
}
|
||||
log.debug("Setting fan mode to {}", value);
|
||||
setFanMode(value);
|
||||
updateIfChanged(CHANNEL_FAN_MODE_RAW, new StringType(value.toString()));
|
||||
} catch (IllegalArgumentException e) {
|
||||
log.warn("Invalid Fan Mode");
|
||||
}
|
||||
} else if (channelUID.getId().equals(CHANNEL_SCHEDULE_MODE)) {
|
||||
VenstarScheduleMode value;
|
||||
try {
|
||||
if (command instanceof StringType) {
|
||||
value = VenstarScheduleMode.valueOf(((StringType) command).toString().toUpperCase());
|
||||
} else {
|
||||
value = VenstarScheduleMode.fromInt(((DecimalType) command).intValue());
|
||||
}
|
||||
log.debug("Setting schedule mode to {}", value);
|
||||
setScheduleMode(value);
|
||||
updateIfChanged(CHANNEL_SCHEDULE_MODE_RAW, new StringType(value.toString()));
|
||||
} catch (IllegalArgumentException e) {
|
||||
log.warn("Invalid Schedule Mode");
|
||||
}
|
||||
log.debug("Setting away mode to {}", value);
|
||||
setAwayMode(value);
|
||||
updateIfChanged(CHANNEL_AWAY_MODE_RAW, new StringType(value.toString()));
|
||||
}
|
||||
|
||||
startUpdatesTask(UPDATE_AFTER_COMMAND_SECONDS);
|
||||
}
|
||||
}
|
||||
@ -298,24 +355,40 @@ public class VenstarThermostatHandler extends ConfigStatusThingHandler {
|
||||
|
||||
private void setCoolingSetpoint(double cool) {
|
||||
double heat = getHeatingSetpoint().doubleValue();
|
||||
VenstarSystemMode mode = getSystemMode();
|
||||
updateControls(heat, cool, mode);
|
||||
VenstarSystemMode mode = infoData.getSystemMode();
|
||||
VenstarFanMode fanmode = infoData.getFanMode();
|
||||
updateControls(heat, cool, mode, fanmode);
|
||||
}
|
||||
|
||||
private void setSystemMode(VenstarSystemMode mode) {
|
||||
double cool = getCoolingSetpoint().doubleValue();
|
||||
double heat = getHeatingSetpoint().doubleValue();
|
||||
updateControls(heat, cool, mode);
|
||||
VenstarFanMode fanmode = infoData.getFanMode();
|
||||
updateControls(heat, cool, mode, fanmode);
|
||||
}
|
||||
|
||||
private void setHeatingSetpoint(double heat) {
|
||||
double cool = getCoolingSetpoint().doubleValue();
|
||||
VenstarSystemMode mode = getSystemMode();
|
||||
updateControls(heat, cool, mode);
|
||||
VenstarSystemMode mode = infoData.getSystemMode();
|
||||
VenstarFanMode fanmode = infoData.getFanMode();
|
||||
updateControls(heat, cool, mode, fanmode);
|
||||
}
|
||||
|
||||
private void setFanMode(VenstarFanMode fanmode) {
|
||||
double cool = getCoolingSetpoint().doubleValue();
|
||||
double heat = getHeatingSetpoint().doubleValue();
|
||||
VenstarSystemMode mode = infoData.getSystemMode();
|
||||
updateControls(heat, cool, mode, fanmode);
|
||||
}
|
||||
|
||||
private void setAwayMode(VenstarAwayMode away) {
|
||||
updateSettings(away);
|
||||
VenstarScheduleMode schedule = infoData.getScheduleMode();
|
||||
updateSettings(away, schedule);
|
||||
}
|
||||
|
||||
private void setScheduleMode(VenstarScheduleMode schedule) {
|
||||
VenstarAwayMode away = infoData.getAwayMode();
|
||||
updateSettings(away, schedule);
|
||||
}
|
||||
|
||||
private QuantityType<Temperature> getCoolingSetpoint() {
|
||||
@ -326,35 +399,37 @@ public class VenstarThermostatHandler extends ConfigStatusThingHandler {
|
||||
return new QuantityType<Temperature>(infoData.getHeattemp(), unitSystem);
|
||||
}
|
||||
|
||||
private VenstarSystemState getSystemState() {
|
||||
return infoData.getState();
|
||||
private ZonedDateTime getTimestampRuntime(VenstarRuntime runtime) {
|
||||
ZoneId zoneId = ZoneId.systemDefault();
|
||||
ZonedDateTime now = LocalDateTime.now().atZone(zoneId);
|
||||
int diff = now.getOffset().getTotalSeconds();
|
||||
ZonedDateTime z = ZonedDateTime.ofInstant(Instant.ofEpochSecond(runtime.getTimeStamp() - diff), zoneId);
|
||||
return z;
|
||||
}
|
||||
|
||||
private VenstarSystemMode getSystemMode() {
|
||||
return infoData.getMode();
|
||||
}
|
||||
|
||||
private VenstarAwayMode getAwayMode() {
|
||||
return infoData.getAway();
|
||||
}
|
||||
|
||||
private void updateSettings(VenstarAwayMode away) {
|
||||
private void updateSettings(VenstarAwayMode away, VenstarScheduleMode schedule) {
|
||||
// this function corresponds to the thermostat local API POST /settings instruction
|
||||
// the function can be expanded with other parameters which are changed via POST /settings
|
||||
// settings that can be included are tempunits, away mode, schedule mode, humidifier setpoint, dehumidifier
|
||||
// setpoint
|
||||
// (hum/dehum are the only ones missing)
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("away", String.valueOf(away.mode()));
|
||||
params.put("schedule", String.valueOf(schedule.mode()));
|
||||
VenstarResponse res = updateThermostat("/settings", params);
|
||||
if (res != null) {
|
||||
log.debug("Updated thermostat");
|
||||
// update our local copy until the next refresh occurs
|
||||
infoData.setAwayMode(away);
|
||||
infoData.setScheduleMode(schedule);
|
||||
// add other parameters here in the same way
|
||||
}
|
||||
}
|
||||
|
||||
private void updateControls(double heat, double cool, VenstarSystemMode mode) {
|
||||
private void updateControls(double heat, double cool, VenstarSystemMode mode, VenstarFanMode fanmode) {
|
||||
// this function corresponds to the thermostat local API POST /control instruction
|
||||
// the function can be expanded with other parameters which are changed via POST /control
|
||||
// controls that can be included are thermostat mode, fan mode, heat temp, cool temp (all done already)
|
||||
Map<String, String> params = new HashMap<>();
|
||||
if (heat > 0) {
|
||||
params.put("heattemp", String.valueOf(heat));
|
||||
@ -363,13 +438,15 @@ public class VenstarThermostatHandler extends ConfigStatusThingHandler {
|
||||
params.put("cooltemp", String.valueOf(cool));
|
||||
}
|
||||
params.put("mode", String.valueOf(mode.mode()));
|
||||
params.put("fan", String.valueOf(fanmode.mode()));
|
||||
VenstarResponse res = updateThermostat("/control", params);
|
||||
if (res != null) {
|
||||
log.debug("Updated thermostat");
|
||||
// update our local copy until the next refresh occurs
|
||||
infoData.setCooltemp(cool);
|
||||
infoData.setHeattemp(heat);
|
||||
infoData.setMode(mode);
|
||||
infoData.setSystemMode(mode);
|
||||
infoData.setFanMode(fanmode);
|
||||
// add other parameters here in the same way
|
||||
}
|
||||
}
|
||||
@ -415,6 +492,29 @@ public class VenstarThermostatHandler extends ConfigStatusThingHandler {
|
||||
updateIfChanged(CHANNEL_EXTERNAL_TEMPERATURE, getOutdoorTemperature());
|
||||
updateIfChanged(CHANNEL_HUMIDITY, getHumidity());
|
||||
|
||||
response = getData("/query/runtimes");
|
||||
if (!isFutureValid(localUpdatesTask)) {
|
||||
return;
|
||||
}
|
||||
|
||||
runtimeData = Objects.requireNonNull(gson.fromJson(response, VenstarRuntimeData.class));
|
||||
List<VenstarRuntime> runtimes = runtimeData.getRuntimes();
|
||||
Collections.reverse(runtimes);// reverse the list so that the most recent runtime data is first in the list
|
||||
int nRuntimes = Math.min(7, runtimes.size());// check how many runtimes are available, might be less than
|
||||
// seven if equipment
|
||||
// was reset, and also might be more than 7, so limit to 7
|
||||
for (int i = 0; i < nRuntimes; i++) {
|
||||
VenstarRuntime rt = runtimes.get(i);
|
||||
updateIfChanged(CHANNEL_TIMESTAMP_RUNTIME_DAY + i, new DateTimeType(getTimestampRuntime(rt)));
|
||||
updateIfChanged(CHANNEL_HEAT1_RUNTIME_DAY + i, new DecimalType(rt.getHeat1Runtime()));
|
||||
updateIfChanged(CHANNEL_HEAT2_RUNTIME_DAY + i, new DecimalType(rt.getHeat2Runtime()));
|
||||
updateIfChanged(CHANNEL_COOL1_RUNTIME_DAY + i, new DecimalType(rt.getCool1Runtime()));
|
||||
updateIfChanged(CHANNEL_COOL2_RUNTIME_DAY + i, new DecimalType(rt.getCool2Runtime()));
|
||||
updateIfChanged(CHANNEL_AUX1_RUNTIME_DAY + i, new DecimalType(rt.getAux1Runtime()));
|
||||
updateIfChanged(CHANNEL_AUX2_RUNTIME_DAY + i, new DecimalType(rt.getAux2Runtime()));
|
||||
updateIfChanged(CHANNEL_FC_RUNTIME_DAY + i, new DecimalType(rt.getFreeCoolRuntime()));
|
||||
}
|
||||
|
||||
response = getData("/query/info");
|
||||
if (!isFutureValid(localUpdatesTask)) {
|
||||
return;
|
||||
@ -423,12 +523,20 @@ public class VenstarThermostatHandler extends ConfigStatusThingHandler {
|
||||
updateUnits(infoData);
|
||||
updateIfChanged(CHANNEL_HEATING_SETPOINT, getHeatingSetpoint());
|
||||
updateIfChanged(CHANNEL_COOLING_SETPOINT, getCoolingSetpoint());
|
||||
updateIfChanged(CHANNEL_SYSTEM_STATE, new StringType(getSystemState().stateName()));
|
||||
updateIfChanged(CHANNEL_SYSTEM_MODE, new StringType(getSystemMode().modeName()));
|
||||
updateIfChanged(CHANNEL_SYSTEM_STATE_RAW, new DecimalType(getSystemState().state()));
|
||||
updateIfChanged(CHANNEL_SYSTEM_MODE_RAW, new DecimalType(getSystemMode().mode()));
|
||||
updateIfChanged(CHANNEL_AWAY_MODE, new StringType(getAwayMode().modeName()));
|
||||
updateIfChanged(CHANNEL_AWAY_MODE_RAW, new DecimalType(getAwayMode().mode()));
|
||||
updateIfChanged(CHANNEL_SYSTEM_STATE, new StringType(infoData.getSystemState().stateName()));
|
||||
updateIfChanged(CHANNEL_SYSTEM_MODE, new StringType(infoData.getSystemMode().modeName()));
|
||||
updateIfChanged(CHANNEL_SYSTEM_STATE_RAW, new DecimalType(infoData.getSystemState().state()));
|
||||
updateIfChanged(CHANNEL_SYSTEM_MODE_RAW, new DecimalType(infoData.getSystemMode().mode()));
|
||||
updateIfChanged(CHANNEL_AWAY_MODE, new StringType(infoData.getAwayMode().modeName()));
|
||||
updateIfChanged(CHANNEL_AWAY_MODE_RAW, new DecimalType(infoData.getAwayMode().mode()));
|
||||
updateIfChanged(CHANNEL_FAN_MODE, new StringType(infoData.getFanMode().modeName()));
|
||||
updateIfChanged(CHANNEL_FAN_MODE_RAW, new DecimalType(infoData.getFanMode().mode()));
|
||||
updateIfChanged(CHANNEL_FAN_STATE, OnOffType.from(infoData.getFanState().stateName()));
|
||||
updateIfChanged(CHANNEL_FAN_STATE_RAW, new DecimalType(infoData.getFanState().state()));
|
||||
updateIfChanged(CHANNEL_SCHEDULE_MODE, new StringType(infoData.getScheduleMode().modeName()));
|
||||
updateIfChanged(CHANNEL_SCHEDULE_MODE_RAW, new DecimalType(infoData.getScheduleMode().mode()));
|
||||
updateIfChanged(CHANNEL_SCHEDULE_PART, new StringType(infoData.getSchedulePart().partName()));
|
||||
updateIfChanged(CHANNEL_SCHEDULE_PART_RAW, new DecimalType(infoData.getSchedulePart().part()));
|
||||
|
||||
goOnline();
|
||||
} catch (VenstarCommunicationException | JsonSyntaxException e) {
|
||||
|
@ -21,6 +21,69 @@
|
||||
<channel id="systemStateRaw" typeId="systemStateRaw"/>
|
||||
<channel id="awayMode" typeId="awayMode"/>
|
||||
<channel id="awayModeRaw" typeId="awayModeRaw"/>
|
||||
<channel id="fanMode" typeId="fanMode"/>
|
||||
<channel id="fanModeRaw" typeId="fanModeRaw"/>
|
||||
<channel id="fanState" typeId="fanState"/>
|
||||
<channel id="fanStateRaw" typeId="fanStateRaw"/>
|
||||
<channel id="scheduleMode" typeId="scheduleMode"/>
|
||||
<channel id="scheduleModeRaw" typeId="scheduleModeRaw"/>
|
||||
<channel id="schedulePart" typeId="schedulePart"/>
|
||||
<channel id="timestampDay0" typeId="timestampRuntime"/>
|
||||
<channel id="timestampDay1" typeId="timestampRuntime"/>
|
||||
<channel id="timestampDay2" typeId="timestampRuntime"/>
|
||||
<channel id="timestampDay3" typeId="timestampRuntime"/>
|
||||
<channel id="timestampDay4" typeId="timestampRuntime"/>
|
||||
<channel id="timestampDay5" typeId="timestampRuntime"/>
|
||||
<channel id="timestampDay6" typeId="timestampRuntime"/>
|
||||
<channel id="heat1RuntimeDay0" typeId="heat1Runtime"/>
|
||||
<channel id="heat1RuntimeDay1" typeId="heat1Runtime"/>
|
||||
<channel id="heat1RuntimeDay2" typeId="heat1Runtime"/>
|
||||
<channel id="heat1RuntimeDay3" typeId="heat1Runtime"/>
|
||||
<channel id="heat1RuntimeDay4" typeId="heat1Runtime"/>
|
||||
<channel id="heat1RuntimeDay5" typeId="heat1Runtime"/>
|
||||
<channel id="heat1RuntimeDay6" typeId="heat1Runtime"/>
|
||||
<channel id="heat2RuntimeDay0" typeId="heat2Runtime"/>
|
||||
<channel id="heat2RuntimeDay1" typeId="heat2Runtime"/>
|
||||
<channel id="heat2RuntimeDay2" typeId="heat2Runtime"/>
|
||||
<channel id="heat2RuntimeDay3" typeId="heat2Runtime"/>
|
||||
<channel id="heat2RuntimeDay4" typeId="heat2Runtime"/>
|
||||
<channel id="heat2RuntimeDay5" typeId="heat2Runtime"/>
|
||||
<channel id="heat2RuntimeDay6" typeId="heat2Runtime"/>
|
||||
<channel id="cool1RuntimeDay0" typeId="cool1Runtime"/>
|
||||
<channel id="cool1RuntimeDay1" typeId="cool1Runtime"/>
|
||||
<channel id="cool1RuntimeDay2" typeId="cool1Runtime"/>
|
||||
<channel id="cool1RuntimeDay3" typeId="cool1Runtime"/>
|
||||
<channel id="cool1RuntimeDay4" typeId="cool1Runtime"/>
|
||||
<channel id="cool1RuntimeDay5" typeId="cool1Runtime"/>
|
||||
<channel id="cool1RuntimeDay6" typeId="cool1Runtime"/>
|
||||
<channel id="cool2RuntimeDay0" typeId="cool2Runtime"/>
|
||||
<channel id="cool2RuntimeDay1" typeId="cool2Runtime"/>
|
||||
<channel id="cool2RuntimeDay2" typeId="cool2Runtime"/>
|
||||
<channel id="cool2RuntimeDay3" typeId="cool2Runtime"/>
|
||||
<channel id="cool2RuntimeDay4" typeId="cool2Runtime"/>
|
||||
<channel id="cool2RuntimeDay5" typeId="cool2Runtime"/>
|
||||
<channel id="cool2RuntimeDay6" typeId="cool2Runtime"/>
|
||||
<channel id="aux1RuntimeDay0" typeId="aux1Runtime"/>
|
||||
<channel id="aux1RuntimeDay1" typeId="aux1Runtime"/>
|
||||
<channel id="aux1RuntimeDay2" typeId="aux1Runtime"/>
|
||||
<channel id="aux1RuntimeDay3" typeId="aux1Runtime"/>
|
||||
<channel id="aux1RuntimeDay4" typeId="aux1Runtime"/>
|
||||
<channel id="aux1RuntimeDay5" typeId="aux1Runtime"/>
|
||||
<channel id="aux1RuntimeDay6" typeId="aux1Runtime"/>
|
||||
<channel id="aux2RuntimeDay0" typeId="aux2Runtime"/>
|
||||
<channel id="aux2RuntimeDay1" typeId="aux2Runtime"/>
|
||||
<channel id="aux2RuntimeDay2" typeId="aux2Runtime"/>
|
||||
<channel id="aux2RuntimeDay3" typeId="aux2Runtime"/>
|
||||
<channel id="aux2RuntimeDay4" typeId="aux2Runtime"/>
|
||||
<channel id="aux2RuntimeDay5" typeId="aux2Runtime"/>
|
||||
<channel id="aux2RuntimeDay6" typeId="aux2Runtime"/>
|
||||
<channel id="freeCoolRuntimeDay0" typeId="freeCoolRuntime"/>
|
||||
<channel id="freeCoolRuntimeDay1" typeId="freeCoolRuntime"/>
|
||||
<channel id="freeCoolRuntimeDay2" typeId="freeCoolRuntime"/>
|
||||
<channel id="freeCoolRuntimeDay3" typeId="freeCoolRuntime"/>
|
||||
<channel id="freeCoolRuntimeDay4" typeId="freeCoolRuntime"/>
|
||||
<channel id="freeCoolRuntimeDay5" typeId="freeCoolRuntime"/>
|
||||
<channel id="freeCoolRuntimeDay6" typeId="freeCoolRuntime"/>
|
||||
</channels>
|
||||
|
||||
<properties>
|
||||
@ -89,6 +152,136 @@
|
||||
<state readOnly="true"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="fanMode">
|
||||
<item-type>String</item-type>
|
||||
<label>Fan Mode</label>
|
||||
<description>Current Fan Mode</description>
|
||||
<state readOnly="false">
|
||||
<options>
|
||||
<option value="auto">Auto</option>
|
||||
<option value="on">On</option>
|
||||
</options>
|
||||
</state>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="fanModeRaw" advanced="true">
|
||||
<item-type>Number</item-type>
|
||||
<label>Fan Mode (Raw)</label>
|
||||
<description>Current Fan Mode, as an integer number</description>
|
||||
<state readOnly="true"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="fanState">
|
||||
<item-type>Switch</item-type>
|
||||
<label>Fan State</label>
|
||||
<description>Current Fan State</description>
|
||||
<state readOnly="true"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="fanStateRaw" advanced="true">
|
||||
<item-type>Number</item-type>
|
||||
<label>Fan State (Raw)</label>
|
||||
<description>Current Fan State, as an integer number</description>
|
||||
<state readOnly="true"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="scheduleMode">
|
||||
<item-type>String</item-type>
|
||||
<label>Schedule Mode</label>
|
||||
<description>Current Schedule Mode</description>
|
||||
<state readOnly="false">
|
||||
<options>
|
||||
<option value="disabled">Disabled</option>
|
||||
<option value="enabled">Enabled</option>
|
||||
</options>
|
||||
</state>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="scheduleModeRaw" advanced="true">
|
||||
<item-type>Number</item-type>
|
||||
<label>Schedule Mode (Raw)</label>
|
||||
<description>Current Schedule Mode, as an integer number</description>
|
||||
<state readOnly="true"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="schedulePart">
|
||||
<item-type>String</item-type>
|
||||
<label>Schedule Part</label>
|
||||
<description>Current Schedule Part</description>
|
||||
<state readOnly="true">
|
||||
<options>
|
||||
<option value="morning">Morning</option>
|
||||
<option value="day">Day</option>
|
||||
<option value="evening">Evening</option>
|
||||
<option value="night">Night</option>
|
||||
<option value="inactive">Inactive</option>
|
||||
</options>
|
||||
</state>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="schedulePartRaw" advanced="true">
|
||||
<item-type>Number</item-type>
|
||||
<label>Schedule Part (Raw)</label>
|
||||
<description>Current Schedule Part, as an integer number</description>
|
||||
<state readOnly="true"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="timestampRuntime" advanced="true">
|
||||
<item-type>DateTime</item-type>
|
||||
<label>Runtime Record Timestamp</label>
|
||||
<description>Time stamp of Runtime Update (Day 0 = TODAY, Day 6 = 6 days ago)</description>
|
||||
<state readOnly="true" pattern="%1$tY-%1$tm-%1$td %1$tH:%1$tM"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="heat1Runtime" advanced="true">
|
||||
<item-type>Number</item-type>
|
||||
<label>Heat1 Runtime Minutes</label>
|
||||
<description>Run time in heat1 mode in minutes (Day 0 = TODAY, Day 6 = 6 days ago)</description>
|
||||
<state readOnly="true" pattern="%d min"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="heat2Runtime" advanced="true">
|
||||
<item-type>Number</item-type>
|
||||
<label>Heat2 Runtime Minutes</label>
|
||||
<description>Run time in heat2 mode in minutes (Day 0 = TODAY, Day 6 = 6 days ago)</description>
|
||||
<state readOnly="true" pattern="%d min"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="cool1Runtime" advanced="true">
|
||||
<item-type>Number</item-type>
|
||||
<label>Cool1 Runtime Minutes</label>
|
||||
<description>Run time in cool1 mode in minutes (Day 0 = TODAY, Day 6 = 6 days ago)</description>
|
||||
<state readOnly="true" pattern="%d min"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="cool2Runtime" advanced="true">
|
||||
<item-type>Number</item-type>
|
||||
<label>Cool2 Runtime Minutes</label>
|
||||
<description>Run time in cool2 mode in minutes (Day 0 = TODAY, Day 6 = 6 days ago)</description>
|
||||
<state readOnly="true" pattern="%d min"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="aux1Runtime" advanced="true">
|
||||
<item-type>Number</item-type>
|
||||
<label>Aux1 Runtime Minutes</label>
|
||||
<description>Run time in aux1 mode in minutes (Day 0 = TODAY, Day 6 = 6 days ago)</description>
|
||||
<state readOnly="true" pattern="%d min"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="aux2Runtime" advanced="true">
|
||||
<item-type>Number</item-type>
|
||||
<label>Aux2 Runtime Minutes</label>
|
||||
<description>Run time in aux2 mode in minutes (Day 0 = TODAY, Day 6 = 6 days ago)</description>
|
||||
<state readOnly="true" pattern="%d min"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="freeCoolRuntime" advanced="true">
|
||||
<item-type>Number</item-type>
|
||||
<label>Free Cool Runtime Minutes</label>
|
||||
<description>Run time in Free Cool mode in minutes (Day 0 = TODAY, Day 6 = 6 days ago)</description>
|
||||
<state readOnly="true" pattern="%d min"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="systemState">
|
||||
<item-type>String</item-type>
|
||||
<label>System State</label>
|
||||
|
Loading…
Reference in New Issue
Block a user