- The `override` flag is not reported correctly on older thermostat versions (i.e. /tstat/model reports v1.09)
- The 'Program Mode' command is untested and according to the published API is only available on a CT80 Rev B.
- Humidity information is available only when using a CT80 thermostat.
+- If `remote_temp` or `message` channels are used, their values in the thermostat will be cleared during binding shutdown.
## Channels
then
// Display up to 5 numbers in the thermostat's Price Message Area (PMA)
// A decimal point can be used. CT80 can display a negative '-' number
- // Send null or empty string to clear the number and restore the time display
- var Number temp = Math.round((OutsideTemp.state as DecimalType).doubleValue).intValue
+ // Sends empty string to clear the number and restore the time display if OutsideTemp is undefined
+ var temp = ""
+
+ if (newState != null && newState != UNDEF) {
+ temp = Math.round((newState as DecimalType).doubleValue).intValue.toString
+ }
+
Therm_Message.sendCommand(temp)
end
```
*/
package org.openhab.binding.radiothermostat.internal;
-import java.util.Collections;
import java.util.Set;
import javax.measure.Unit;
public static final String REMOTE_TEMP = "remote_temp";
public static final String MESSAGE = "message";
- public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.singleton(THING_TYPE_RTHERM);
+ public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Set.of(THING_TYPE_RTHERM);
public static final Set<String> SUPPORTED_CHANNEL_IDS = Set.of(TEMPERATURE, HUMIDITY, MODE, FAN_MODE, PROGRAM_MODE,
SET_POINT, OVERRIDE, HOLD, STATUS, FAN_STATUS, DAY, HOUR, MINUTE, DATE_STAMP, TODAY_HEAT_RUNTIME,
import static org.openhab.binding.radiothermostat.internal.RadioThermostatBindingConstants.THING_TYPE_RTHERM;
-import java.util.Collections;
import java.util.Set;
import org.eclipse.jdt.annotation.NonNullByDefault;
@Component(service = ThingHandlerFactory.class, configurationPid = "binding.radiothermostat")
public class RadioThermostatHandlerFactory extends BaseThingHandlerFactory {
- private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.singleton(THING_TYPE_RTHERM);
+ private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Set.of(THING_TYPE_RTHERM);
private final RadioThermostatStateDescriptionProvider stateDescriptionProvider;
private final HttpClient httpClient;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
-import java.util.Collections;
import java.util.List;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
@Override
public Collection<Class<? extends ThingHandlerService>> getServices() {
- return Collections.singletonList(RadioThermostatThingActions.class);
+ return List.of(RadioThermostatThingActions.class);
}
/**
logger.debug("Disposing the RadioThermostat handler.");
connector.removeEventListener(this);
+ // Disable Remote Temp and Message Area on shutdown
+ if (isLinked(REMOTE_TEMP)) {
+ connector.sendCommand("rem_mode", "0", REMOTE_TEMP_RESOURCE);
+ }
+
+ if (isLinked(MESSAGE)) {
+ connector.sendCommand("mode", "0", PMA_RESOURCE);
+ }
+
ScheduledFuture<?> refreshJob = this.refreshJob;
if (refreshJob != null) {
refreshJob.cancel(true);