[openwebnet] Thermo: fixes update setPoint when local offset in in use (#16626)
Signed-off-by: Massimo Valla <mvcode00@gmail.com>pull/16657/head
parent
0b9ea4d3f1
commit
d498a1622f
|
@ -163,7 +163,7 @@ The (optional) Central Unit can be configured defining a `bus_themo_cu` Thing wi
|
||||||
|
|
||||||
##### Thermo Central Unit integration known limitations
|
##### Thermo Central Unit integration known limitations
|
||||||
|
|
||||||
- Read setPoint temperature and current mode
|
- Read CU setPoint temperature when in WEEKLY / SCENARIO / PROTECTION / VACATION / HOLIDAY
|
||||||
- Set VACATION deadline date / time
|
- Set VACATION deadline date / time
|
||||||
- Central Unit Programming and Customisations settings (T1/2/3 temperature levels, setting date & time, weekly/scenarios/holiday profiles programming, etc.)
|
- Central Unit Programming and Customisations settings (T1/2/3 temperature levels, setting date & time, weekly/scenarios/holiday profiles programming, etc.)
|
||||||
|
|
||||||
|
@ -242,8 +242,8 @@ OPEN command to execute: *5*8#134##
|
||||||
|
|
||||||
| Channel Type ID (channel ID) | Applies to Thing Type IDs | Item Type | Description | Read/Write | Advanced |
|
| Channel Type ID (channel ID) | Applies to Thing Type IDs | Item Type | Description | Read/Write | Advanced |
|
||||||
| ---------------------------- | -------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------- | :--------: | :------: |
|
| ---------------------------- | -------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------- | :--------: | :------: |
|
||||||
| `temperature` | `bus_thermo_zone`, `bus_thermo_sensor` | Number:Temperature | The zone currently sensed temperature | R | N |
|
| `temperature` | `bus_thermo_zone`, `bus_thermo_sensor` | Number:Temperature | Currently sensed temperature for zone or sensor | R | N |
|
||||||
| `setpointTemperature` | `bus_thermo_zone`, `bus_thermo_cu` | Number:Temperature | The zone or Central Unit setpoint temperature | R/W | N |
|
| `setpointTemperature` | `bus_thermo_zone`, `bus_thermo_cu` | Number:Temperature | The zone or Central Unit manual setpoint temperature | R/W | N |
|
||||||
| `function` | `bus_thermo_zone`, `bus_thermo_cu` | String | The zone set thermo function (`COOLING`, `HEATING`, `GENERIC`) or the Central Unit thermo function (`COOLING`, `HEATING`) | R/W | N |
|
| `function` | `bus_thermo_zone`, `bus_thermo_cu` | String | The zone set thermo function (`COOLING`, `HEATING`, `GENERIC`) or the Central Unit thermo function (`COOLING`, `HEATING`) | R/W | N |
|
||||||
| `mode` | `bus_thermo_zone`, `bus_thermo_cu` | String | The zone set mode (`AUTO`, `MANUAL`, `OFF`, `PROTECTION`) or the Central Unit set mode (`WEEKLY`, `MANUAL`, `SCENARIO`, `HOLIDAY`, `VACATION`, `OFF`, `PROTECTION`) | R/W | N |
|
| `mode` | `bus_thermo_zone`, `bus_thermo_cu` | String | The zone set mode (`AUTO`, `MANUAL`, `OFF`, `PROTECTION`) or the Central Unit set mode (`WEEKLY`, `MANUAL`, `SCENARIO`, `HOLIDAY`, `VACATION`, `OFF`, `PROTECTION`) | R/W | N |
|
||||||
| `speedFanCoil` | `bus_thermo_zone` | String | The zone fancoil speed: `AUTO`, `SPEED_1`, `SPEED_2`, `SPEED_3` | R/W | N |
|
| `speedFanCoil` | `bus_thermo_zone` | String | The zone fancoil speed: `AUTO`, `SPEED_1`, `SPEED_2`, `SPEED_3` | R/W | N |
|
||||||
|
@ -255,11 +255,11 @@ OPEN command to execute: *5*8#134##
|
||||||
| `batteryStatus` | `bus_thermo_cu` | String | The Central Unit Battery status: `OK`, `KO` | R | Y |
|
| `batteryStatus` | `bus_thermo_cu` | String | The Central Unit Battery status: `OK`, `KO` | R | Y |
|
||||||
| `weeklyProgram` | `bus_thermo_cu` | Number | The weekly program number (`1`, `2`, `3`) when Central Unit mode is `WEEKLY` | R/W | N |
|
| `weeklyProgram` | `bus_thermo_cu` | Number | The weekly program number (`1`, `2`, `3`) when Central Unit mode is `WEEKLY` | R/W | N |
|
||||||
| `scenarioProgram` | `bus_thermo_cu` | Number | The scenario program number (`1`, `2`, ... , `16`) when Central Unit mode is `SCENARIO` | R/W | N |
|
| `scenarioProgram` | `bus_thermo_cu` | Number | The scenario program number (`1`, `2`, ... , `16`) when Central Unit mode is `SCENARIO` | R/W | N |
|
||||||
| `vacationDays` | `bus_thermo_cu` | Number | Number of days 1-255 the Central Unit will be set to Antifreeze / Heat Protection temperature before returning to mode WEEKLY (read/write) | R/W | N |
|
| `vacationDays` | `bus_thermo_cu` | Number | Number of days 1-255 the Central Unit will be set to Anti-freeze / Heat Protection temperature before returning to mode WEEKLY | R/W | N |
|
||||||
| `failureDiscovered` | `bus_thermo_cu` | Switch | Indicates if a Failure was discovered by the Central Unit: `ON`, `OFF` | R | Y |
|
| `failureDiscovered` | `bus_thermo_cu` | Switch | Indicates if a Failure was discovered by the Central Unit (`ON`), or not (`OFF`) | R | Y |
|
||||||
| `atLeastOneProbeOff` | `bus_thermo_cu` | Switch | Indicates if at least one probe is in OFF mode: `ON`, `OFF` | R | Y |
|
| `atLeastOneProbeOff` | `bus_thermo_cu` | Switch | Indicates if at least one probe is in OFF mode (`ON`) or not (`OFF`) | R | Y |
|
||||||
| `atLeastOneProbeProtection` | `bus_thermo_cu` | Switch | Indicates if at least one probe is in PROTECTION mode: `ON`, `OFF` | R | Y |
|
| `atLeastOneProbeProtection` | `bus_thermo_cu` | Switch | Indicates if at least one probe is in PROTECTION mode (`ON`) or not (`OFF`) | R | Y |
|
||||||
| `atLeastOneProbeManual` | `bus_thermo_cu` | Switch | Indicates if at least one probe is in MANUAL mode: `ON`, `OFF` | R | Y |
|
| `atLeastOneProbeManual` | `bus_thermo_cu` | Switch | Indicates if at least one probe is in MANUAL mode (`ON`) or not (`OFF`) | R | Y |
|
||||||
|
|
||||||
### Notes on channels
|
### Notes on channels
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ import org.openhab.core.thing.ThingTypeUID;
|
||||||
import org.openhab.core.types.Command;
|
import org.openhab.core.types.Command;
|
||||||
import org.openhab.core.types.UnDefType;
|
import org.openhab.core.types.UnDefType;
|
||||||
import org.openwebnet4j.communication.OWNException;
|
import org.openwebnet4j.communication.OWNException;
|
||||||
|
import org.openwebnet4j.communication.Response;
|
||||||
import org.openwebnet4j.message.BaseOpenMessage;
|
import org.openwebnet4j.message.BaseOpenMessage;
|
||||||
import org.openwebnet4j.message.FrameException;
|
import org.openwebnet4j.message.FrameException;
|
||||||
import org.openwebnet4j.message.MalformedFrameException;
|
import org.openwebnet4j.message.MalformedFrameException;
|
||||||
|
@ -295,10 +296,24 @@ public class OpenWebNetThermoregulationHandler extends OpenWebNetThingHandler {
|
||||||
} else {
|
} else {
|
||||||
newTemp = ((DecimalType) command).doubleValue();
|
newTemp = ((DecimalType) command).doubleValue();
|
||||||
}
|
}
|
||||||
try {
|
if (newTemp >= 5.0 && newTemp <= 40.0) {
|
||||||
send(Thermoregulation.requestWriteSetpointTemperature(getWhere(w.value()), newTemp, currentFunction));
|
try {
|
||||||
} catch (MalformedFrameException | OWNException e) {
|
Response res;
|
||||||
logger.warn("handleSetpoint() {}", e.getMessage());
|
res = send(Thermoregulation.requestWriteSetpointTemperature(getWhere(w.value()), newTemp,
|
||||||
|
currentFunction));
|
||||||
|
// For zones no setPoint temperature confirmation message is returned from gw,
|
||||||
|
// so we update channel with current requested temp on successful response.
|
||||||
|
if (!isCentralUnit && res != null && res.isSuccess()) {
|
||||||
|
updateState(CHANNEL_TEMP_SETPOINT, getAsQuantityTypeOrNull(newTemp, SIUnits.CELSIUS));
|
||||||
|
currentSetPointTemp = newTemp;
|
||||||
|
}
|
||||||
|
} catch (MalformedFrameException | OWNException e) {
|
||||||
|
logger.warn("handleSetpoint() {}", e.getMessage());
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
logger.info("handleSetpoint() Setpoint temperature must be between 5°C and 40°C for thing {}",
|
||||||
|
getThing().getUID());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.warn("handleSetpoint() Unsupported command {} for thing {}", command, getThing().getUID());
|
logger.warn("handleSetpoint() Unsupported command {} for thing {}", command, getThing().getUID());
|
||||||
|
@ -465,9 +480,10 @@ public class OpenWebNetThermoregulationHandler extends OpenWebNetThingHandler {
|
||||||
DimThermo dim = (DimThermo) tmsg.getDim();
|
DimThermo dim = (DimThermo) tmsg.getDim();
|
||||||
switch (dim) {
|
switch (dim) {
|
||||||
case TEMP_SETPOINT:
|
case TEMP_SETPOINT:
|
||||||
case COMPLETE_PROBE_STATUS:
|
|
||||||
updateSetpoint(tmsg);
|
updateSetpoint(tmsg);
|
||||||
break;
|
break;
|
||||||
|
case COMPLETE_PROBE_STATUS:
|
||||||
|
break;
|
||||||
case PROBE_TEMPERATURE:
|
case PROBE_TEMPERATURE:
|
||||||
case TEMPERATURE:
|
case TEMPERATURE:
|
||||||
updateTemperature(tmsg);
|
updateTemperature(tmsg);
|
||||||
|
@ -599,7 +615,7 @@ public class OpenWebNetThermoregulationHandler extends OpenWebNetThingHandler {
|
||||||
}
|
}
|
||||||
String[] parameters = tmsg.getWhatParams();
|
String[] parameters = tmsg.getWhatParams();
|
||||||
if (parameters.length > 0 && tw.getType() == WhatThermoType.MANUAL) {
|
if (parameters.length > 0 && tw.getType() == WhatThermoType.MANUAL) {
|
||||||
// it should be like *4*110#TTTT*#0##
|
// manual setpoint frame should be like *4*110#TTTT*#0##
|
||||||
newTemp = Thermoregulation.decodeTemperature(parameters[0]);
|
newTemp = Thermoregulation.decodeTemperature(parameters[0]);
|
||||||
logger.debug("updateSetpoint() parsed temperature from {}: {} ---> {}", tmsg.toStringVerbose(),
|
logger.debug("updateSetpoint() parsed temperature from {}: {} ---> {}", tmsg.toStringVerbose(),
|
||||||
parameters[0], newTemp);
|
parameters[0], newTemp);
|
||||||
|
|
Loading…
Reference in New Issue