]> git.basschouten.com Git - openhab-addons.git/commitdiff
[openwebnet] rename thermoregulation's (WHO=4) things (#10865)
authorConte Andrea <andrea@conte.com>
Wed, 23 Jun 2021 18:08:51 +0000 (20:08 +0200)
committerGitHub <noreply@github.com>
Wed, 23 Jun 2021 18:08:51 +0000 (20:08 +0200)
* - 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 <andrea@conte.com>
* updated ReadMe according to things renaming

Signed-off-by: Conte Andrea <andrea@conte.com>
* Updated readme and thermo thing labels. Renamed thing descriptors to BusThermoZone and BusThermoSensor

Signed-off-by: Massimo Valla <mvcode00@gmail.com>
* using own4j release 0.5.3

Signed-off-by: Conte Andrea <andrea@conte.com>
* removed json tags in README. Added KG4691 to tested thermostats

Signed-off-by: Massimo Valla <mvcode00@gmail.com>
Co-authored-by: Massimo Valla <mvcode00@gmail.com>
13 files changed:
bundles/org.openhab.binding.openwebnet/README.md
bundles/org.openhab.binding.openwebnet/pom.xml
bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/OpenWebNetBindingConstants.java
bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetBridgeHandler.java
bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetEnergyHandler.java
bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetLightingHandler.java
bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/handler/OpenWebNetThermoregulationHandler.java
bundles/org.openhab.binding.openwebnet/src/main/java/org/openhab/binding/openwebnet/internal/discovery/OpenWebNetDeviceDiscoveryService.java
bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusTempSensor.xml [deleted file]
bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusThermoSensor.xml [new file with mode: 0644]
bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusThermoZone.xml [new file with mode: 0644]
bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusThermostat.xml [deleted file]
bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/channels.xml

