Skip to content

Commit 26fd8c6

Browse files
authored
[openwebnet] Thermo: Fixed handling of mode=AUTO for bus_thermo_zone (openhab#16534)
* [openwebnet] improved Thermo mode/weekly/scenario channels descriptions * [openwebnet] Fixed handling of mode=AUTO for bus_thermo_zone Fixes openhab#13754 --------- Signed-off-by: Massimo Valla <[email protected]>
1 parent c8d3988 commit 26fd8c6

File tree

5 files changed

+85
-71
lines changed

5 files changed

+85
-71
lines changed

bundles/org.openhab.binding.openwebnet/README.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The following Things and OpenWebNet `WHOs` are supported:
4444
| Gateway Management | `13` | `bus_gateway` | Any IP gateway supporting OpenWebNet protocol should work | Successfully tested: F452, F453, F453AV,F454, F455, MyHOMEServer1, MyHOME_Screen10, MyHOME_Screen3,5, MH201, MH202, MH200N. Some connection stability issues/gateway resets reported with MH202  |
4545
| Lighting | `1` | `bus_on_off_switch`, `bus_dimmer` | BUS switches and dimmers | Successfully tested: F411/2, F411/4, F411U2, F422, F429. Some discovery issues reported with F429 (DALI Dimmers) |
4646
| Automation | `2` | `bus_automation` | BUS roller shutters, with position feedback and auto-calibration | Successfully tested: LN4672M2 |
47-
| Temperature Control | `4` | `bus_thermo_zone`, `bus_thermo_sensor`, `bus_thermo_cu` | Thermo zones management and temperature sensors (probes) | Successfully tested: H/LN4691, HS4692, KG4691; thermo sensors: L/N/NT4577 + 3455; Central Units (4 or 99 zones) are not fully supported yet. See [Channels - Thermo](#configuring-thermo) for more details |
47+
| Temperature Control | `4` | `bus_thermo_zone`, `bus_thermo_sensor`, `bus_thermo_cu` | Thermo zones management and temperature sensors (probes) | Successfully tested: H/LN4691, HS4692, KG4691; thermo sensors: L/N/NT4577 + 3455. Partially tested: Central Units 4-zones (models L/N/NT/HD/HC/HS4695) and 99-zones (model 3550). See [Channels - Thermo](#configuring-thermo) for more details |
4848
| Alarm | `5` | `bus_alarm_system`, `bus_alarm_zone` | BUS Alarm system and zones | Successfully tested: Burglar-alarm Unit 3486 |
4949
| Auxiliary (AUX) | `9` | `bus_aux` | AUX commands | Successfully tested: AUX configured for Burglar-alarm Unit 3486. **Only sending AUX commands is supported** |
5050
| Basic, CEN & CEN+ Scenarios | `0`, `15`, `25` | `bus_scenario_control`, `bus_cen_scenario_control`, `bus_cenplus_scenario_control` | Basic and CEN/CEN+ Scenarios events and virtual activation | Successfully tested: CEN/CEN+ scenario control: HC/HD/HS/L/N/NT4680 and basic scenario modules F420/IR3456 + L4680 (WHO=0) |
@@ -159,11 +159,12 @@ Temperature sensors can be configured defining a `bus_thermo_sensor` Thing with
159159
- example sensor `5` of external zone `00` --> `where="500"`
160160
- example: slave sensor `3` of zone `2` --> `where="302"`
161161

162-
The (optional) Central Unit can be configured defining a `bus_themo_cu` Thing with the `where` configuration parameter (`OpenWebNet Address`) set to `where="#0"` for a 99-zone Central Unit or `where="#0#1"` for a 4-zone Central Unit configured as zone 1.
162+
The (optional) Central Unit can be configured defining a `bus_themo_cu` Thing with the `where` configuration parameter (`OpenWebNet Address`) set to `where="#0"` for a 99-zone Central Unit (model 3550) or `where="#0#1"` for a 4-zone Central Unit (models L/N/NT/HD/HC/HS 4695) configured as zone 1.
163163

164-
##### Thermo Central Unit integration missing points
164+
##### Thermo Central Unit integration known limitations
165165

166166
- Read setPoint temperature and current mode
167+
- Central Unit Programming and Customisations settings (T1/2/3 temperature levels, date & time, weekly/scenarios/holiday programming, etc.)
167168
- Holiday/Vacation activation command
168169

169170
#### Configuring Alarm and Auxiliary (AUX)
@@ -244,16 +245,16 @@ OPEN command to execute: *5*8#134##
244245
| `temperature` | `bus_thermo_zone`, `bus_thermo_sensor` | Number:Temperature | The zone currently sensed temperature | R | N |
245246
| `setpointTemperature` | `bus_thermo_zone`, `bus_thermo_cu` | Number:Temperature | The zone or Central Unit setpoint temperature | R/W | N |
246247
| `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 |
247-
| `mode` | `bus_thermo_zone`, `bus_thermo_cu` | String | The zone set mode (`MANUAL`, `PROTECTION`, `OFF`) or the Central Unit set mode ( `MANUAL`, `PROTECTION`, `OFF`, `WEEKLY`, `SCENARIO`) | R/W | N |
248+
| `mode` | `bus_thermo_zone`, `bus_thermo_cu` | String | The zone set mode (`AUTO`, `MANUAL`, `PROTECTION`, `OFF`) or the Central Unit set mode (`WEEKLY`, `SCENARIO`, `MANUAL`, `PROTECTION`, `OFF`) | R/W | N |
248249
| `speedFanCoil` | `bus_thermo_zone` | String | The zone fancoil speed: `AUTO`, `SPEED_1`, `SPEED_2`, `SPEED_3` | R/W | N |
249250
| `actuators` | `bus_thermo_zone` | String | The zone actuator(s) status: `OFF`, `ON`, `OPENED`, `CLOSED` , `STOP`, `OFF_FAN_COIL`, `ON_SPEED_1`, `ON_SPEED_2`, `ON_SPEED_3`, `OFF_SPEED_1`, `OFF_SPEED_2`, `OFF_SPEED_3` | R | Y |
250251
| `heatingValves` | `bus_thermo_zone` | String | The zone heating valve(s) status: `OFF`, `ON`, `OPENED`, `CLOSED` , `STOP`, `OFF_FAN_COIL`, `ON_SPEED_1`, `ON_SPEED_2`, `ON_SPEED_3`, `OFF_SPEED_1`, `OFF_SPEED_2`, `OFF_SPEED_3` | R | Y |
251252
| `conditioningValves` | `bus_thermo_zone` | String | The zone conditioning valve(s) status: `OFF`, `ON`, `OPENED`, `CLOSED` , `STOP`, `OFF_FAN_COIL`, `ON_SPEED_1`, `ON_SPEED_2`, `ON_SPEED_3`, `OFF_SPEED_1`, `OFF_SPEED_2`, `OFF_SPEED_3` | R | Y |
252253
| `localOffset` | `bus_thermo_zone` | String | The zone local offset status: `OFF`, `PROTECTION`, `MINUS_3`, `MINUS_2` , `MINUS_1`, `NORMAL`, `PLUS_1`, `PLUS_2`, `PLUS_3` | R | Y |
253254
| `remoteControl` | `bus_thermo_cu` | String | The Central Unit Remote Control status: `ENABLED`, `DISABLED` | R | Y |
254255
| `batteryStatus` | `bus_thermo_cu` | String | The Central Unit Battery status: `OK`, `KO` | R | Y |
255-
| `weeklyProgram` | `bus_thermo_cu` | Number | The program number (`1`, `2`, `3`) when Central Unit mode is `WEEKLY` | R/W | N |
256-
| `scenarioProgram` | `bus_thermo_cu` | Number | The program number (`1`, `2`, ... , `16`) when Central Unit mode is `SCENARIO` | R/W | N |
256+
| `weeklyProgram` | `bus_thermo_cu` | Number | The weekly program number (`1`, `2`, `3`) when Central Unit mode is `WEEKLY` | R/W | N |
257+
| `scenarioProgram` | `bus_thermo_cu` | Number | The scenario program number (`1`, `2`, ... , `16`) when Central Unit mode is `SCENARIO` | R/W | N |
257258
| `failureDiscovered` | `bus_thermo_cu` | Switch | Indicates if a Failure was discovered by the Central Unit: `ON`, `OFF` | R | Y |
258259
| `atLeastOneProbeOff` | `bus_thermo_cu` | Switch | Indicates if at least one probe is in OFF mode: `ON`, `OFF` | R | Y |
259260
| `atLeastOneProbeProtection` | `bus_thermo_cu` | Switch | Indicates if at least one probe is in PROTECTION mode: `ON`, `OFF` | R | Y |
@@ -305,16 +306,16 @@ See [openwebnet.sitemap](#openwebnet-sitemap) & [openwebnet.rules](#openwebnet-r
305306
- `EXTENDED_PRESS` - sent after `START_EXTENDED_PRESS` if you keep the button pressed longer; will be sent again every 0,5sec as long as you hold pressed (good for rules involving dimming/volume)
306307
- `RELEASE_EXTENDED_PRESS` - sent once when you finally release the button after having it pressed longer than 0,5sec
307308

308-
#### `mode` for values WEEKLY and SCENARIO (thermo Central Unit)
309+
#### Thermo Central Unit `mode`: `WEEKLY` and `SCENARIO`
309310

310311
There are three WEEKLY and sixteen SCENARIO programs defined for the thermo Central Unit.
311312

312-
In order to activate one of them you have to use two different channels:
313+
In order to activate one specific weekly or scenario program two different channels must be used:
313314

314-
- with `mode` you can set the mode (`WEEKLY` or `SCENARIO`)
315-
- with `weeklyProgram` (if `WEEKLY` was set) or with `scenarioProgram` (if `SCENARIO` was set) you can set the program number
315+
- with the `mode` channel it's possible to set the mode (`WEEKLY` or `SCENARIO`)
316+
- with `weeklyProgram` (if `WEEKLY` was set) or `scenarioProgram` (if `SCENARIO` was set) channels you can set the specific weekly/scenario program number
316317

317-
Example: if you want to activate SCENARIO number 9 on the thermo Central Unit you have to set `mode` = `SCENARIO` and `scenarioProgram` = `9`.
318+
Example: if you want to activate SCENARIO number 9 on the thermo Central Unit you have to set channel `mode` = `SCENARIO` and channel `scenarioProgram` = `9`.
318319

319320
## Full Example
320321

bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/internal/handler/OpenWebNetThermoregulationHandler.java

+15-3
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ public class OpenWebNetThermoregulationHandler extends OpenWebNetThingHandler {
8787
private static final String CU_REMOTE_CONTROL_DISABLED = "DISABLED";
8888
private static final String CU_BATTERY_OK = "OK";
8989
private static final String CU_BATTERY_KO = "KO";
90+
private static final String MODE_WEEKLY = "WEEKLY";
91+
private static final String MODE_AUTO = "AUTO";
9092

9193
public OpenWebNetThermoregulationHandler(Thing thing) {
9294
super(thing);
@@ -253,15 +255,19 @@ private void handleMode(Command command) {
253255

254256
if (isCentralUnit && WhatThermo.isComplex(command.toString())) {
255257
int programNumber = 0;
256-
if ("WEEKLY".equalsIgnoreCase(command.toString())) {
258+
if (MODE_WEEKLY.equalsIgnoreCase(command.toString())) {
257259
programNumber = currentWeeklyPrgNum;
258260
} else {
259261
programNumber = currentScenarioPrgNum;
260262
}
261263
newMode = Thermoregulation.OperationMode.valueOf(command.toString() + "_" + programNumber);
262264
currentMode = newMode;
263265
} else {
264-
newMode = Thermoregulation.OperationMode.valueOf(command.toString());
266+
if (MODE_AUTO.equalsIgnoreCase(command.toString())) {
267+
newMode = Thermoregulation.OperationMode.PROGRAM;
268+
} else {
269+
newMode = Thermoregulation.OperationMode.valueOf(command.toString());
270+
}
265271
}
266272
send(Thermoregulation.requestWriteMode(getWhere(w.value()), newMode, currentFunction,
267273
currentSetPointTemp));
@@ -418,7 +424,13 @@ private void updateModeAndFunction(Thermoregulation tmsg) {
418424

419425
// must convert from OperationMode to Mode and set ProgramNumber when necessary
420426
if (operationMode != null) {
421-
updateState(CHANNEL_MODE, new StringType(operationMode.mode()));
427+
String newMode;
428+
if (operationMode == Thermoregulation.OperationMode.PROGRAM) { // translate PROGRAM -> AUTO
429+
newMode = MODE_AUTO;
430+
} else {
431+
newMode = operationMode.mode();
432+
}
433+
updateState(CHANNEL_MODE, new StringType(newMode));
422434
Integer programN = 0;
423435
try {
424436
@Nullable

0 commit comments

Comments
 (0)