[openwebnet] adding CEN/CEN+ support to OH3

in the new design CEN/CEN+ channels become trigger channels and do not have a state. Therefore you should not need items connected to them.
Like in the example I just posted you would just need to run the proper action inside the rule, so in your case:

// load the custom actions for the CEN thing with address 51
val cenActions = getActions("openwebnet","openwebnet:bus_cen_scenario_control:MH202:51")
     ...
     // trigger START_PRESSURE on button 8 
    cenActions.virtualPress("START_PRESSURE", 8)

OK, got it, but how is the rule triggered from the sitemap?
Today it looks like this way


Switch item=RollEGoeffnen label="RollÀden EG öffnen"  mappings=[PRESSED="Start"]

Hi I have always used CEN+ just interested to hear from other users whether there is any difference between using CEN or CEN+. I know that CEN+ is not limited by the Area and Point address limits.

I find that with CEN+ (using OH2.5) I sometimes need to press the physical button 2 times to get the lights to come on. Has anyone done a test of both to compare response. I have set up a physical switch with CEN just so I can test the new binding but not noticed much difference so far.

by using a proxy item, not connected to a channel. Since this will be a useful use case, I will ad it as an example to the binding readme, and put here so you can test. Need to find the time though


I think the main difference is that CEN+ (which came after CEN of course) is not supported by some gateways/touchpanels.
In any case after I have some positive feedback about current CEN implementation for OH3, I can add quickly CEN+. I think I can have it ready this week or beginning next week.

i dont see any differences in performace between cen and cen+, both work fine.

the big difference is the kind of reaction on the key-press:

for cen you have

START_PRESSURE
SHORT_PRESSURE
EXTENDED_PRESSURE
RELEASE_EXTENDED_PRESSURE

and for cen+ it is

SHORT_PRESSURE
START_OF_EXTENDED_PRESSURE
EXTENDED_PRESSURE
RELEASE_EXTENDED_PRESSURE

so depending what rule you want to code sometimes you will have to use cen and somteimes cen+

example:
you want a rule to dimm your ligth. so you will tell the rule "as long as “extended_pressure” is received dimm the light up/down. this rule will continuosly be started as long as you press the button. - only possible with cen-command

other example:
i have one switch used with double function: short_press switches lights on/off, start_of_extended_press opens/closes the shutter. this is only possible to be realized with cen+ (as the extended press command just olny once is sent even if you keep the button preessed longer)

Thanks @bastler - that is useful to know the difference. Most of my CEN functions are the second case where I turn on/off a light with short press then do something else with a long press so I guess CEN+ is the best option.

I’ll wait for @massi to get the CEN+ working then I can finally upgrade to OH3.

i can confirm the virtual pressure works for me.

additional info for those who work with jython: the command there is

actions.get("openwebnet", "openwebnet:bus_cen_scenario_control:bticino:Bad_Cen_Musik").virtualPress("START_PRESSURE", 8)

(this example is for the thing Bad_Cen_Musik and button nr 8)

Unfortunatly I still do not have a clou how to implement in the new way (OH3) to get CEN triggered to my MH202.

Can please someone give me a complete example how to do it?

As described above, I do have the Switch items in the sitemap, but I do need to get all neccessary new things, items (rules?) to just send the “start” pressure to the MH202.

Can please someone help me in this?
I’m working with the files, not the webgui.

thanks,
Christian

Ciao,
Use this as thing line in your thing file:


bus_cen_scenario_control      YourCenName            "cen label"              @ "Cen/CenPlus" [ where="95", buttons="1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16" ]

Of course ad your “where” id and virtual/physica buttons.

Then add a rule (easier from webgui in “when”):


Channel "openwebnet:bus_cen_scenario_control:YourServer:YourCenName:button#1" triggered START_PRESSURE

And in “then” add your action.

@massi: before publish your new binding,i would to tell you that i have scenery configured in my home through 4 physical buttons (and other 12 used only virtual on my lcd bticino) but your binding is not recognizing my a9 pl5 address
any suggest?

if i understand correct he wants the opposite, not to react on a cen command but send a cen to manage it in the mh202.

perhaps try to use my example:

in things i have configured the cen with button 1 and 2:

bus_cen_scenario_control      Cen_MorgenFeiertag          "Cen_MorgenFeiertag"            @ "Cen/CenPlus" [ where="10#4#01", buttons="1,2" ]

in items i only define a proxy item quite simple:

Switch ivi

i suggest you use dsl? i use jython, but i tried this in dsl:

rule "send cen"
    when
        Item ivi received command

    then
        logInfo("send cen", "proxy item received command")
        val cenActions = getActions("openwebnet","openwebnet:bus_cen_scenario_control:bticino:Cen_MorgenFeiertag")

        switch (ivi.state){
            case ON:{
                cenActions.virtualPress("START_PRESSURE", 1)    // send "START_PRESSURE" to button 1
            }
            case OFF:{
                cenActions.virtualPress("START_PRESSURE", 2)    // send "START_PRESSURE" to button 2
            }
        }
    end

