After reviewing the code, I believe that at least the following changes are needed:
- Define channel types for the new parameters
Add the following channel types to Constants.java
Below the existing
// channel types
public static final ChannelTypeUID CHANNEL_TYPE_TEMPERATURE = new ChannelTypeUID(
AmazonEchoControlBindingConstants.BINDING_ID, "temperature");
public static final ChannelTypeUID CHANNEL_TYPE_TARGETSETPOINT = new ChannelTypeUID(
AmazonEchoControlBindingConstants.BINDING_ID, "targetSetpoint");
Add
public static final ChannelTypeUID CHANNEL_TYPE_UPPERSETPOINT = new ChannelTypeUID(
AmazonEchoControlBindingConstants.BINDING_ID, "upperSetpoint");
public static final ChannelTypeUID CHANNEL_TYPE_LOWERSETPOINT = new ChannelTypeUID(
AmazonEchoControlBindingConstants.BINDING_ID, "lowerSetpoint");
public static final ChannelTypeUID CHANNEL_TYPE_THERMOSTATMODE = NEW ChannelTypeUID(thermostatMode, "thermostatMode");
- to thing-types.xml add below
<!-- Alexa.ThermostatController -->
<channel-type id="targetSetpoint">
<item-type>Number:Temperature</item-type>
<label>Target Setpoint</label>
<description>Target Setpoint</description>
<state pattern="%.1f %unit%"/>
</channel-type>
Add:
<channel-type id="upperSetpoint">
<item-type>Number:Temperature</item-type>
<label>Cooling Setpoint</label>
<description>Cooling Setpoint</description>
<state pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="lowerSetpoint">
<item-type>Number:Temperature</item-type>
<label>Heating Setpoint</label>
<description>Heating Setpoint</description>
<state pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="thermostatMode">
<item-type>String</item-type>
<label>Cooling Setpoint</label>
<description>Cooling Setpoint</description>
<state pattern="%.1f %unit%"/>
</channel-type>
- To HandlerThermostatController.java, below
// Channel definitions
private static final ChannelInfo TARGET_SETPOINT = new ChannelInfo("targetSetpoint" /* propertyName */ ,
"targetSetpoint" /* ChannelId */, CHANNEL_TYPE_TARGETSETPOINT /* Channel Type */ ,
ITEM_TYPE_NUMBER_TEMPERATURE /* Item Type */);
Add:
private static final ChannelInfo UPPER_SETPOINT = new ChannelInfo("upperSetpoint" /* propertyName */ ,
"upperSetpoint" /* ChannelId */, CHANNEL_TYPE_TARGETSETPOINT /* Channel Type */ ,
ITEM_TYPE_NUMBER_TEMPERATURE /* Item Type */);
private static final ChannelInfo LOWER_SETPOINT = new ChannelInfo("lowerSetpoint" /* propertyName */ ,
"lowerSetpoint" /* ChannelId */, CHANNEL_TYPE_TARGETSETPOINT /* Channel Type */ ,
ITEM_TYPE_NUMBER_TEMPERATURE /* Item Type */);
private static final ChannelInfo THERMOSTAT_MODE = new ChannelInfo("thermostatMode" /* propertyName */ ,
"thermostatMode" /* ChannelId */, CHANNEL_TYPE_THERMOSTATMODE /* Channel Type */ ,
ITEM_TYPE_NUMBER_STRING /* Item Type */);
There may be more.