[openwebnet] added support for CEN/CEN+ scenarios (WHO=15/25) (#11398)

* [openwebnet] first support for CEN

Signed-off-by: Massimo Valla <mvcode00@gmail.com>

* [openwebnet] added CEN actions. OpenWebNetThingHandler.send() is now public

Signed-off-by: Massimo Valla <mvcode00@gmail.com>

* [openwebnet] added CEN+ support

Signed-off-by: Massimo Valla <mvcode00@gmail.com>

* [openwebnet] use WhereCEN, removed nullpointer warnings from EnergyHandler. Improved README

Signed-off-by: Massimo Valla <mvcode00@gmail.com>

* [openwebnet] completed support for CEN/CEN+

Signed-off-by: Massimo Valla <mvcode00@gmail.com>

* [openwebnet] improved log

Signed-off-by: Massimo Valla <mvcode00@gmail.com>

* [openwebnet] corrected "pressure" and renamed some labels

Signed-off-by: Massimo Valla <mvcode00@gmail.com>
This commit is contained in:
M Valla
2021-10-30 18:10:03 +02:00
committed by GitHub
parent 306b3c4853
commit 3bd2939b6c
23 changed files with 699 additions and 55 deletions

View File

@@ -44,6 +44,7 @@ The following Things and OpenWebNet `WHOs` are supported:
| 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_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, HS4692, KG4691; thermo sensors: L/N/NT4577 + 3455 |
| CEN & CEN+ Scenarios | `15` & `25` | `bus_cen_scenario_control`, `bus_cenplus_scenario_control` | CEN/CEN+ scenarios events and virtual activation | Successfully tested: scenario buttons: HC/HD/HS/L/N/NT4680 |
| Energy Management | `18` | `bus_energy_meter` | Energy Management | Successfully tested: F520, F521 |
### For ZigBee (Radio)
@@ -66,6 +67,7 @@ For other gateways you can add them manually, see [Thing Configuration](#thing-c
- Once the gateway is online, a second Inbox Scan will discover BUS devices
- BUS/SCS Dimmers must be ON and dimmed (30%-100%) during a Scan, otherwise they will be discovered as simple On/Off switches
- *KNOWN ISSUE*: In some cases dimmers connected to a F429 Dali-interface are not automatically discovered
- CEN/CEN+ Scenario Control devices will be discovered by activation only. See [discovery by activation](#discovery-by-activation) for details. After confirming a discovered CEN/CEN+ device from Inbox, activate again its scenario buttons to add button channels automatically
#### Discovery by Activation
@@ -117,13 +119,18 @@ Alternatively the ZigBee USB Gateway thing can be configured using the `.things`
### Configuring Devices
Devices can be discovered automatically using an Inbox Scan after a gateway has been configured and connected.
For any manually added device, you must configure:
- the associated gateway (`Parent Bridge` menu)
- 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 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`.
- example for BUS/SCS:
- light device with WHERE address Point to Point `A=2 PL=4` --> `where="24"`
- light device with WHERE address Point to Point `A=03 PL=11` on local bus --> `where="0311#4#01"`
- CEN scenario with WHERE address Point to Point `A=05 PL=12` --> `where="0512"`
- CEN+ configured scenario `5`: add a `2` before --> `where="25"`
- 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
@@ -132,14 +139,14 @@ In BTicino MyHOME Thermoregulation (WHO=4) each **zone** has associated a thermo
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"`
- 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"`
- example sensor `5` of external zone `00` --> `where="500"`
- example: slave sensor `3` of zone `2` --> `where="302"`
#### NOTE
@@ -148,13 +155,14 @@ Systems with Central Units (4 or 99 zones) are not fully supported yet.
## Channels
### Lighting, Automation and Power meter channels
### Lighting, Automation, Power meter and CEN/CEN+ Scenario Events channels
| Channel Type ID (channel ID) | Applies to Thing Type IDs | Item Type | Description | Read/Write |
| ---------------------------------------- | ------------------------------------------------------------- | ------------- | ----------------------------------------------------- | :--------: |
| `switch` or `switch_01`/`02` for ZigBee | `bus_on_off_switch`, `zb_on_off_switch`, `zb_on_off_switch2u` | Switch | To switch the device `ON` and `OFF` | R/W |
| `brightness` | `bus_dimmer`, `zb_dimmer` | Dimmer | To adjust the brightness value (Percent, `ON`, `OFF`) | R/W |
| `shutter` | `bus_automation` | Rollershutter | To activate roller shutters (`UP`, `DOWN`, `STOP`, Percent - [see Shutter position](#shutter-position)) | R/W |
| `button#X` | `bus_cen_scenario_control`, `bus_cenplus_scenario_control` | String | Trigger channel for CEN/CEN+ scenario events [see possible values](#cen-cen-channels) | R (TRIGGER) |
| `power` | `bus_energy_meter` | Number:Power | The current active power usage from Energy Meter | R |
### Thermo channels
@@ -183,6 +191,31 @@ It's possible to enter a value manually or set `shutterRun=AUTO` (default) to ca
- if OH is restarted the binding does not know if a shutter position has changed in the meantime, so its position will be `UNDEF`. Move the shutter all `UP`/`DOWN` to synchronize again its position with the binding
- the shutter position is estimated based on UP/DOWN timing: an error of ±2% is normal
#### CEN/CEN+ channels
CEN/CEN+ are [TRIGGER channels](https://www.openhab.org/docs/configuration/rules-dsl.html#channel-based-triggers]): they handle events and do not have a state.
A powerful feature is to be able to assign CEN or CEN+ commands to your physical wall switches and use the events they generate to trigger rules in openHAB: this way openHAB becomes a very powerful scenario manager activated by physical BTicino switches.
See [openwebnet.rules](#openwebnet-rules) for an example on how to define rules that trigger on CEN/CEN+ buttons events.
It's also possible to send *virtual press* events on the BUS, for example to enable the activation of MH202 scenarios from openHAB.
See [openwebnet.sitemap](#openwebnet-sitemap) & [openwebnet.rules](#openwebnet-rules) sections for an example on how to use the `virtualPress` action connected to a pushbutton on a sitemap.
- channels are named `button#X` where `X` is the button number on the Scenario Control device
- in the .thing file configuration you can specify the `buttons` parameter to define a comma-separated list of buttons numbers [0-31] configured for the scenario device, example: `buttons=1,2,4`
- possible events are:
- for CEN:
- `START_PRESS` - sent when you start pressing the button
- `SHORT_PRESS` - sent if you pressed the button shorter than 0,5sec (sent at the moment when you release it)
- `EXTENDED_PRESS` - sent if you keep the button pressed longer than 0,5sec; will be sent again every 0,5sec as long as you hold pressed (good for dimming rules)
- `RELEASE_EXTENDED_PRESS` - sent once when you finally release the button after having it pressed longer than 0,5sec
- for CEN+:
- `SHORT_PRESS` - sent if you pressed the button shorter than 0,5sec (sent at the moment when you release it)
- `START_EXTENDED_PRESS` - sent once as soon as you keep the button pressed longer than 0,5sec
- `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 dimming rules)
- `RELEASE_EXTENDED_PRESS` - sent once when you finally release the button after having it pressed longer than 0,5sec
## Full Example
### openwebnet.things:
@@ -191,13 +224,15 @@ BUS gateway and things configuration:
```
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_thermo_zone LR_zone "Living Room Zone" [ where="2"]
bus_thermo_sensor EXT_tempsensor "External Temperature" [ where="500"]
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_thermo_zone LR_zone "Living Room Zone" [ where="2"]
bus_thermo_sensor EXT_tempsensor "External Temperature" [ where="500"]
bus_cen_scenario_control LR_CEN_scenario "Living Room CEN" [ where="51", buttons="4,3,8"]
bus_cenplus_scenario_control LR_CENplus_scenario "Living Room CEN+" [ where="212", buttons="1,5,18" ]
}
```
@@ -240,6 +275,8 @@ String iLR_zone_cv "Conditioning valves" (g
Number:Temperature iEXT_temp "Temperature [%.1f %unit%]" (gExternal) { channel="openwebnet:bus_thermo_sensor:mybridge:EXT_tempsensor:temperature" }
String iCENPlusProxyItem "CEN+ Proxy Item"
```
@@ -281,9 +318,47 @@ sitemap openwebnet label="OpenWebNet Binding Example Sitemap"
Default item=iLR_zone_hv label="Heating valves status"
Default item=iLR_zone_cv label="Conditioning valves status"
}
Frame label="CEN+ Scenario activation"
{
Switch item=iCENPlusProxyItem label="My CEN+ scenario" icon="movecontrol" mappings=[ON="Activate"]
}
}
```
### openwebnet.rules
```xtend
rule "CEN+ virtual press from OH button"
/* This rule triggers when the proxy item iCENPlusProxyItem is activated, for example from a button on WebUI/sitemap.
When activated it sends a "virtual short press" event (where=212, button=5) on the BUS
*/
when
Item iCENPlusProxyItem received command
then
val actions = getActions("openwebnet","openwebnet:bus_cenplus_scenario_control:mybridge:212")
actions.virtualPress("SHORT_PRESS", 5)
end
rule "CEN dimmer increase"
// A "start press" event on CEN where=51, button=4 will increase dimmer%
when
Channel "openwebnet:bus_cen_scenario_control:mybridge:51:button#4" triggered START_PRESS
then
sendCommand(iLR_dimmer, INCREASE)
end
rule "CEN dimmer decrease"
// A "release extended press" event on CEN where=51, button=4 will decrease dimmer%
when
Channel "openwebnet:bus_cen_scenario_control:mybridge:51:button#4" triggered RELEASE_EXTENDED_PRESS
then
sendCommand(iLR_dimmer, DECREASE)
end
```
## Notes
- The OpenWebNet protocol is maintained and Copyright by BTicino/Legrand. The documentation of the protocol if freely accessible for developers on the [Legrand developer web site](https://developer.legrand.com/documentation/open-web-net-for-myhome/)