Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[radiothermostat] Added Absolute Setpoint Mode #8393

Merged
merged 8 commits into from
Sep 9, 2020
19 changes: 10 additions & 9 deletions bundles/org.openhab.binding.radiothermostat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ The binding has no configuration options, all configuration is done at Thing lev

The thing has a few configuration parameters:

| Parameter | Description |
|-----------------|-----------------------------------------------------------------------------------------------------------|
| hostName | The host name or IP address of the thermostat. Mandatory. |
| refresh | Overrides the refresh interval of the thermostat data. Optional, the default is 2 minutes. |
| logRefresh | Overrides the refresh interval of the run-time logs & humidity data. Optional, the default is 10 minutes. |
| isCT80 | Flag to enable additional features only available on the CT80 thermostat. Optional, the default is false. |
| disableLogs | Disable retrieval of run-time logs from the thermostat. Optional, the default is false. |
| Parameter | Description |
|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| hostName | The host name or IP address of the thermostat. Mandatory. |
| refresh | Overrides the refresh interval of the thermostat data. Optional, the default is 2 minutes. |
| logRefresh | Overrides the refresh interval of the run-time logs & humidity data. Optional, the default is 10 minutes. |
| isCT80 | Flag to enable additional features only available on the CT80 thermostat. Optional, the default is false. |
| disableLogs | Disable retrieval of run-time logs from the thermostat. Optional, the default is false. |
| absolute | Controls temporary or absolute mode. When false setpoint changes are temporary; the thermostat will return to its program after a time. When true setpoint changes are permanent; the thermostat will ignore its program maintaining the given setpoint. Optional, the default is false. |

## Channels

Expand Down Expand Up @@ -113,8 +114,8 @@ NULL_over=-
radiotherm.things:

```java
radiothermostat:rtherm:mytherm1 "My 1st floor thermostat" [ hostName="192.168.10.1", refresh=2, logRefresh=10, isCT80=false, disableLogs=false ]
radiothermostat:rtherm:mytherm2 "My 2nd floor thermostat" [ hostName="mythermhost2", refresh=1, logRefresh=20, isCT80=true, disableLogs=false ]
radiothermostat:rtherm:mytherm1 "My 1st floor thermostat" [ hostName="192.168.10.1", refresh=2, logRefresh=10, isCT80=false, disableLogs=false, absolute=false ]
radiothermostat:rtherm:mytherm2 "My 2nd floor thermostat" [ hostName="mythermhost2", refresh=1, logRefresh=20, isCT80=true, disableLogs=false, absolute=true ]
```

radiotherm.items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ public class RadioThermostatConfiguration {
public @Nullable Integer logRefresh;
public boolean isCT80 = false;
public boolean disableLogs = false;
public boolean absolute = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ public void handleRawCommand(@Nullable String rawCommand) {
connector.sendCommand(null, null, rawCommand);
}

@SuppressWarnings("null")
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
if (command instanceof RefreshType) {
Expand Down Expand Up @@ -248,10 +249,18 @@ public void handleCommand(ChannelUID channelUID, Command command) {
case SET_POINT:
String cmdKey = null;
if (rthermData.getThermostatData().getMode() == 1) {
cmdKey = "t_heat";
if (config.absolute) {
cmdKey = "a_heat";
} else {
cmdKey = "t_heat";
}
rthermData.getThermostatData().setHeatTarget(cmdInt);
} else if (rthermData.getThermostatData().getMode() == 2) {
cmdKey = "t_cool";
if (config.absolute) {
cmdKey = "a_cool";
} else {
cmdKey = "t_cool";
}
rthermData.getThermostatData().setCoolTarget(cmdInt);
} else {
// don't do anything if we are not in heat or cool mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
<description>Optional Flag to Disable the Retrieval of Run-time Data from the Thermostat</description>
<default>false</default>
</parameter>
<parameter name="absolute" type="boolean">
<label>Run in Absolute Setpoint Mode</label>
<description>Optional Flag to run in absolute or temporary setpoint mode</description>
<default>false</default>
</parameter>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<parameter name="absolute" type="boolean">
<label>Run in Absolute Setpoint Mode</label>
<description>Optional Flag to run in absolute or temporary setpoint mode</description>
<default>false</default>
</parameter>
<parameter name="setpointMode" type="text">
<label>Setpoint Mode</label>
<description>Run in absolute or temporary setpoint mode</description>
<default>temporary</default>
<options>
<option value="absolute">Absolute</option>
<option value="temporary">Temporary</option>
</options>
</parameter>


</config-description>
</thing-type>
Expand Down