| `batteryStatus` | `bus_thermo_cu` | String | The Central Unit Battery status: `OK`, `KO` | R | Y |
| `weeklyProgram` | `bus_thermo_cu` | Number | The program number (`1`, `2`, `3`) when Central Unit mode is `WEEKLY` | R/W | N |
| `scenarioProgram` | `bus_thermo_cu` | Number | The program number (`1`, `2`, .. , `16`) when Central Unit mode is `SCENARIO` | R/W | N |
-
+| `failureDiscovered` | `bus_thermo_cu` | Switch | Indicates if a Failure was discovered by the Central Unit: `ON`, `OFF` | R | Y |
+| `atLeastOneProbeOff` | `bus_thermo_cu` | Switch | Indicates if at least one probe is in OFF mode: `ON`, `OFF` | R | Y |
+| `atLeastOneProbeProtection` | `bus_thermo_cu` | Switch | Indicates if at least one probe is in PROTECTION mode: `ON`, `OFF` | R | Y |
+| `atLeastOneProbeManual` | `bus_thermo_cu` | Switch | Indicates if at least one probe is in MANUAL mode: `ON`, `OFF` | R | Y |
### Notes on channels
// 99 zones central unit
Group gCentralUnit "Central Unit"
Number:Temperature iCU_3550_manualset "Temperature" (gCentralUnit) { channel="openwebnet:bus_thermo_cu:mybridge:CU_3550:setpointTemperature", ga="thermostatTemperatureSetpoint" }
-String iCU_3550_remote "Remote Control" (gCentralUnit) { channel="openwebnet:bus_thermo_cu:mybridge:CU_3550:remoteControl" }
-String iCU_3550_battery "Battery Status" (gCentralUnit) { channel="openwebnet:bus_thermo_cu:mybridge:CU_3550:batteryStatus" }
-String iCU_3550_mode "Mode" (gCentralUnit) { channel="openwebnet:bus_thermo_cu:mybridge:CU_3550:mode" }
-Number iCU_3550_wpn "Weekly Program" (gCentralUnit) { channel="openwebnet:bus_thermo_cu:mybridge:CU_3550:weeklyProgram" }
-Number iCU_3550_spn "Scenario Program" (gCentralUnit) { channel="openwebnet:bus_thermo_cu:mybridge:CU_3550:scenarioProgram" }
+String iCU_3550_remote "Remote Control" (gCentralUnit) { channel="openwebnet:bus_thermo_cu:mybridge:CU_3550:remoteControl" }
+String iCU_3550_battery "Battery Status" (gCentralUnit) { channel="openwebnet:bus_thermo_cu:mybridge:CU_3550:batteryStatus" }
+String iCU_3550_mode "Mode" (gCentralUnit) { channel="openwebnet:bus_thermo_cu:mybridge:CU_3550:mode" }
+Number iCU_3550_wpn "Weekly Program" (gCentralUnit) { channel="openwebnet:bus_thermo_cu:mybridge:CU_3550:weeklyProgram" }
+Number iCU_3550_spn "Scenario Program" (gCentralUnit) { channel="openwebnet:bus_thermo_cu:mybridge:CU_3550:scenarioProgram" }
+String iCU_3550_func "Function" (gCentralUnit) { channel="openwebnet:bus_thermo_cu:mybridge:CU_3550:function" }
+Switch iCU_3550_at1off "At least one probe in OFF" (gCentralUnit) { channel="openwebnet:bus_thermo_cu:mybridge:CU_3550:atLeastOneProbeOff" }
+Switch iCU_3550_at1pro "At least one probe in PROTECTION" (gCentralUnit) { channel="openwebnet:bus_thermo_cu:mybridge:CU_3550:atLeastOneProbeProtection" }
+Switch iCU_3550_at1man "At least one probe in MANUAL" (gCentralUnit) { channel="openwebnet:bus_thermo_cu:mybridge:CU_3550:atLeastOneProbeManual" }
+Switch iCU_3550_failure "Failure discovered" (gCentralUnit) { channel="openwebnet:bus_thermo_cu:mybridge:CU_3550:failureDiscovered" }
Group gLivingRoomZone "Living Room Zone" { ga="Thermostat" [ modes="auto=GENERIC,heat=HEATING,cool=COOLING", thermostatTemperatureRange="7,35", useFahrenheit=false ] }
Number:Temperature iLR_zone_temp "Temperature [%.1f %unit%]" (gLivingRoomZone) { channel="openwebnet:bus_thermo_zone:mybridge:LR_zone:temperature", ga="thermostatTemperatureAmbient" }
import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_ACTUATORS;
import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CONDITIONING_VALVES;
+import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CU_AT_LEAST_ONE_PROBE_MANUAL;
+import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CU_AT_LEAST_ONE_PROBE_OFF;
+import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CU_AT_LEAST_ONE_PROBE_PROTECTION;
import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CU_BATTERY_STATUS;
+import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CU_FAILURE_DISCOVERED;
import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CU_REMOTE_CONTROL;
import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CU_SCENARIO_PROGRAM_NUMBER;
import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_CU_WEEKLY_PROGRAM_NUMBER;
import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_TEMPERATURE;
import static org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants.CHANNEL_TEMP_SETPOINT;
+import java.util.HashSet;
import java.util.Set;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.openwebnet.internal.OpenWebNetBindingConstants;
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.SIUnits;
private String programNumber = "";
+ private static Set<String> probesInProtection = new HashSet<String>();
+ private static Set<String> probesInOFF = new HashSet<String>();
+ private static Set<String> probesInManual = new HashSet<String>();
+
private static final String CU_REMOTE_CONTROL_ENABLED = "ENABLED";
private static final String CU_REMOTE_CONTROL_DISABLED = "DISABLED";
private static final String CU_BATTERY_OK = "OK";
// it's OK and then change to KO if according message is received
updateCUBatteryStatus(CU_BATTERY_OK);
+ // same in case of Failure Discovered
+ updateCUFailureDiscovered(OnOffType.OFF);
+
if (msg.getWhat() == Thermoregulation.WhatThermo.REMOTE_CONTROL_DISABLED) {
updateCURemoteControlStatus(CU_REMOTE_CONTROL_DISABLED);
} else if (msg.getWhat() == Thermoregulation.WhatThermo.REMOTE_CONTROL_ENABLED) {
updateCURemoteControlStatus(CU_REMOTE_CONTROL_ENABLED);
} else if (msg.getWhat() == Thermoregulation.WhatThermo.BATTERY_KO) {
updateCUBatteryStatus(CU_BATTERY_KO);
- } // must intercept all possibile WHATs (will be implemented soon)
- else if (msg.getWhat() == Thermoregulation.WhatThermo.AT_LEAST_ONE_PROBE_OFF) {
- logger.debug("handleMessage() Ignoring unsupported WHAT {}. Frame={}", msg.getWhat(), msg);
+ } else if (msg.getWhat() == Thermoregulation.WhatThermo.AT_LEAST_ONE_PROBE_OFF) {
+ updateCUAtLeastOneProbeOff(OnOffType.ON);
} else if (msg.getWhat() == Thermoregulation.WhatThermo.AT_LEAST_ONE_PROBE_ANTIFREEZE) {
- logger.debug("handleMessage() Ignoring unsupported WHAT {}. Frame={}", msg.getWhat(), msg);
+ updateCUAtLeastOneProbeProtection(OnOffType.ON);
} else if (msg.getWhat() == Thermoregulation.WhatThermo.AT_LEAST_ONE_PROBE_MANUAL) {
- logger.debug("handleMessage() Ignoring unsupported WHAT {}. Frame={}", msg.getWhat(), msg);
+ updateCUAtLeastOneProbeManual(OnOffType.ON);
} else if (msg.getWhat() == Thermoregulation.WhatThermo.FAILURE_DISCOVERED) {
- logger.debug("handleMessage() Ignoring unsupported WHAT {}. Frame={}", msg.getWhat(), msg);
- } else if (msg.getWhat() == Thermoregulation.WhatThermo.RELEASE_SENSOR_LOCAL_ADJUST) {
+ updateCUFailureDiscovered(OnOffType.ON);
+ } // must intercept all possibile WHATs (will be implemented soon)
+ else if (msg.getWhat() == Thermoregulation.WhatThermo.RELEASE_SENSOR_LOCAL_ADJUST) {
logger.debug("handleMessage() Ignoring unsupported WHAT {}. Frame={}", msg.getWhat(), msg);
} else {
// check and eventually parse mode and function
Thermoregulation.OperationMode mode = w.getMode();
Thermoregulation.Function function = w.getFunction();
+ // keep track of thermostats (zones) status
+ if (!isCentralUnit && (!((WhereThermo) deviceWhere).isProbe())) {
+ if (mode == Thermoregulation.OperationMode.OFF) {
+ probesInManual.remove(tmsg.getWhere().value());
+ probesInProtection.remove(tmsg.getWhere().value());
+ if (probesInOFF.add(tmsg.getWhere().value())) {
+ logger.debug("atLeastOneProbeInOFF: added WHERE ---> {}", tmsg.getWhere());
+ }
+ } else if (mode == Thermoregulation.OperationMode.PROTECTION) {
+ probesInManual.remove(tmsg.getWhere().value());
+ probesInOFF.remove(tmsg.getWhere().value());
+ if (probesInProtection.add(tmsg.getWhere().value())) {
+ logger.debug("atLeastOneProbeInProtection: added WHERE ---> {}", tmsg.getWhere());
+ }
+ } else if (mode == Thermoregulation.OperationMode.MANUAL) {
+ probesInProtection.remove(tmsg.getWhere().value());
+ probesInOFF.remove(tmsg.getWhere().value());
+ if (probesInManual.add(tmsg.getWhere().value())) {
+ logger.debug("atLeastOneProbeInManual: added WHERE ---> {}", tmsg.getWhere());
+ }
+ }
+
+ if (probesInOFF.isEmpty()) {
+ updateCUAtLeastOneProbeOff(OnOffType.OFF);
+ }
+ if (probesInProtection.isEmpty()) {
+ updateCUAtLeastOneProbeProtection(OnOffType.OFF);
+ }
+ if (probesInManual.isEmpty()) {
+ updateCUAtLeastOneProbeManual(OnOffType.OFF);
+ }
+ }
+
updateState(CHANNEL_FUNCTION, new StringType(function.toString()));
updateState(CHANNEL_MODE, new StringType(mode.toString()));
private void updateCUBatteryStatus(String status) {
updateState(CHANNEL_CU_BATTERY_STATUS, new StringType(status));
- logger.debug("updateCUBatteryStatus(): {}", status);
+
+ if (status == CU_BATTERY_KO) { // do not log default value (which is automatically setted)
+ logger.debug("updateCUBatteryStatus(): {}", status);
+ }
+ }
+
+ private void updateCUFailureDiscovered(OnOffType status) {
+ updateState(CHANNEL_CU_FAILURE_DISCOVERED, status);
+
+ if (status == OnOffType.ON) { // do not log default value (which is automatically setted)
+ logger.debug("updateCUFailureDiscovered(): {}", status);
+ }
+ }
+
+ private void updateCUAtLeastOneProbeOff(OnOffType status) {
+ updateState(CHANNEL_CU_AT_LEAST_ONE_PROBE_OFF, status);
+ logger.debug("updateCUAtLeastOneProbeOff(): {}", status);
+ }
+
+ private void updateCUAtLeastOneProbeProtection(OnOffType status) {
+ updateState(CHANNEL_CU_AT_LEAST_ONE_PROBE_PROTECTION, status);
+ logger.debug("updateCUAtLeastOneProbeProtection(): {}", status);
+ }
+
+ private void updateCUAtLeastOneProbeManual(OnOffType status) {
+ updateState(CHANNEL_CU_AT_LEAST_ONE_PROBE_MANUAL, status);
+ logger.debug("updateCUAtLeastOneProbeManual(): {}", status);
}
private Boolean channelExists(String channelID) {