index 7b2ab4585a33008a337159546309387262674d5b..9a79c3f8351a9afc6f32d42f196c92ac43b51c00 100644 (file)
@@ -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"                  <light>          (gLivingRoom)                [ "Lighting" ]  { channel="openwebnet:bus_on_off_switch:mybridge:LR_switch:switch" }
-Dimmer              iLR_dimmer                  "Dimmer [%.0f %%]"       <DimmableLight>  (gLivingRoom)                [ "Lighting" ]  { channel="openwebnet:bus_dimmer:mybridge:LR_dimmer:brightness" }
-Rollershutter       iLR_shutter                 "Shutter [%.0f %%]"      <rollershutter>  (gShutters, gLivingRoom)     [ "Blinds"   ]  { channel="openwebnet:bus_automation:mybridge:LR_shutter:shutter" }
-Number:Power        iCENTRAL_Ta                 "Power [%.0f %unit%]"    <energy>                                                      { channel="openwebnet:bus_energy_meter:mybridge:CENTRAL_Ta:power" }
-Number:Power        iCENTRAL_Tb                 "Power [%.0f %unit%]"    <energy>                                                      { 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]"  <temperature>    (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 %%]"                  <DimmableLight>  (gKitchen)                   [ "Lighting" ]  { channel="openwebnet:zb_dimmer:myZBgateway:myZB_dimmer:brightness" }
 Switch          iSimpleSwitch       "Kitchen Switch"                    <light>          (gKitchen)                   [ "Lighting" ]  { channel="openwebnet:zb_on_off_switch:myZBgateway:myZB_switch:switch_01" }
 Switch          iSwitch_01          "2U first light"                    <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"                   <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"
     }
 }
 ```
index caefdc9197160874dbd7f1d2a805fb95dcfda134..01695dd919fd5786db032344bec901beb36bdf7f 100644 (file)
@@ -23,7 +23,7 @@
     <dependency>
       <groupId>io.github.openwebnet4j</groupId>
       <artifactId>openwebnet4j</artifactId>
-      <version>0.5.2</version>
+      <version>0.5.3</version>
       <scope>compile</scope>
     </dependency>
 
index 42c369ec0e9782c604265c9c5c7906d9b71a4416..b7fbf1492a656d7d575d67b95f6f9792f5069d7d 100644 (file)
@@ -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<ThingTypeUID> THERMOREGULATION_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_THERMOSTAT,
-            THING_TYPE_BUS_TEMP_SENSOR);
+    public static final Set<ThingTypeUID> THERMOREGULATION_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_THERMO_ZONE,
+            THING_TYPE_BUS_THERMO_SENSOR);
 
     // ## Energy Management
     public static final Set<ThingTypeUID> 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";
index b73d3e98c7fb67c175c1934780a28ec037254e76..713b83268281fa41cfabbc7568962c1ffc3a0e6f 100644 (file)
@@ -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 @@ public class OpenWebNetBridgeHandler extends ConfigStatusBridgeHandler implement
             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");
index f9771bf19f8473615c5826a51d2a5db03c8c662f..ff7060cad63143c183b1c098c6920660d3badc52 100644 (file)
@@ -36,7 +36,6 @@ import org.openwebnet4j.OpenGateway;
 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 @@ public class OpenWebNetEnergyHandler extends OpenWebNetThingHandler {
             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.",
index b45695e654ed32556abbf271b5aa19a901dab872..2daf0c4ff650e0664e2d183fe19f360743cb192c 100644 (file)
  */
 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 @@ public class OpenWebNetLightingHandler extends OpenWebNetThingHandler {
             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 @@ public class OpenWebNetLightingHandler extends OpenWebNetThingHandler {
     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;
index 7d8ae06de193ad080c63e0411a2787398c2163e1..b540a4bd2efe839a3caa6c3820cae60b8d4d458d 100644 (file)
@@ -41,8 +41,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * The {@link OpenWebNetThermoregulationHandler} is responsible for handling commands/messages for 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<ThingTypeUID> 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 @@ public class OpenWebNetThermoregulationHandler extends OpenWebNetThingHandler {
         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 @@ public class OpenWebNetThermoregulationHandler extends OpenWebNetThingHandler {
             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());
index df53544edbbe3911b08ff78bda6908b1dad93afc..e6c58cf0a204f092263b3889919c178b00595807 100644 (file)
@@ -131,15 +131,15 @@ public class OpenWebNetDeviceDiscoveryService extends AbstractDiscoveryService
                 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/BusTempSensor.xml
deleted file mode 100644 (file)
index 2770dc0..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<thing:thing-descriptions bindingId="openwebnet"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       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">
-
-       <!-- Thing for BUS Temperature Sensor -->
-       <thing-type id="bus_temp_sensor">
-               <supported-bridge-type-refs>
-                       <bridge-type-ref id="bus_gateway"/>
-               </supported-bridge-type-refs>
-               <label>Temperature Sensor</label>
-               <description>A OpenWebNet BUS/SCS temperature sensor. BTicino models: L/N/NT4577 etc.</description>
-
-               <channels>
-                       <channel id="temperature" typeId="temperature"/>
-               </channels>
-
-               <properties>
-                       <property name="vendor">BTicino/Legrand</property>
-                       <property name="model">BTI-L/N/NT4577 etc.</property>
-                       <property name="ownDeviceType">---</property>
-               </properties>
-
-               <representation-property>ownId</representation-property>
-
-               <config-description>
-                       <parameter name="where" type="text" required="true">
-                               <label>OpenWebNet Device Address</label>
-                               <description>Example: Zone 2 --> where=2. For external sensors: sensor 5 --> where=500</description>
-                       </parameter>
-               </config-description>
-
-       </thing-type>
-</thing:thing-descriptions>
diff --git a/bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusThermoSensor.xml b/bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusThermoSensor.xml
new file mode 100644 (file)
index 0000000..aec78eb
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<thing:thing-descriptions bindingId="openwebnet"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       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">
+
+       <!-- Thing for BUS Thermo Sensor -->
+       <thing-type id="bus_thermo_sensor">
+               <supported-bridge-type-refs>
+                       <bridge-type-ref id="bus_gateway"/>
+               </supported-bridge-type-refs>
+               <label>Thermo Sensor</label>
+               <description>A OpenWebNet BUS/SCS thermo sensor (probe) for measuring temperature in a zone. BTicino models:
+                       L/N/NT4577 etc.</description>
+
+               <channels>
+                       <channel id="temperature" typeId="temperature"/>
+               </channels>
+
+               <properties>
+                       <property name="vendor">BTicino/Legrand</property>
+                       <property name="model">BTI-L/N/NT4577 etc.</property>
+                       <property name="ownDeviceType">---</property>
+               </properties>
+
+               <representation-property>ownId</representation-property>
+
+               <config-description>
+                       <parameter name="where" type="text" required="true">
+                               <label>OpenWebNet Device Address</label>
+                               <description>Example: sensor 3 of zone 2 --> where=302. Sensor 5 of external zone 00 --> where=500</description>
+                       </parameter>
+               </config-description>
+
+       </thing-type>
+</thing:thing-descriptions>
diff --git a/bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusThermoZone.xml b/bundles/org.openhab.binding.openwebnet/src/main/resources/OH-INF/thing/BusThermoZone.xml
new file mode 100644 (file)
index 0000000..0bb8c8b
--- /dev/null
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<thing:thing-descriptions bindingId="openwebnet"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       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">
+
+       <!-- Thing for BUS Thermo Zone -->
+       <thing-type id="bus_thermo_zone">
+               <supported-bridge-type-refs>
+                       <bridge-type-ref id="bus_gateway"/>
+               </supported-bridge-type-refs>
+
+               <label>Thermo Zone</label>
+               <description>A OpenWebNet BUS/SCS configured thermo zone (managed via Central Unit or stand alone).</description>
+
+               <channels>
+                       <!-- read only -->
+                       <channel id="temperature" typeId="temperature"/>
+                       <channel id="conditioningValves" typeId="conditioningValves"/>
+                       <channel id="heatingValves" typeId="heatingValves"/>
+                       <channel id="actuators" typeId="actuators"/>
+                       <!-- read/write -->
+                       <channel id="setpointTemperature" typeId="setpointTemperature"/>
+                       <channel id="function" typeId="function"/>
+                       <channel id="mode" typeId="mode"/>
+                       <channel id="speedFanCoil" typeId="speedFanCoil"/>
+               </channels>
+
+               <properties>
+                       <property name="vendor">BTicino/Legrand</property>
+                       <property name="model">Zone thermostat BTI-LN4691 (stand-alone), 3550 (99 zones Central Unit)</property>
+                       <property name="ownDeviceType">410/420</property>
+               </properties>
+
+               <representation-property>ownId</representation-property>
+
+               <config-description>
+                       <parameter name="where" type="text" required="true">
+                               <label>OpenWebNet Device Address</label>
+                               <description>Example: zone 2 --> where=2.</description>
+                       </parameter>
+
+                       <parameter name="standAlone" type="boolean">
+                               <label>Stand-alone</label>
+                               <description>Distinguishes between a zone managed by a Central Unit (false) or stand-alone (true, default)</description>
+                               <default>true</default>
+                       </parameter>
+               </config-description>
+
+       </thing-type>
+</thing:thing-descriptions>
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/BusThermostat.xml
deleted file mode 100644 (file)
index 0b90519..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<thing:thing-descriptions bindingId="openwebnet"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       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">
-
-       <!-- Thing for BUS Thermostat (BTicino xxx/xxx/...) -->
-       <thing-type id="bus_thermostat">
-               <supported-bridge-type-refs>
-                       <bridge-type-ref id="bus_gateway"/>
-               </supported-bridge-type-refs>
-
-               <label>Thermostat (stand-alone)</label>
-               <description>A OpenWebNet BUS/SCS zone stand-alone thermostat. BTicino models: LN4691.</description>
-
-               <channels>
-                       <!-- read only -->
-                       <channel id="temperature" typeId="temperature"/>
-                       <channel id="conditioningValve" typeId="conditioningValve"/>
-                       <channel id="heatingValve" typeId="heatingValve"/>
-                       <channel id="actuator" typeId="actuator"/>
-                       <!-- read/write -->
-                       <channel id="setpointTemperature" typeId="setpointTemperature"/>
-                       <channel id="function" typeId="function"/>
-                       <channel id="mode" typeId="mode"/>
-                       <channel id="speedFanCoil" typeId="speedFanCoil"/>
-               </channels>
-
-               <properties>
-                       <property name="vendor">BTicino/Legrand</property>
-                       <property name="model">BTI-LN4691</property>
-                       <property name="ownDeviceType">410/420/430</property>
-               </properties>
-
-               <representation-property>ownId</representation-property>
-
-               <config-description>
-                       <parameter name="where" type="text" required="true">
-                               <label>OpenWebNet Device Address</label>
-                               <description>Example: Zone 2 --> where=2.</description>
-                       </parameter>
-               </config-description>
-
-       </thing-type>
-</thing:thing-descriptions>
index fa04e3d36c036babb924afdad8c0d3fbc1ac7283..2c078144888c675f9051ddf4f7bf3f46b30d991b 100644 (file)
                </state>
        </channel-type>
 
-       <channel-type id="conditioningValve" advanced="true">
+       <channel-type id="conditioningValves" advanced="true">
                <item-type>String</item-type>
-               <label>Conditioning Valve</label>
-               <description>Conditioning Valve status (read only)</description>
+               <label>Conditioning Valves</label>
+               <description>Conditioning Valves status (read only)</description>
                <state readOnly="true">
                        <options>
                                <option value="OFF">OFF</option>
                </state>
        </channel-type>
 
-       <channel-type id="heatingValve" advanced="true">
+       <channel-type id="heatingValves" advanced="true">
                <item-type>String</item-type>
-               <label>Heating Valve</label>
-               <description>Heating Valve status (read only)</description>
+               <label>Heating Valves</label>
+               <description>Heating Valves status (read only)</description>
                <state readOnly="true">
                        <options>
                                <option value="OFF">OFF</option>
                </state>
        </channel-type>
 
-       <channel-type id="actuator" advanced="true">
+       <channel-type id="actuators" advanced="true">
                <item-type>String</item-type>
-               <label>Actuator Status</label>
-               <description>Actuator status (read only)</description>
+               <label>Actuators Status</label>
+               <description>Actuators status (read only)</description>
                <state readOnly="true">
                        <options>
                                <option value="OFF">OFF</option>