From 54317d8d525d3ee7eb59e00d645a8eadd9f50c1f Mon Sep 17 00:00:00 2001 From: Conte Andrea Date: Wed, 23 Jun 2021 20:08:51 +0200 Subject: [PATCH] [openwebnet] rename thermoregulation's (WHO=4) things (#10865) * - bus_thermostat renamed to bus_thermo_zone - bus_temp_sensor renamed to bus_themo_sensor - linked OWN4j 0.5.3-SNAPSHOT (camelCase for enums) Signed-off-by: Conte Andrea * updated ReadMe according to things renaming Signed-off-by: Conte Andrea * Updated readme and thermo thing labels. Renamed thing descriptors to BusThermoZone and BusThermoSensor Signed-off-by: Massimo Valla * using own4j release 0.5.3 Signed-off-by: Conte Andrea * removed json tags in README. Added KG4691 to tested thermostats Signed-off-by: Massimo Valla Co-authored-by: Massimo Valla Signed-off-by: Luca Calcaterra --- .../org.openhab.binding.openwebnet/README.md | 107 +++++++++++------- .../org.openhab.binding.openwebnet/pom.xml | 2 +- .../OpenWebNetBindingConstants.java | 18 +-- .../handler/OpenWebNetBridgeHandler.java | 10 +- .../handler/OpenWebNetEnergyHandler.java | 3 +- .../handler/OpenWebNetLightingHandler.java | 14 ++- .../OpenWebNetThermoregulationHandler.java | 24 ++-- .../OpenWebNetDeviceDiscoveryService.java | 12 +- ...{BusTempSensor.xml => BusThermoSensor.xml} | 11 +- .../{BusThermostat.xml => BusThermoZone.xml} | 26 +++-- .../main/resources/OH-INF/thing/channels.xml | 18 +-- 11 files changed, 145 insertions(+), 100 deletions(-) rename bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/{BusTempSensor.xml => BusThermoSensor.xml} (72%) rename bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/{BusThermostat.xml => BusThermoZone.xml} (56%) diff --git a/bundles/org.openhab.binding.openwebnet/README.md b/bundles/org.openhab.binding.openwebnet/README.md index 7b2ab4585a330..9a79c3f8351a9 100644 --- a/bundles/org.openhab.binding.openwebnet/README.md +++ b/bundles/org.openhab.binding.openwebnet/README.md @@ -42,7 +42,7 @@ The following Things and OpenWebNet `WHOs` are supported: | Gateway Management | `13` | `bus_gateway` | Any IP gateway supporting OpenWebNet protocol should work (e.g. F454 / MyHOMEServer1 / MH202 / F455 / MH200N, ...) | Successfully tested: F454, MyHOMEServer1, MyHOME_Screen10, F455, F452, F453AV, MH201, MH202, MH200N. Some connection stability issues/gateway resets reported with MH202 | | 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) | | Automation | `2` | `bus_automation` | BUS roller shutters, with position feedback and auto-calibration | Successfully tested: LN4672M2 | -| Temperature Control | `4` | `bus_thermostat`, `bus_temp_sensor` | Zones room thermostats (stand-alone) and external wireless temperature sensors. Please note that Central Unit configurations (4 or 99 zones) are not yet supported. See [Channels - Thermo](#thermo-channels) for more details. | Successfully tested: H/LN4691; external sensors: L/N/NT4577 + 3455 | +| Temperature Control | `4` | `bus_thermo_zone`, `bus_thermo_sensor` | Thermo zones management and temperature sensors (probes). NOTE Central Units (4 or 99 zones) are not fully supported yet. See [Channels - Thermo](#configuring-thermo) for more details. | Successfully tested: H/LN4691, KG4691; thermo sensors: L/N/NT4577 + 3455 | | Energy Management | `18` | `bus_energy_meter` | Energy Management | Successfully tested: F520, F521 | ### For ZigBee (Radio) @@ -122,9 +122,29 @@ For any manually added device, you must configure: - the `where` config parameter (`OpenWebNet Device Address`): - example for BUS/SCS device with WHERE address Point to Point `A=2 PL=4` --> `where="24"` - example for BUS/SCS device with WHERE address Point to Point `A=03 PL=11` on local bus --> `where="0311#4#01"` - - example for BUS/SCS thermo Zones: `Zone=1` --> `where="1"`; external sensor `5` --> `where="500"` - example for ZigBee devices: `where=765432101#9`. The ID of the device (ADDR part) is usually written in hexadecimal on the device itself, for example `ID 0074CBB1`: convert to decimal (`7654321`) and add `01#9` at the end to obtain `where=765432101#9`. For 2-unit switch devices (`zb_on_off_switch2u`), last part should be `00#9`. +#### Configuring Thermo + +In BTicino MyHOME Thermoregulation (WHO=4) each **zone** has associated a thermostat, additional temperature sensors (optional), actuators and heating/conditioning valves. A zone is associated to at least one thermostat and one actuator. + +Thermo zones can be configured defining a `bus_thermo_zone` Thing for each zone with the following parameters: + +- the `where` config parameter (`OpenWebNet Device Address`): + - example BUS/SCS Thermo `zone=1` --> `where="1"` +- the `standAlone` config parameter (`boolean`, default: `true`): identifies if the zone is managed or not by a Central Unit (4 or 99 zones). `standAlone=true` means no Central Unit is present in the system. + +Temperature sensors can be configured defining a `bus_thermo_sensor` Thing with the following parameters: + +- the `where` config parameter (`OpenWebNet Device Address`): + - example sensor `5` of external zone `00` --> `where="500"` + - example: slave sensor `3` of zone `2` --> `where="302"` + +#### NOTE + +Systems with Central Units (4 or 99 zones) are not fully supported yet. + + ## Channels ### Lighting, Automation and Power meter channels @@ -138,23 +158,20 @@ For any manually added device, you must configure: ### Thermo channels -Currently only stand-alone thermostats are supported (like [LN4691](https://catalogo.bticino.it/BTI-LN4691-IT)) and the specific thing `bus_thermostat` was created to manage them. - | Channel Type ID (channel ID) | Applies to Thing Type IDs | Item Type | Description | Read/Write | Advanced | | ---------------------------- | ----------------------------------- | ------------------ | ------------------------------------------------- | :--------: | :------: | -| `temperature` | `bus_thermostat`, `bus_temp_sensor` | Number:Temperature | The zone currently sensed temperature | R | N | -| `setpointTemperature` | `bus_thermostat` | Number:Temperature | The zone setpoint temperature | R/W | N | -| `function` | `bus_thermostat` | String | The zone set thermo function: `COOLING`, `HEATING` or `GENERIC` (heating + cooling) | R/W | N | -| `mode` | `bus_thermostat` | String | The zone set mode: `MANUAL`, `PROTECTION`, `OFF` | R/W | N | -| `speedFanCoil` | `bus_thermostat` | String | The zone fancoil speed: `AUTO`, `SPEED_1`, `SPEED_2`, `SPEED_3` | R/W | N | -| `actuator` | `bus_thermostat` | 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 | -| `heatingValve` | `bus_thermostat` | 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 | -| `conditioningValve` | `bus_thermostat` | 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 | - +| `temperature` | `bus_thermo_zone`, `bus_thermo_sensor` | Number:Temperature | The zone currently sensed temperature | R | N | +| `setpointTemperature` | `bus_thermo_zone` | Number:Temperature | The zone setpoint temperature | R/W | N | +| `function` | `bus_thermo_zone` | String | The zone set thermo function: `COOLING`, `HEATING` or `GENERIC` (heating + cooling) | R/W | N | +| `mode` | `bus_thermo_zone` | String | The zone set mode: `MANUAL`, `PROTECTION`, `OFF` | R/W | N | +| `speedFanCoil` | `bus_thermo_zone` | String | The zone fancoil speed: `AUTO`, `SPEED_1`, `SPEED_2`, `SPEED_3` | R/W | N | +| `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 | +| `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 | +| `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 | ### Notes on channels -#### `shutter` position +#### `shutter` position For Percent commands and position feedback to work correctly, the `shutterRun` Thing config parameter must be configured equal to the time (in ms) to go from full UP to full DOWN. It's possible to enter a value manually or set `shutterRun=AUTO` (default) to calibrate `shutterRun` automatically: in this case a *UP >> DOWN >> Position%* cycle will be performed automatically the first time a Percent command is sent to the shutter. @@ -171,22 +188,22 @@ It's possible to enter a value manually or set `shutterRun=AUTO` (default) to ca BUS gateway and things configuration: -```xtend +``` Bridge openwebnet:bus_gateway:mybridge "MyHOMEServer1" [ host="192.168.1.35", passwd="abcde", port=20000, discoveryByActivation=false ] { bus_on_off_switch LR_switch "Living Room Light" [ where="51" ] bus_dimmer LR_dimmer "Living Room Dimmer" [ where="0311#4#01" ] bus_automation LR_shutter "Living Room Shutter" [ where="93", shutterRun="10050"] bus_energy_meter CENTRAL_Ta "Energy Meter Ta" [ where="51" ] bus_energy_meter CENTRAL_Tb "Energy Meter Tb" [ where="52" ] - bus_thermostat LR_thermostat "Living Room Thermostat" [ where="2"] - bus_temp_sensor EXT_tempsensor "External Temperature" [ where="500"] + bus_thermo_zone LR_zone "Living Room Zone" [ where="2"] + bus_thermo_sensor EXT_tempsensor "External Temperature" [ where="500"] } ``` ZigBee USB Gateway and things configuration - for radio devices: -```xtend +``` Bridge openwebnet:zb_gateway:myZBgateway [ serialPort="COM3" ] { zb_dimmer myZB_dimmer [ where="765432101#9"] zb_on_off_switch myZB_switch [ where="765432201#9"] @@ -198,25 +215,36 @@ Bridge openwebnet:zb_gateway:myZBgateway [ serialPort="COM3" ] { Example items linked to BUS devices: -```xtend -Switch iLR_switch "Light" (gLivingRoom) [ "Lighting" ] { channel="openwebnet:bus_on_off_switch:mybridge:LR_switch:switch" } -Dimmer iLR_dimmer "Dimmer [%.0f %%]" (gLivingRoom) [ "Lighting" ] { channel="openwebnet:bus_dimmer:mybridge:LR_dimmer:brightness" } -Rollershutter iLR_shutter "Shutter [%.0f %%]" (gShutters, gLivingRoom) [ "Blinds" ] { channel="openwebnet:bus_automation:mybridge:LR_shutter:shutter" } -Number:Power iCENTRAL_Ta "Power [%.0f %unit%]" { channel="openwebnet:bus_energy_meter:mybridge:CENTRAL_Ta:power" } -Number:Power iCENTRAL_Tb "Power [%.0f %unit%]" { channel="openwebnet:bus_energy_meter:mybridge:CENTRAL_Tb:power" } -Number:Temperature iLR_thermostat_temp "Temperature" (gLivingRoom) { channel="openwebnet:bus_thermostat:mybridge:LR_thermostat:temperature" } -Number:Temperature iLR_thermostat_set "SetPoint Temperature" (gLivingRoom) { channel="openwebnet:bus_thermostat:mybridge:LR_thermostat:setpointTemperature" } -String iLR_thermostat_setFanSpeed "FanSpeed" (gLivingRoom) { channel="openwebnet:bus_thermostat:mybridge:LR_thermostat:speedFanCoil" } -String iLR_thermostat_setMode "Mode" (gLivingRoom) { channel="openwebnet:bus_thermostat:mybridge:LR_thermostat:mode" } -String iLR_thermostat_setFunc "Function" (gLivingRoom) { channel="openwebnet:bus_thermostat:mybridge:LR_thermostat:function" } -Number:Temperature iEXT_temp "Temperature [%.1f °C]" (gExternal) { channel="openwebnet:bus_temp_sensor:mybridge:EXT_tempsensor:temperature" } +NOTE: lights, blinds and zones (thermostat) can be handled from personal assistants (Google Home, Alexa). In the following example `Google Assistant` was configured (`ga="..."`) according to the [official documentation](https://www.openhab.org/docs/ecosystem/google-assistant). + +``` +Switch iLR_switch "Light" (gLivingRoom) { channel="openwebnet:bus_on_off_switch:mybridge:LR_switch:switch", ga="Light" } +Dimmer iLR_dimmer "Dimmer [%.0f %%]" (gLivingRoom) { channel="openwebnet:bus_dimmer:mybridge:LR_dimmer:brightness", ga="Light" } + +Rollershutter iLR_shutter "Shutter [%.0f %%]" (gShutters, gLivingRoom) { channel="openwebnet:bus_automation:mybridge:LR_shutter:shutter", ga="Blinds" } + +Number:Power iCENTRAL_Ta "Power [%.0f %unit%]" { channel="openwebnet:bus_energy_meter:mybridge:CENTRAL_Ta:power" } +Number:Power iCENTRAL_Tb "Power [%.0f %unit%]" { channel="openwebnet:bus_energy_meter:mybridge:CENTRAL_Tb:power" } + + +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" } +Number:Temperature iLR_zone_setTemp "SetPoint Temperature" (gLivingRoomZone) { channel="openwebnet:bus_thermo_zone:mybridge:LR_zone:setpointTemperature", ga="thermostatTemperatureSetpoint" } +String iLR_zone_fanSpeed "FanSpeed" (gLivingRoomZone) { channel="openwebnet:bus_thermo_zone:mybridge:LR_zone:speedFanCoil" } +String iLR_zone_mode "Mode" (gLivingRoomZone) { channel="openwebnet:bus_thermo_zone:mybridge:LR_zone:mode" } +String iLR_zone_func "Function" (gLivingRoomZone) { channel="openwebnet:bus_thermo_zone:mybridge:LR_zone:function", ga="thermostatMode" } +String iLR_zone_actuators "Actuators" (gLivingRoomZone) { channel="openwebnet:bus_thermo_zone:mybridge:LR_zone:actuators" } +String iLR_zone_hv "Heating valves" (gLivingRoomZone) { channel="openwebnet:bus_thermo_zone:mybridge:LR_zone:heatingValves" } +String iLR_zone_cv "Conditioning valves" (gLivingRoomZone) { channel="openwebnet:bus_thermo_zone:mybridge:LR_zone:conditioningValves" } + +Number:Temperature iEXT_temp "Temperature [%.1f %unit%]" (gExternal) { channel="openwebnet:bus_thermo_sensor:mybridge:EXT_tempsensor:temperature" } ``` Example items linked to OpenWebNet ZigBee devices: -```xtend +``` Dimmer iDimmer "Dimmer [%.0f %%]" (gKitchen) [ "Lighting" ] { channel="openwebnet:zb_dimmer:myZBgateway:myZB_dimmer:brightness" } Switch iSimpleSwitch "Kitchen Switch" (gKitchen) [ "Lighting" ] { channel="openwebnet:zb_on_off_switch:myZBgateway:myZB_switch:switch_01" } Switch iSwitch_01 "2U first light" (gKitchen) [ "Lighting" ] { channel="openwebnet:zb_on_off_switch2u:myZBgateway:myZB_2U_switch:switch_01" } @@ -225,7 +253,7 @@ Switch iSwitch_02 "2U second light" ### openwebnet.sitemap -```xtend +``` sitemap openwebnet label="OpenWebNet Binding Example Sitemap" { Frame label="Living Room" @@ -241,13 +269,16 @@ sitemap openwebnet label="OpenWebNet Binding Example Sitemap" Default item=iCENTRAL_Tb label="Ground Floor" icon="energy" valuecolor=[>3000="red"] } - Frame label="Thermoregulation" + Frame label="Living Room Thermo" { - Default item=iLR_thermostat_temp label="Temperature" icon="fire" valuecolor=[<20="red"] - Setpoint item=iLR_thermostat_set label="Setpoint [%.1f °C]" step=0.5 minValue=15 maxValue=30 - Selection item=iLR_thermostat_setFanSpeed label="Fan Speed" icon="fan" mappings=[AUTO="AUTO", SPEED_1="Low", SPEED_2="Medium", SPEED_3="High"] - Switch item=iLR_thermostat_setMode label="Mode" icon="settings" - Selection item=iLR_thermostat_setFunc label="Function" icon="heating" mappings=[HEATING="Heating", COOLING="Cooling", GENERIC="Heating/Cooling"] + Default item=iLR_zone_temp label="Temperature" icon="fire" valuecolor=[<20="red"] + Setpoint item=iLR_zone_set label="Setpoint [%.1f °C]" step=0.5 minValue=15 maxValue=30 + Selection item=iLR_zone_fanSpeed label="Fan Speed" icon="fan" mappings=[AUTO="AUTO", SPEED_1="Low", SPEED_2="Medium", SPEED_3="High"] + Switch item=iLR_zone_mode label="Mode" icon="settings" + Selection item=iLR_zone_func label="Function" icon="heating" mappings=[HEATING="Heating", COOLING="Cooling", GENERIC="Heating/Cooling"] + Default item=iLR_zone_actuators label="Actuators status" + Default item=iLR_zone_hv label="Heating valves status" + Default item=iLR_zone_cv label="Conditioning valves status" } } ``` diff --git a/bundles/org.openhab.binding.openwebnet/pom.xml b/bundles/org.openhab.binding.openwebnet/pom.xml index caefdc9197160..01695dd919fd5 100644 --- a/bundles/org.openhab.binding.openwebnet/pom.xml +++ b/bundles/org.openhab.binding.openwebnet/pom.xml @@ -23,7 +23,7 @@ io.github.openwebnet4j openwebnet4j - 0.5.2 + 0.5.3 compile diff --git a/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/OpenWebNetBindingConstants.java b/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/OpenWebNetBindingConstants.java index 42c369ec0e978..b7fbf1492a656 100644 --- a/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/OpenWebNetBindingConstants.java +++ b/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/OpenWebNetBindingConstants.java @@ -55,10 +55,10 @@ public class OpenWebNetBindingConstants { public static final String THING_LABEL_BUS_AUTOMATION = "Automation"; public static final ThingTypeUID THING_TYPE_BUS_ENERGY_METER = new ThingTypeUID(BINDING_ID, "bus_energy_meter"); public static final String THING_LABEL_BUS_ENERGY_METER = "Energy Meter"; - public static final ThingTypeUID THING_TYPE_BUS_TEMP_SENSOR = new ThingTypeUID(BINDING_ID, "bus_temp_sensor"); - public static final String THING_LABEL_BUS_TEMP_SENSOR = "Temperature Sensor"; - public static final ThingTypeUID THING_TYPE_BUS_THERMOSTAT = new ThingTypeUID(BINDING_ID, "bus_thermostat"); - public static final String THING_LABEL_BUS_THERMOSTAT = "Thermostat (stand-alone)"; + public static final ThingTypeUID THING_TYPE_BUS_THERMO_SENSOR = new ThingTypeUID(BINDING_ID, "bus_thermo_sensor"); + public static final String THING_LABEL_BUS_THERMO_SENSOR = "Thermo Sensor"; + public static final ThingTypeUID THING_TYPE_BUS_THERMO_ZONE = new ThingTypeUID(BINDING_ID, "bus_thermo_zone"); + public static final String THING_LABEL_BUS_THERMO_ZONE = "Thermo Zone"; // ZIGBEE public static final ThingTypeUID THING_TYPE_ZB_ON_OFF_SWITCH = new ThingTypeUID(BINDING_ID, "zb_on_off_switch"); @@ -83,8 +83,8 @@ public class OpenWebNetBindingConstants { THING_TYPE_BUS_AUTOMATION); // ## Thermoregulation - public static final Set THERMOREGULATION_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_THERMOSTAT, - THING_TYPE_BUS_TEMP_SENSOR); + public static final Set THERMOREGULATION_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_THERMO_ZONE, + THING_TYPE_BUS_THERMO_SENSOR); // ## Energy Management public static final Set ENERGY_MANAGEMENT_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_ENERGY_METER); @@ -119,9 +119,9 @@ public class OpenWebNetBindingConstants { public static final String CHANNEL_TEMP_SETPOINT = "setpointTemperature"; public static final String CHANNEL_MODE = "mode"; public static final String CHANNEL_FAN_SPEED = "speedFanCoil"; - public static final String CHANNEL_CONDITIONING_VALVE = "conditioningValve"; - public static final String CHANNEL_HEATING_VALVE = "heatingValve"; - public static final String CHANNEL_ACTUATOR = "actuator"; + public static final String CHANNEL_CONDITIONING_VALVES = "conditioningValves"; + public static final String CHANNEL_HEATING_VALVES = "heatingValves"; + public static final String CHANNEL_ACTUATORS = "actuators"; // energy management public static final String CHANNEL_POWER = "power"; diff --git a/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetBridgeHandler.java b/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetBridgeHandler.java index b73d3e98c7fb6..713b83268281f 100644 --- a/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetBridgeHandler.java +++ b/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetBridgeHandler.java @@ -12,7 +12,9 @@ */ package org.openhab.binding.openwebnet.handler; -import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.*; +import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.PROPERTY_FIRMWARE_VERSION; +import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.PROPERTY_SERIAL_NO; +import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.THING_TYPE_ZB_GATEWAY; import java.util.Collection; import java.util.Collections; @@ -312,12 +314,12 @@ private void discoverByActivation(BaseOpenMessage baseMsg) { BaseOpenMessage bmsg = baseMsg; if (baseMsg instanceof Lighting) { What what = baseMsg.getWhat(); - if (Lighting.WHAT.OFF.equals(what)) { // skipping OFF msg: cannot distinguish dimmer/switch + if (Lighting.WhatLighting.OFF.equals(what)) { // skipping OFF msg: cannot distinguish dimmer/switch logger.debug("discoverByActivation: skipping OFF msg: cannot distinguish dimmer/switch"); return; } - if (Lighting.WHAT.ON.equals(what)) { // if not already done just now, request light status to - // distinguish dimmer from switch + if (Lighting.WhatLighting.ON.equals(what)) { // if not already done just now, request light status to + // distinguish dimmer from switch if (discoveringDevices.containsKey(ownIdFromMessage(baseMsg))) { logger.debug( "discoverByActivation: we just requested status for this device and it's ON -> it's a switch"); diff --git a/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetEnergyHandler.java b/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetEnergyHandler.java index f9771bf19f847..ff7060cad6314 100644 --- a/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetEnergyHandler.java +++ b/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetEnergyHandler.java @@ -36,7 +36,6 @@ import org.openwebnet4j.communication.OWNException; import org.openwebnet4j.message.BaseOpenMessage; import org.openwebnet4j.message.EnergyManagement; -import org.openwebnet4j.message.EnergyManagement.DIM; import org.openwebnet4j.message.FrameException; import org.openwebnet4j.message.Where; import org.openwebnet4j.message.WhereEnergyManagement; @@ -182,7 +181,7 @@ protected void handleMessage(BaseOpenMessage msg) { return; } else { // fix: check for correct DIM (ActivePower / 113) - if (msg.getDim().equals(DIM.ACTIVE_POWER)) { + if (msg.getDim().equals(EnergyManagement.DimEnergyMgmt.ACTIVE_POWER)) { updateActivePower(msg); } else { logger.debug("handleMessage() Ignoring message {} because it's not related to active power value.", diff --git a/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetLightingHandler.java b/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetLightingHandler.java index b45695e654ed3..2daf0c4ff650e 100644 --- a/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetLightingHandler.java +++ b/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetLightingHandler.java @@ -12,7 +12,13 @@ */ package org.openhab.binding.openwebnet.handler; -import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.*; +import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.CHANNEL_BRIGHTNESS; +import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.CHANNEL_SWITCH; +import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.CHANNEL_SWITCH_01; +import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.CHANNEL_SWITCH_02; +import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.THING_TYPE_BUS_DIMMER; +import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.THING_TYPE_ZB_DIMMER; +import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.THING_TYPE_ZB_ON_OFF_SWITCH_2UNITS; import java.util.Set; import java.util.concurrent.TimeUnit; @@ -304,7 +310,7 @@ private synchronized void updateBrightness(Lighting msg) { if (msg.getWhat() != null) { updateBrightnessState(msg); } else { // dimension notification - if (msg.getDim() == Lighting.DIM.DIMMER_LEVEL_100) { + if (msg.getDim() == Lighting.DimLighting.DIMMER_LEVEL_100) { int newBrightness; try { newBrightness = msg.parseDimmerLevel100(); @@ -336,8 +342,8 @@ private synchronized void updateBrightness(Lighting msg) { private void updateBrightnessState(Lighting msg) { What w = msg.getWhat(); if (w != null) { - if (Lighting.WHAT.ON.equals(w)) { - w = Lighting.WHAT.DIMMER_LEVEL_2; // levels start at 2 + if (Lighting.WhatLighting.ON.equals(w)) { + w = Lighting.WhatLighting.DIMMER_LEVEL_2; // levels start at 2 } int newBrightnessWhat = w.value(); int brightnessWhat = UNKNOWN_STATE; diff --git a/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetThermoregulationHandler.java b/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetThermoregulationHandler.java index 7d8ae06de193a..b540a4bd2efe8 100644 --- a/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetThermoregulationHandler.java +++ b/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetThermoregulationHandler.java @@ -41,8 +41,8 @@ import org.slf4j.LoggerFactory; /** - * The {@link OpenWebNetThermoregulationHandler} is responsible for handling commands/messages for a Thermoregulation - * OpenWebNet device. It extends the abstract {@link OpenWebNetThingHandler}. + * The {@link OpenWebNetThermoregulationHandler} is responsible for handling commands/messages for Thermoregulation + * Things. It extends the abstract {@link OpenWebNetThingHandler}. * * @author Massimo Valla - Initial contribution * @author Andrea Conte - Thermoregulation @@ -55,7 +55,7 @@ public class OpenWebNetThermoregulationHandler extends OpenWebNetThingHandler { public static final Set SUPPORTED_THING_TYPES = OpenWebNetBindingConstants.THERMOREGULATION_SUPPORTED_THING_TYPES; - private boolean isTempSensor = false; // is the device a sensor or thermostat? + private boolean isTempSensor = false; // is the thing a sensor ? private double currentSetPointTemp = 11.5d; // 11.5 is the default setTemp used in MyHomeUP mobile app @@ -293,25 +293,25 @@ private void updateValveStatus(Thermoregulation tmsg) { try { Thermoregulation.ValveOrActuatorStatus cv = Thermoregulation.parseValveStatus(tmsg, Thermoregulation.WhatThermo.CONDITIONING); - updateState(CHANNEL_CONDITIONING_VALVE, new StringType(cv.toString())); + updateState(CHANNEL_CONDITIONING_VALVES, new StringType(cv.toString())); Thermoregulation.ValveOrActuatorStatus hv = Thermoregulation.parseValveStatus(tmsg, Thermoregulation.WhatThermo.HEATING); - updateState(CHANNEL_HEATING_VALVE, new StringType(hv.toString())); + updateState(CHANNEL_HEATING_VALVES, new StringType(hv.toString())); } catch (FrameException e) { logger.warn("updateValveStatus() FrameException on frame {}: {}", tmsg, e.getMessage()); - updateState(CHANNEL_CONDITIONING_VALVE, UnDefType.UNDEF); - updateState(CHANNEL_HEATING_VALVE, UnDefType.UNDEF); + updateState(CHANNEL_CONDITIONING_VALVES, UnDefType.UNDEF); + updateState(CHANNEL_HEATING_VALVES, UnDefType.UNDEF); } } private void updateActuatorStatus(Thermoregulation tmsg) { try { Thermoregulation.ValveOrActuatorStatus hv = Thermoregulation.parseActuatorStatus(tmsg); - updateState(CHANNEL_ACTUATOR, new StringType(hv.toString())); + updateState(CHANNEL_ACTUATORS, new StringType(hv.toString())); } catch (FrameException e) { logger.warn("updateActuatorStatus() FrameException on frame {}: {}", tmsg, e.getMessage()); - updateState(CHANNEL_ACTUATOR, UnDefType.UNDEF); + updateState(CHANNEL_ACTUATORS, UnDefType.UNDEF); } } @@ -322,12 +322,12 @@ protected void refreshDevice(boolean refreshAll) { try { send(Thermoregulation.requestTemperature(w)); if (!this.isTempSensor) { - // for bus_thermostat request also other single channels updates + // for bus_thermo_zone request also other single channels updates send(Thermoregulation.requestSetPointTemperature(w)); send(Thermoregulation.requestFanCoilSpeed(w)); send(Thermoregulation.requestMode(w)); - send(Thermoregulation.requestValveStatus(w)); - send(Thermoregulation.requestActuatorStatus(w)); + send(Thermoregulation.requestValvesStatus(w)); + send(Thermoregulation.requestActuatorsStatus(w)); } } catch (OWNException e) { logger.warn("refreshDevice() where='{}' returned OWNException {}", w, e.getMessage()); diff --git a/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/internal/discovery/OpenWebNetDeviceDiscoveryService.java b/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/internal/discovery/OpenWebNetDeviceDiscoveryService.java index df53544edbbe3..e6c58cf0a204f 100644 --- a/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/internal/discovery/OpenWebNetDeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/internal/discovery/OpenWebNetDeviceDiscoveryService.java @@ -131,15 +131,15 @@ public void newDiscoveryResult(Where where, OpenDeviceType deviceType, @Nullable deviceWho = Who.AUTOMATION; break; } - case SCS_TEMP_SENSOR: { - thingTypeUID = OpenWebNetBindingConstants.THING_TYPE_BUS_TEMP_SENSOR; - thingLabel = OpenWebNetBindingConstants.THING_LABEL_BUS_TEMP_SENSOR; + case SCS_THERMO_SENSOR: { + thingTypeUID = OpenWebNetBindingConstants.THING_TYPE_BUS_THERMO_SENSOR; + thingLabel = OpenWebNetBindingConstants.THING_LABEL_BUS_THERMO_SENSOR; deviceWho = Who.THERMOREGULATION; break; } - case SCS_THERMOSTAT: { - thingTypeUID = OpenWebNetBindingConstants.THING_TYPE_BUS_THERMOSTAT; - thingLabel = OpenWebNetBindingConstants.THING_LABEL_BUS_THERMOSTAT; + case SCS_THERMO_ZONE: { + thingTypeUID = OpenWebNetBindingConstants.THING_TYPE_BUS_THERMO_ZONE; + thingLabel = OpenWebNetBindingConstants.THING_LABEL_BUS_THERMO_ZONE; deviceWho = Who.THERMOREGULATION; break; } diff --git a/bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusTempSensor.xml b/bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusThermoSensor.xml similarity index 72% rename from bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusTempSensor.xml rename to bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusThermoSensor.xml index 2770dc059bf1d..aec78eb816342 100644 --- a/bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusTempSensor.xml +++ b/bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusThermoSensor.xml @@ -4,13 +4,14 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - - + + - - A OpenWebNet BUS/SCS temperature sensor. BTicino models: L/N/NT4577 etc. + + A OpenWebNet BUS/SCS thermo sensor (probe) for measuring temperature in a zone. BTicino models: + L/N/NT4577 etc. @@ -27,7 +28,7 @@ - Example: Zone 2 --> where=2. For external sensors: sensor 5 --> where=500 + Example: sensor 3 of zone 2 --> where=302. Sensor 5 of external zone 00 --> where=500 diff --git a/bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusThermostat.xml b/bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusThermoZone.xml similarity index 56% rename from bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusThermostat.xml rename to bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusThermoZone.xml index 0b9051985a713..0bb8c8b01fc48 100644 --- a/bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusThermostat.xml +++ b/bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusThermoZone.xml @@ -4,21 +4,21 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - - + + - - A OpenWebNet BUS/SCS zone stand-alone thermostat. BTicino models: LN4691. + + A OpenWebNet BUS/SCS configured thermo zone (managed via Central Unit or stand alone). - - - + + + @@ -28,8 +28,8 @@ BTicino/Legrand - BTI-LN4691 - 410/420/430 + Zone thermostat BTI-LN4691 (stand-alone), 3550 (99 zones Central Unit) + 410/420 ownId @@ -37,7 +37,13 @@ - Example: Zone 2 --> where=2. + Example: zone 2 --> where=2. + + + + + Distinguishes between a zone managed by a Central Unit (false) or stand-alone (true, default) + true diff --git a/bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/channels.xml b/bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/channels.xml index fa04e3d36c036..2c078144888c6 100644 --- a/bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/channels.xml @@ -100,10 +100,10 @@ - + String - - Conditioning Valve status (read only) + + Conditioning Valves status (read only) @@ -122,10 +122,10 @@ - + String - - Heating Valve status (read only) + + Heating Valves status (read only) @@ -144,10 +144,10 @@ - + String - - Actuator status (read only) + + Actuators status (read only)