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)
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.
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.
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.
@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?
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 ?
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.
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
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
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