[openwebnet] adding CEN/CEN+ support to OH3

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!

i still have problems, binding doesn’t detect automatically my scenery wall buttons, and if i add them via gui always stay in uknown state.
i’ve seen when i reboot my LCD (used as a bridge to all bticino envirnment) the thing becomes green but still won’t recogniz when i pres wall scenery buttons.
i don’t understand why because homebridge recognize and works with sceneries flawlessly :frowning:

Set log level to DEBUG (search main BTicino thread to see how) and then press a wall scenery button. Then send me the logs, and specify how the wall button you pressed is configured in Bticino system. Also send me your thing configuration, in text form. Use code fences when pasting config or logs.
Follow each step and be precise as much as possibile otherwise I cannot help if not enough info or confused or partial…

@massi

events.log (25.1 KB)
openhab.log (109.9 KB)

here you both log. as you can see, on last lines of openhab.log there are rollershutters received command down. i’ve launched this from a scenario detected by homebridge (because i’m not at home). i’ve launched also an empty scenario from hombridge to check if something passes on the bus but nothing.
if you need me to press physical buttons let me know, but i think there’s no need because i can launch scenaries from homebridge.

thanks a lot for your interest :slight_smile:

I do not know how homebridge is integrated with your touchscreen gateway and scenarios, but surely on the log you sent there is no single event message with who=15/25 which are the CEN/CEN+ scenario messages.
When at home try also to press a physical button to trigger a scenario… and let’s see if there is some message in the log. It’s possible that some gateways can receive scenario activation commands, but they do not propagate it on the BUS to other conneted clients like our binding. I’ll have a look at documentation. In this is the case you will be able to start scenarios but not listen to them

openhab.log (9.5 KB)
events.log (25.1 KB)
here you are new log.
let me know what do you think about :slight_smile:

also i don’t know if can help:

image

There are no traces of CEN/CEN+ messages also in the new log.

From the openwebnet client I can see *0*2*95## and *0*4*95##: what these two tell you?
Have you these configured somewhere in the panel/Bticino configuration? They are related to scenario (but not CEN/CEN+ scenarios) with address where=95

Also it looks like you did not set the logs level properly. You must use BOTH:

  • set log level to DEBUG, from Karaf console:
    • log:set DEBUG org.openhab.binding.openwebnet
    • log:set DEBUG org.openwebnet4j

Yes this 0295## and 0495## are called from two scenarios buttons on the wall.
From 1 to 4 are physical and from 5 to 16 virtually configured from my lcd…
Some minutes early of that you can see 01*95## that opened all my rollershutters.
Tomorrow i will try to set debug as suggested.

i think this can help you, but for me ould be a bad news:(

2021-10-13 09:02:08.815 [INFO ] [unication.BUSConnector.message.event] - BUS-MON <<<<<<<< *0*4*95##
2021-10-13 09:02:08.816 [DEBUG] [nwebnet4j.communication.BUSConnector] - UNSUPPORTED FRAME: *0*4*95##, skipping it

what does this mean?