I almost finished adding CEN support to the OH3 official binding.
Before sumitting for approval I wanted to check with you some design changes that are summarized here.
(CEN+ will be added after, with same design changes)
things
Same configuration as before, no changes here:
bus_cen_scenario_control CEN_scenario "Living Room CEN" [ where="51", buttons="1,4" ]
channels
Channels now end with #
instead of _
before the button number:
String iLR_scenario_btn1 "Scenario Button 1" <network> { channel="openwebnet:bus_cen_scenario_control:MyServer:51:button#1" }
Also channels are now trigger channels, which means they trigger events but do not keep a state.
They do not need to be associated to an item.
Possible values for triggered events will be the same as on the BUS, so for CEN:
START_PRESSURE
SHORT_PRESSURE
EXTENDED_PRESSURE
RELEASE_EXTENDED_PRESSURE
these are in fact the same found on the scenario configurations on the BTicino gateway and I think is much better to keep the same events (it also simplifies coding).
rule
Since we have trigger channels now, the syntax for the rule is slightly different:
// long pressure on CEN button will switch off dimmer
rule "CEN dimmer off"
when
Channel "openwebnet:bus_cen_scenario_control:MyServer:51:button#1" triggered RELEASE_EXTENDED_PRESSURE
then
sendCommand(iLR_dimmer, OFF)
end
Any comments on this design?