Can you explain it again?
What you mean is not recognized? You mean during discovery? Or you mean that even if you configure it in .things file it does not trigger any button event ?

Yes both! Discovery find everything except scenery buttons and also if i add a9 pl5 buttons 1,2,3,4 the thing keep remaining in unknown



Same for me, can’t configure anything


because of a limitation of openwebnet, CEN/CEN+ discovery works only if you press a scenario button when discovery is activated from webui: this way you will discover the thing. After you have added the thing, you have to press again the buttons so that they are added as channels. This also will make the thing become online (green) in webui.
Actually auto discovery is less useful in the case of CEN/CEN+: I suggest you add them via .things file.

In any case, after adding them via webui or things file, they should appear as green after a scenario physical button is pressed.
If this is not working , set log level to DEBUG and provide me the logs when you press the physical button

I ha e to set debug level because now i’m very lost. I’ve tried to do what you suggest but doesn’t work and also i’ve found something strange.
Today in inbox was shown a new item “automation where3” and it’s a scenario that i’ve launched manually from homebridge (i think).
Now comes the strange thing: where 3 is also a thermostat! So howncan be possible that i have two where 3?!
So i pressed the button that moves all rollershutters down/up and has been discovered as where 0.
Then i tried to press scenery 1,2,3,4 and put webui in scan mode,bit nothing found. Tried also to unlock and put scenery buttons in “programming/learning” but nothing discovered. Same thing donenf rom lcd,but nothing discovered.

Can you tell me how to set in debug to provide you more useful info? I would like to help you in any way because you helped thousand people with your hard work!

Ps. Where 0 becomes green when pressed and then come back yellow/unknown


I have added CEN+.
I also prepared the README with some explanation and examples.
If everything works I will publish it to include CEN/CEN+ in the official binding.

New jar (cen_v3)

org.openhab.binding.openwebnet-3.2.0-SNAPSHOT_cen_v3.jar.pdf (211.1 KB)

From the README

Discovery

  • CEN/CEN+ Scenario Control devices will be discovered by activation only. After confirming a discovered CEN/CEN+ device from Inbox, activate again its scenario buttons to add button channels automatically

CEN/CEN+ channels

CEN/CEN+ are TRIGGER channels: 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 next for an example on how to define rules that trigger on CEN/CEN+ push buttons events.

It’s also possible to send virtual pressure events on the BUS, for example to enable the activation of MH202 scenarios from openHAB.
See next 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_PRESSURE - sent when you start pressing the button
      • SHORT_PRESSURE - sent if you pressed the button shorter than 0,5sec (sent at the moment when you release it)
      • EXTENDED_PRESSURE - 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_PRESSURE - sent once when you finally release the button after having it pressed longer than 0,5sec
    • for CEN+:
      • SHORT_PRESSURE - sent if you pressed the button shorter than 0,5sec (sent at the moment when you release it)
      • START_EXTENDED_PRESSURE - sent once as soon as you keep the button pressed longer than 0,5sec
      • EXTENDED_PRESSURE - sent after START_EXTENDED_PRESSURE 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_PRESSURE - sent once when you finally release the button after having it pressed longer than 0,5sec

.things:

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" ]

.items:

String iCENPlusProxyItem "CEN+ Proxy Item"

.sitemap:

Frame label="CEN+ Scenario activation"
    {
          Switch    item=iCENPlusProxyItem  label="My CEN+ scenario" icon="movecontrol"  mappings=[ON="Activate"]
    }

.rules:

rule "CEN+ virtual pressure 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 pressure" of 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_PRESSURE", 5)
end


rule "CEN dimmer increase"
// A "start pressure" event on CEN where=51, button=4 will increase dimmer%
when
    Channel "openwebnet:bus_cen_scenario_control:mybridge:51:button#4" triggered START_PRESSURE
then
    sendCommand(iLR_dimmer, INCREASE)  
end


rule "CEN dimmer decrease"
// A "release extended pressure" event on CEN where=51, button=4 will decrease dimmer%
when
    Channel "openwebnet:bus_cen_scenario_control:mybridge:51:button#4" triggered RELEASE_EXTENDED_PRESSURE
then
    sendCommand(iLR_dimmer, DECREASE)  
end

what I’m doing wrong?

LOG:;

Script execution of rule with UID 'bticinoszenarien-1' failed: Instance is not an OpenWebNetCENActions class. in bticinoszenarien

rules:

rule "Regel RollÀden EG öffnen"
when
    Item RollEGoeffnen received command
then
    val actions = getActions("openwebnet","openwebnet:bus_cen_scenario_control:mybridge:99")
    actions.virtualPress("SHORT_PRESSURE", 8)
end

bus_cen_scenario_control MH202_CEN_scenario "MH202 CEN"                 [ where="99", buttons="1,7,8,13,14"]

SOLVED: The naming was wrong.
When using .thing file, the name “MH202_CEN_scenario” in my case must be used instead of 99 in the rule.

Now it’s working, thanks.

now i have all my cen and cenplus defined in the v3-snapshot. as far as i can see everything works perfect, thank you!