[openwebnet] adding CEN/CEN+ support to OH3

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?

who=0 older scenario scheduler (i.e. messages starting with *0*) is in fact not supported yet.
The binding now supports who=15/25 (CEN/CEN+ scenarios) as discussed in this thread. You may add a new issue to github asking support for WHO=0 Scenarios

ok thanks Massi, i’ve opened a new issue. for the moment i’ll keep fingers crossed, but any hope is far to come true.

thanks for your support!

@bastler and @Julian_Divett have you had time to test both CEN and CEN+?

If no issue are present I would proceed and submit this version supporting CEN/CEN+ for review to be included in the official binding.

YES, cen and cenplus are working perfect for me. as i already wrote i defined all my cen and cenplus with the v3-snapshot.

additionally want to note that i do all my configs textual (*.things and *.items files) and work with openhabian 3.2.0 m3

I have installed the binding but I can’t seem to get the Cen+ switches discovered. I do a search for things and press the buttons but they do not show up. I have not tried adding them using a text file. I will try again and send a log file tomorrow.

Ok I think the problem is that I am still running the old version - I put the new one in the add ons folder then when I tried to start it in karaf I get this:

256 │ Installed │  80 │ 3.2.0.202110102314    │ openHAB Add-ons :: Bundles :: OpenWebNet (BTicino/
openhab> bundle:start 256
Error executing command: Error executing command on bundles:
        Error starting bundle 256: Could not resolve module: org.openhab.binding.openwebnet [256]
  Unresolved requirement: Import-Package: org.openhab.core.config.discovery.upnp

@Julian_Divett @massi

i tested the autodiscover on my system. what i did:

  • delted *.things and *.items file
  • opened the mainui and did a scan at “things”
  • my f454 was found and i added it
  • went online even the password was not correct (standard password was set automatically)
  • i updated the correct password AND set the switch “discovery by activation” from OFF to ON
  • after a short time the inbox filled with many bticino things, first cen that was found was “15.99h4h01” that i don´t know what is, cannot remember i ever configured this
  • then i pressed several switches that are configured as cen or cenplus and all of them are listed in the inbox in that moment when i press the switch
  • then added one of the cenplus as thing → in this moment it is in the things list with state “unknown” and when i press the button again it comes to “online”

so for me the autodiscover works

first of all don´t forget to uninstall te openwebnet binding in mainui!

after that put the jar file in the addons folder.

then you may receive the error you wrote. open caraf console:

openhab-cli console

and then type this two lines:

feature:install openhab-transport-serial
feature:install openhab-transport-upnp

then you should see in the log the binding starts

thanks I’ve just done exactly that and it has installed the new binding!. Now still not getting the discovery to work. It finds everything find but just not the CEN+.

The log file shows that it is picking up the commands but its says no device associated?

I tried resdiscovering the f454 and starting from scratch but still not working?

Ok working now!

I turned off activation by discovery on the 454 properties, saved,
Then turned it back on and saved.

The classic turn off then on always works!

Can test properly now.

Hello, I confirm CEN+ is working perfectly in my setup.
I am using a MyHOMEServer1 and CEN+ to control the “all lights” and “all rollershutters”. I use text configuration.

I also confirm that if you just add the text files, the items will appear as “OFFLINE” or “COMMUNICATION_ERROR” in openHAB’s Things page. But as soon as you press the phisical buttons, the things will be recognized and turn to “ONLINE”.

Same goes for scanning, if it is your approach. You need to press the buttons during the scan in order for CEN+ commands to popup, as @massi stated in his post.

Here is my configuration.

.things file:

// COMANDO GENERALE LUCI: SCENARIO PROGRAMMATO PLUS / CEN=1 / PULS.SUP.=1 / PULS.INF.=2
bus_cenplus_scenario_control CEN_Plus_Gen_Luci   "CEN+ Generale Luci"             @ "Ingresso"     [ where="21", buttons="1,2" ] // 25.21

// COMANDO GENERALE TAPPARELLE: SCENARIO PROGRAMMATO PLUS / CEN=2 / PULS.SUP.=1 / PULS.INF.=2
bus_cenplus_scenario_control CEN_Plus_Gen_Tapp   "CEN+ Generale Tapparelle"       @ "Ingresso"     [ where="22", buttons="1,2" ] // 25.22

.items file:

String   iCEN_Plus_Gen_Luci_ON   "CEN+ Gen Luci ON"     <network>     { channel="openwebnet:bus_cenplus_scenario_control:mybridge:CEN_Plus_Gen_Luci:button#1" }
String   iCEN_Plus_Gen_Luci_OFF  "CEN+ Gen Luci OFF"    <network>     { channel="openwebnet:bus_cenplus_scenario_control:mybridge:CEN_Plus_Gen_Luci:button#2" }

String   iCEN_Plus_Gen_Tapp_SU   "CEN+ Gen Tapp Su"     <network>     { channel="openwebnet:bus_cenplus_scenario_control:mybridge:CEN_Plus_Gen_Tapp:button#1" }
String   iCEN_Plus_Gen_Tapp_GIU  "CEN+ Gen Tapp Giù"    <network>     { channel="openwebnet:bus_cenplus_scenario_control:mybridge:CEN_Plus_Gen_Tapp:button#2" }

.rules file:

// GENERALE LUCI

rule "Traccia pulsante dummy generale Luci ON (pressione breve) e accendi solo luci welcome home (spegni le altre)"
	when
		Channel "openwebnet:bus_cenplus_scenario_control:mybridge:CEN_Plus_Gen_Luci:button#1" triggered SHORT_PRESSURE
	then
		// Switch che controlla una scena, gestita dalla regola più in basso
		Luci_Benvenuto.sendCommand(ON)
	end
	
rule "Traccia pulsante dummy generale Luci ON (pressione prolungata) e dai lo stesso comando a gLuci"
	when
		Channel "openwebnet:bus_cenplus_scenario_control:mybridge:CEN_Plus_Gen_Luci:button#1" triggered RELEASE_EXTENDED_PRESSURE
	then
		gLuci.sendCommand(ON)
	end
	
rule "Traccia pulsante dummy generale Luci OFF (pressione prolungata o breve) e dai lo stesso comando a gLuci"
	when
		Channel "openwebnet:bus_cenplus_scenario_control:mybridge:CEN_Plus_Gen_Luci:button#2" triggered SHORT_PRESSURE or
		Channel "openwebnet:bus_cenplus_scenario_control:mybridge:CEN_Plus_Gen_Luci:button#2" triggered RELEASE_EXTENDED_PRESSURE
	then
		gLuci.sendCommand(OFF)
	end



// GENERALE TAPPARELLE

rule "Traccia pulsante dummy generale Tapp SU (pressione prolungata) e dai il comando a gTapparelle"
	when 
		Channel "openwebnet:bus_cenplus_scenario_control:mybridge:CEN_Plus_Gen_Tapp:button#1" triggered RELEASE_EXTENDED_PRESSURE
	then 
		gTapparelle.sendCommand(UP)
	end
	
rule "Traccia pulsante dummy generale Tapp GIÙ (pressione prolungata) e dai il comando a gTapparelle"
	when 
		Channel "openwebnet:bus_cenplus_scenario_control:mybridge:CEN_Plus_Gen_Tapp:button#2" triggered RELEASE_EXTENDED_PRESSURE
	then 
		gTapparelle.sendCommand(DOWN)
	end

rule "Traccia pulsante dummy generale Tapp SU (pressione breve) e dai il comando a gTapparelle o accendi modalità estate (giorno)"
	when 
		Channel "openwebnet:bus_cenplus_scenario_control:mybridge:CEN_Plus_Gen_Tapp:button#1" triggered SHORT_PRESSURE
	then 
		logInfo("bticino.rules", "button UP pressed")

		if (buttonTimerUp === null) {
			gTapparelle.sendCommand(STOP) 
			// start the timer
			logWarn("bticino.rules", "Timer Up started")
			buttonTimerUp = createTimer(now.plusSeconds(2)) [ |
				// if the timer expires
				logWarn("bticino.rules", "Timer Up expired")
				logInfo("bticino.rules", "--> Button UP SINGLE pressed")
				// reset the timer
				buttonTimerUp = null
			]
		} 
		else {
			// within the timer window
			logInfo("bticino.rules", "--> Button UP DOUBLE pressed")
			Chiudi_Tapparelle_Modalita_Estate_Giorno.sendCommand(ON)
			// reset the timer
			buttonTimerUp.cancel
			buttonTimerUp = null
		}
	end

rule "Traccia pulsante dummy generale Tapp GIU' (pressione breve) e dai il comando a gTapparelle o accendi modalità estate (notte)"
	when 
		Channel "openwebnet:bus_cenplus_scenario_control:mybridge:CEN_Plus_Gen_Tapp:button#2" triggered SHORT_PRESSURE
	then 
		logInfo("bticino.rules", "button DOWN pressed")
	
		if (buttonTimerDown === null) {
			gTapparelle.sendCommand(STOP) 
			// start the timer
			logWarn("bticino.rules", "Timer Down started")
			buttonTimerDown = createTimer(now.plusSeconds(2)) [ |
				// if the timer expires
				logWarn("bticino.rules", "Timer Down expired")
				logInfo("bticino.rules", "--> Button DOWN SINGLE pressed")
				// reset the timer
				buttonTimerDown = null
			]
		} 
		else {
			// within the timer window
			logInfo("bticino.rules", "--> Button DOWN DOUBLE pressed")
			Chiudi_Tapparelle_Modalita_Estate_Notte.sendCommand(ON)
			// reset the timer
			buttonTimerDown.cancel
			buttonTimerDown = null
		}
	end 

As you can see, for rollershutters I implemented a “double press” feature, which is pretty reliable and useful. In my setting, if you short press once, it stops the rollershutters. Instead if you short press twice within 2 seconds, it fires an action (a scenario).

That may be an interesting upgrade if implemented in the binding itself, even tho I don’t know if it is even possible (I have to admit I have no idea how a binding is created). @massi

Something like this would be cool:

bus_cenplus_scenario_control CEN_Plus_Gen_Tapp   "CEN+ Generale Tapparelle"   @ "Ingresso"   [ where="22", buttons="1,2", doublePressTimer="2" ]

So if you set to 0 no double press is detected, if you set e.g. to 2 it is detected within 2 seconds and a “DOUBLE_PRESSED” event is triggered by the channel.