[BTicino/OpenWebNet] Adding CEN commands: design

2 Problem

.things

Thing  bus_cenplus_scenario_control    Cenplus_test "Scenario+ Test" @ "Test"	[ where="210", buttons="9,10,11,12" ]
Thing  bus_cen_scenario_control        Cen_test     "Scenario Test"  @ "Test"   [ where="26", buttons="9,10,11,12" ]

.items

String iLR_cenplus_test9    "CEN+ B9"     <network> { channel="openwebnet:bus_cenplus_scenario_control:mybridge:Cenplus_test:button_9" }
String iLR_cenplus_test10   "CEN+ B10"    <network> { channel="openwebnet:bus_cenplus_scenario_control:mybridge:Cenplus_test:button_10"}
String iLR_cenplus_test11   "CEN+ B11"    <network> { channel="openwebnet:bus_cenplus_scenario_control:mybridge:Cenplus_test:button_11"}
String iLR_cenplus_test12   "CEN+ B12"    <network> { channel="openwebnet:bus_cenplus_scenario_control:mybridge:Cenplus_test:button_12"}
String iLR_cen_test9        "CEN B9"      <network> { channel="openwebnet:bus_cen_scenario_control:mybridge:Cen_test:button_9" }
String iLR_cen_test10       "CEN B10"     <network> { channel="openwebnet:bus_cen_scenario_control:mybridge:Cen_test:button_10"}
String iLR_cen_test11       "CEN B11"     <network> { channel="openwebnet:bus_cen_scenario_control:mybridge:Cen_test:button_11" }
String iLR_cen_test12       "CEN B12"     <network> { channel="openwebnet:bus_cen_scenario_control:mybridge:Cen_test:button_12"}

.sitemaps

Switch item=iLR_cenplus_test9 	label="CEN+ B9" 	mappings=[PRESSED="Scenario (PRESSED)",PRESSED_EXT="Scenario (PRESSED_EXT)"]
Switch item=iLR_cenplus_test10 	label="CEN+ B10" 	mappings=[PRESSED="Scenario (PRESSED)",PRESSED_EXT="Scenario (PRESSED_EXT)"]
Switch item=iLR_cenplus_test11 	label="CEN+ B11" 	mappings=[PRESSED="Scenario (PRESSED)",PRESSED_EXT="Scenario (PRESSED_EXT)"]
Switch item=iLR_cenplus_test12 	label="CEN+ B12" 	mappings=[PRESSED="Scenario (PRESSED)",PRESSED_EXT="Scenario (PRESSED_EXT)"]
Switch item=iLR_cen_test9 		label="CEN B9" 		mappings=[PRESSED="Scenario (PRESSED)",PRESSED_EXT="Scenario (PRESSED_EXT)"]
Switch item=iLR_cen_test10 		label="CEN B10" 	mappings=[PRESSED="Scenario (PRESSED)",PRESSED_EXT="Scenario (PRESSED_EXT)"]
Switch item=iLR_cen_test11 		label="CEN B11" 	mappings=[PRESSED="Scenario (PRESSED)",PRESSED_EXT="Scenario (PRESSED_EXT)"]
Switch item=iLR_cen_test12 		label="CEN B12" 	mappings=[PRESSED="Scenario (PRESSED)",PRESSED_EXT="Scenario (PRESSED_EXT)"]

.rules

rule "sktest9"
    when
        Item iLR_cenplus_test9 changed
    then
        switch(iLR_cenplus_test9.state ) {
            case "PRESSED": {
               logInfo("CEN+ B9", "success!" )
               Luce_sala.sendCommand(ON)
            }
            case "PRESSED_EXT": {
               logInfo("CEN+ B9 EXT", "success!" )
               Luce_sala.sendCommand(ON)
            }
        }
end
rule "sktest10"
    when
        Item iLR_cenplus_test10 changed 
    then
        switch(iLR_cenplus_test10.state ) {
            case "PRESSED": {
               logInfo("CEN+ B10 OFF", "success!" )
               Luce_sala.sendCommand(OFF)
            }
            case "PRESSED_EXT": {
               logInfo("CEN+ B10 OFF EXT", "success!" )
               Luce_sala.sendCommand(OFF)
            }
        }
end
rule "sktest11"
    when
        Item iLR_cenplus_test11 changed
    then
        switch(iLR_cenplus_test11.state ) {
            case "PRESSED": {
               logInfo("CEN+ B11", "success!" )
               Luce_entrata.sendCommand(ON)
            }
            case "PRESSED_EXT": {
               logInfo("CEN+ B11 EXT", "success!" )
               Luce_entrata.sendCommand(ON)
            }
        }
end
rule "sktest12"
    when
        Item iLR_cenplus_test12 changed 
    then
        switch(iLR_cenplus_test12.state ) {
            case "PRESSED": {
               logInfo("CEN+ B12 OFF", "success!" )
               Luce_entrata.sendCommand(OFF)
            }
            case "PRESSED_EXT": {
               logInfo("CEN+ B12 OFF EXT", "success!" )
               Luce_entrata.sendCommand(OFF)
            }
        }
end
rule "sktest9a"
    when
        Item iLR_cen_test9 changed 
    then
        switch(iLR_cen_test9.state ) {
            case "PRESSED": {
               logInfo("CEN B9 ON", "success!" )
               Luce_sala.sendCommand(ON)
            }
            case "PRESSED_EXT": {
               logInfo("CEN B9 ON EXT", "success!" )
               Luce_sala.sendCommand(ON)
            }
        }  
end
rule "sktest10A"
    when
        Item iLR_cen_test10 changed 
    then
        switch(iLR_cen_test10.state ) {
            case "PRESSED": {
               logInfo("CEN B10 OFF", "success!" )
               Luce_sala.sendCommand(OFF)
            }
            case "PRESSED_EXT": {
               logInfo("CEN B10 OFF EXT", "success!" )
               Luce_sala.sendCommand(OFF)
            }
        }
           
end
rule "sktest11A"
    when
        Item iLR_cen_test11 changed 
    then
        switch(iLR_cen_test11.state ) {
            case "PRESSED": {
               logInfo("CEN B11 OFF", "success!" )
               Luce_entrata.sendCommand(OFF)
            }
            case "PRESSED_EXT": {
               logInfo("CEN B11 OFF EXT", "success!" )
               Luce_entrata.sendCommand(OFF)
            }
        }
           
end
rule "sktest12A"
    when
        Item iLR_cen_test12 changed 
    then
        switch(iLR_cen_test12.state ) {
            case "PRESSED": {
               logInfo("CEN B12 OFF", "success!" )
               Luce_entrata.sendCommand(OFF)
            }
            case "PRESSED_EXT": {
               logInfo("CEN B12 OFF EXT", "success!" )
               Luce_entrata.sendCommand(OFF)
            }
        }
           
end

Caution
Buttons 9 and 10 are also configured on physical switches
Buttons 11 and 12 are configured ONLY on OH (button virtual)

Press CEN B12
OK Start Rules
OK Exit on Bus, log client

[Ricevuto 21.01.2019 16:05:34] [MONITOR] *15*12#1*26##
[Ricevuto 21.01.2019 16:13:54] [MONITOR] *15*12#3*26##

Press CEN+ B12
OK Start Rules
OK Exit on Bus, log client

[Ricevuto 21.01.2019 16:17:36] [MONITOR] *25*21#12*210##
[Ricevuto 21.01.2019 16:17:38] [MONITOR] *25*22#12*210##

Press CEN+ B11
OK Exit on Bus, log client

[Ricevuto 21.01.2019 16:23:09] [MONITOR] *25*21#11*210##

Rules:
OK Start [ipse.smarthome.model.script.CEN+ B11] - success!
KO Start [ipse.smarthome.model.script.CEN+ B10 OFF] - success! (this rules should not start)

2019-01-21 16:24:58.247 [INFO ] [ipse.smarthome.model.script.CEN+ B11] - success!
==> /var/log/openhab2/events.log <==
2019-01-21 16:24:58.258 [ome.event.ItemCommandEvent] - Item 'Luce_entrata' received command ON
2019-01-21 16:24:58.267 [nt.ItemStatePredictedEvent] - Luce_entrata predicted to become ON
2019-01-21 16:24:58.351 [vent.ItemStateChangedEvent] - iLR_cenplus_test10 changed from RELEASED to PRESSED
==> /var/log/openhab2/openhab.log <==
2019-01-21 16:24:58.363 [INFO ] [.smarthome.model.script.CEN+ B10 OFF] - success!
==> /var/log/openhab2/events.log <==
2019-01-21 16:24:58.369 [ome.event.ItemCommandEvent] - Item 'Luce_sala' received command OFF
2019-01-21 16:24:58.377 [nt.ItemStatePredictedEvent] - Luce_sala predicted to become OFF
2019-01-21 16:24:58.560 [vent.ItemStateChangedEvent] - iLR_cenplus_test10 changed from PRESSED to RELEASED
2019-01-21 16:24:58.563 [vent.ItemStateChangedEvent] - iLR_cenplus_test11 changed from PRESSED to RELEASED
2019-01-21 16:25:01.037 [ome.event.ItemCommandEvent] - Item 'check_Domotica' received command ON

Press CEN+ B10
Exit on Bus, log client (the output on the bus of the command 11 is incorrect)

[Ricevuto 21.01.2019 16:31:35] [MONITOR] *25*21#11*210##
[Ricevuto 21.01.2019 16:31:36] [MONITOR] *25*21#10*210##

Rules:
KO Start [.smarthome.model.script.CEN+ B10 OFF] - success! (this rules must start 1 time, from the log we see that part 2 times)
KO Start [ipse.smarthome.model.script.CEN+ B11] - success! (this rules should not start)

2019-01-21 16:35:14.566 [INFO ] [.smarthome.model.script.CEN+ B10 OFF] - success!
==> /var/log/openhab2/events.log <==
2019-01-21 16:35:14.577 [ome.event.ItemCommandEvent] - Item 'Luce_sala' received command OFF
2019-01-21 16:35:14.589 [nt.ItemStatePredictedEvent] - Luce_sala predicted to become OFF
2019-01-21 16:35:14.705 [vent.ItemStateChangedEvent] - iLR_cenplus_test11 changed from RELEASED to PRESSED
==> /var/log/openhab2/openhab.log <==
2019-01-21 16:35:14.712 [INFO ] [ipse.smarthome.model.script.CEN+ B11] - success!
==> /var/log/openhab2/events.log <==
2019-01-21 16:35:14.718 [ome.event.ItemCommandEvent] - Item 'Luce_entrata' received command ON
2019-01-21 16:35:14.727 [nt.ItemStatePredictedEvent] - Luce_entrata predicted to become ON
2019-01-21 16:35:14.904 [vent.ItemStateChangedEvent] - iLR_cenplus_test10 changed from PRESSED to RELEASED
2019-01-21 16:35:14.911 [vent.ItemStateChangedEvent] - iLR_cenplus_test11 changed from PRESSED to RELEASED
2019-01-21 16:35:15.893 [vent.ItemStateChangedEvent] - iLR_cenplus_test10 changed from RELEASED to PRESSED
==> /var/log/openhab2/openhab.log <==
2019-01-21 16:35:15.898 [INFO ] [.smarthome.model.script.CEN+ B10 OFF] - success!
==> /var/log/openhab2/events.log <==
2019-01-21 16:35:15.904 [ome.event.ItemCommandEvent] - Item 'Luce_sala' received command OFF
2019-01-21 16:35:15.914 [nt.ItemStatePredictedEvent] - Luce_sala predicted to become OFF
2019-01-21 16:35:16.089 [vent.ItemStateChangedEvent] - iLR_cenplus_test10 changed from PRESSED to RELEASED

Is this correct for a sensor? Predicted! Whats that?

2019-01-24 14:41:26.221 [vent.ItemStateChangedEvent] - Rain_Sensor changed from NULL to ON

2019-01-24 14:41:30.355 [ome.event.ItemCommandEvent] - Item 'Rain_Sensor' received command OFF

2019-01-24 14:41:30.365 [nt.ItemStatePredictedEvent] - Rain_Sensor predicted to become OFF

==> /var/log/openhab2/openhab.log <==

2019-01-24 14:41:30.365 [WARN ] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== cannot get button number from channel: openwebnet:bus_dry_contact_ir:Screen10:36:sensor. Ignoring command OFF

edit… predicted >>> comes from newer openhab releases?

Hi,

This could be dum question!!
I started to try implement CEN.
I have CEN item and CEN Thing.
When I select pressed in paperUI the CEN runs and I see the CEN pressed and the subsequent actions in the log.

When I select start CEN from the screen 10 panel I dont see anything in the log for CEN but I do see the CEN actions. So, it ran but the binding didn’t detect it and show in log the change.

So, should the binding detect when a CEN is button is pressed on a physical switch (I have tested this yet), Screen10 button, phone app start command (same CEN no show as Screen 10 button)?

Background:
I have some MH202 scenarios executed by CEN. Some of these scenarios have very sensitive timing requirements, sub 1 sec, and I do this by using dummy light MH202 actions which are approx 250ms to execute. I string a few of these dummy actions to get 250 -750ms pauses in the sequences of actions. This did work (its for PIR override) but lately its become unreliable. The timings are affected by activity on the BUS and I wonder if the recent binding improvments have affected BUS acttivity?

Anyhow, I want to move the CEN actions from MH202 to openhab. Openhab has much better ways to control sub 1 second pauses. I have created a rule and it worked first time but to run the rule I really need to detect when the CEN button command was sent from the screen10 panel .

Or maybe I could using a dummy S10 switch instead???

Mark

Yes, it was added to OH2.4.0

YES The binding should see all CEN messages that are notified on the BUS.
You can double check if the CEN message is sent on the BUS when you press the physical button by using then event session in the official Bticino OpenWebNet client (search the main thread you will find info).
If you see a message from the BUS but the binding does not show any change then you should open a new issue and copy the received message, and only the relevant log when the message is received but the binding does not react
I cannot help much if no relevantly log or message examples are given to me to be analyzed

Bye
M

Hi Massimo,

I dont see in the log the actual CEN button press when its done from the screen10 or phone app? I do see it when I use paperUI CEN button is ‘pressed’

I know the CEN was actually sent because I see in the log the switches changing state The CEN I am using starts a MH202 scenario. I dont see the CEN event itself in the log, unless its done from PaperUI and then I do see it in the log.

I will switch debug mode on and check again.

I have not yet tried a physical switch but I have one configured for CEN or maybe its CENplus

@massi @m4rk
hi thogether,

i think i have similar problem. trying to get cen work but cen commands are only detected when running from paperui. tried a lot meanwhile, even with discovered cen - nothing works.

actually do make it easy i used a cen-command that is newly and never else used:

things:

Thing bus_cen_scenario_control cen_71_1_2 "cen test" @ "Cen/CenPlus" [ where="71#4#01", buttons="1,2" ]

items:

String icen_71_1_2_an "cen_71 an" &lt;network&gt; { channel="openwebnet:bus_cen_scenario_control:MH200N:cen_71_1_2:button_1" }

String icen_71_1_2_aus "cen_71 aus" &lt;network&gt; { channel="openwebnet:bus_cen_scenario_control:MH200N:cen_71_1_2:button_2" }

.

.
now whey selecting “pressed” in paperui this is the log:

2019-01-30 16:48:46.256 [ome.event.ItemCommandEvent] - Item 'icen_71_1_2_an' received command PRESSED

2019-01-30 16:48:46.276 [nt.ItemStatePredictedEvent] - icen_71_1_2_an predicted to become PRESSED

==> /var/log/openhab2/openhab.log <==

2019-01-30 16:48:46.283 [DEBUG] [ebnet.handler.OpenWebNetThingHandler] - ==OWN:ThingHandler== handleCommand() (command=PRESSED - channel=openwebnet:bus_cen_scenario_control:MH200N:cen_71_1_2:button_1)

2019-01-30 16:48:46.291 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== handleChannelCommand() (command=PRESSED)

2019-01-30 16:48:46.297 [INFO ] [g.openwebnet.bus.MyHomeJavaConnector] - COM SENDING   ============>>>>>>>>>>>> *15*01*71#4#01##

==> /var/log/openhab2/events.log <==

2019-01-30 16:48:46.302 [vent.ItemStateChangedEvent] - icen_71_1_2_an changed from RELEASED to PRESSED

==> /var/log/openhab2/openhab.log <==

2019-01-30 16:48:46.372 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - COM RECEIVED  <<<<<<<<<<<<============ *#*1##

2019-01-30 16:48:46.375 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *15*01*71#4#01##

2019-01-30 16:48:46.383 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=15.71#4#01

2019-01-30 16:48:46.395 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== handleMessage() for thing: openwebnet:bus_cen_scenario_control:MH200N:cen_71_1_2

2019-01-30 16:48:46.401 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== updateButtonState() for thing: openwebnet:bus_cen_scenario_control:MH200N:cen_71_1_2

2019-01-30 16:48:46.881 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== # 71#4#01 sending CEN virtual release...

2019-01-30 16:48:46.885 [INFO ] [g.openwebnet.bus.MyHomeJavaConnector] - COM SENDING   ============>>>>>>>>>>>> *15*01#1*71#4#01##

2019-01-30 16:48:46.962 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - COM RECEIVED  <<<<<<<<<<<<============ *#*1##

2019-01-30 16:48:46.966 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *15*01#1*71#4#01##

2019-01-30 16:48:46.971 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=15.71#4#01

2019-01-30 16:48:46.975 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== handleMessage() for thing: openwebnet:bus_cen_scenario_control:MH200N:cen_71_1_2

2019-01-30 16:48:46.978 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== updateButtonState() for thing: openwebnet:bus_cen_scenario_control:MH200N:cen_71_1_2

2019-01-30 16:48:47.182 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== # 71#4#01 updating state to 'RELEASED'...

==> /var/log/openhab2/events.log <==

2019-01-30 16:48:47.202 [vent.ItemStateChangedEvent] - icen_71_1_2_an changed from PRESSED to RELEASED

additionally this is the log in openwebnet client:

paperui
.

.
but when strarting form touchscreen or domotica-app only this is my log:

2019-01-30 16:50:12.868 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *15*01*71#4#01##

2019-01-30 16:50:12.874 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=15.71#4#01

2019-01-30 16:50:12.880 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== handleMessage() for thing: openwebnet:bus_cen_scenario_control:MH200N:cen_71_1_2

2019-01-30 16:50:12.883 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== updateButtonState() for thing: openwebnet:bus_cen_scenario_control:MH200N:cen_71_1_2

additionally this is the log in openwebnet client:
domotica
.

.
seems the thing is discovered but not the button, because if i send a cen that is not in things this is the log:

2019-01-30 16:59:51.770 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=15.72#4#01 has NO DEVICE associated, ignoring it

i already wrote with arnaud, for him it works without problems. might be the need of the installation niveau the problem because he does not need it but me?

additionally i want to remark that this problem is only with cen-commands, cenplus seems to work ok.

best stefan

I tried again from the Screen10, this time with debug mode on and now I see CEN56 Thing when initiated from the screen10 button but not the Item.

Item.....
String WestPIRLights4hrs_CEN "West PIR lights 4hrs" <light> ["Lighting"] {channel="openwebnet:bus_cen_scenario_control:Screen10:56:button_0" }

Thing.......
Thing bus_cen_scenario_control 56 "West PIR lights 4hrs" [ where ="56", buttons ="0" ]


Note CEN56 starts a sequence of ON and OFF’s for West PIR light 13. There are also 4 dummy lights, (1015 non existent lights) switched between the ON’s and OFF’s to give sub 1 sec pause between them. I plan on moving that MH202 work around to better pause timing control from openhab.

Screen 10 button

==> /var/log/openhab2/openhab.log <==

2019-01-30 20:28:55.324 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *15*00*56##

2019-01-30 20:28:55.343 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=15.56

2019-01-30 20:28:55.346 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== handleMessage() for thing: openwebnet:bus_cen_scenario_control:Screen10:56

2019-01-30 20:28:55.350 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== updateButtonState() for thing: openwebnet:bus_cen_scenario_control:Screen10:56

2019-01-30 20:28:55.686 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *1*0*13##

2019-01-30 20:28:55.690 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=1.13

2019-01-30 20:28:55.694 [DEBUG] [et.handler.OpenWebNetLightingHandler] - ==OWN:LightingHandler== updateLightState() for thing: openwebnet:bus_on_off_switch:Screen10:13

==> /var/log/openhab2/events.log <==

2019-01-30 20:28:55.708 [vent.ItemStateChangedEvent] - WestPIRLights_Switch changed from ON to OFF

But executing the same CEN 56 from my Atmyhome phone app I dont see it but do see the resultant CEN actions

==> /var/log/openhab2/openhab.log <==

2019-01-30 20:37:14.059 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *25*21#24*210##

2019-01-30 20:37:14.064 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=25.210

2019-01-30 20:37:14.068 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=25.210 has NO DEVICE associated, ignoring it

2019-01-30 20:37:14.410 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *1*0*13##

2019-01-30 20:37:14.415 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=1.13

2019-01-30 20:37:14.418 [DEBUG] [et.handler.OpenWebNetLightingHandler] - ==OWN:LightingHandler== updateLightState() for thing: openwebnet:bus_on_off_switch:Screen10:13

==> /var/log/openhab2/events.log <==

2019-01-30 20:37:14.429 [vent.ItemStateChangedEvent] - WestPIRLights_Switch changed from ON to OFF

Now for Paper UI I see the item (Debug mode off)

2019-01-30 21:20:33.256 [ome.event.ItemCommandEvent] - Item 'WestPIRLights4hrs_CEN' received command PRESSED

2019-01-30 21:20:33.280 [nt.ItemStatePredictedEvent] - WestPIRLights4hrs_CEN predicted to become PRESSED

==> /var/log/openhab2/openhab.log <==

2019-01-30 21:20:33.286 [INFO ] [g.openwebnet.bus.MyHomeJavaConnector] - COM SENDING   ============>>>>>>>>>>>> *15*00*56##

2019-01-30 21:20:33.291 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - ##gw-openwebnet-socket## Trying openCommandSession() socket....  (192.168.1.41:20000)

==> /var/log/openhab2/events.log <==

2019-01-30 21:20:33.298 [vent.ItemStateChangedEvent] - WestPIRLights4hrs_CEN changed from NULL to PRESSED

==> /var/log/openhab2/openhab.log <==

2019-01-30 21:20:33.307 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - ##gw-openwebnet-socket## ... CONNECTED command session 192.168.1.41:20000

2019-01-30 21:20:33.312 [INFO ] [g.openwebnet.bus.MyHomeJavaConnector] - COM SENDING   ============>>>>>>>>>>>> *15*00*56##

2019-01-30 21:20:33.344 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *15*00*56##

2019-01-30 21:20:33.344 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - COM RECEIVED  <<<<<<<<<<<<============ *#*1##

2019-01-30 21:20:33.714 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *1*0*13##

2019-01-30 21:20:33.853 [INFO ] [g.openwebnet.bus.MyHomeJavaConnector] - COM SENDING   ============>>>>>>>>>>>> *15*00#1*56##

2019-01-30 21:20:33.893 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *15*00#1*56##

2019-01-30 21:20:33.893 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - COM RECEIVED  <<<<<<<<<<<<============ *#*1##

==> /var/log/openhab2/events.log <==

2019-01-30 21:20:34.110 [vent.ItemStateChangedEvent] - WestPIRLights4hrs_CEN changed from PRESSED to RELEASED

==> /var/log/openhab2/openhab.log <==

2019-01-30 21:20:34.379 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *1*1*13##

==> /var/log/openhab2/events.log <==

2019-01-30 21:20:34.393 [vent.ItemStateChangedEvent] - WestPIRLights_Switch changed from OFF to ON

Debug mode on

2019-01-30 21:25:44.037 [DEBUG] [ebnet.handler.OpenWebNetThingHandler] - ==OWN:ThingHandler== handleCommand() (command=PRESSED - channel=openwebnet:bus_cen_scenario_control:Screen10:56:button_0)

2019-01-30 21:25:44.043 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== handleChannelCommand() (command=PRESSED)

2019-01-30 21:25:44.047 [INFO ] [g.openwebnet.bus.MyHomeJavaConnector] - COM SENDING   ============>>>>>>>>>>>> *15*00*56##

2019-01-30 21:25:44.050 [DEBUG] [g.openwebnet.bus.MyHomeSocketFactory] - ##gw-openwebnet-socket## CANNOT read from socket: read returned -1

==> /var/log/openhab2/events.log <==

2019-01-30 21:25:44.062 [vent.ItemStateChangedEvent] - WestPIRLights4hrs_CEN changed from RELEASED to PRESSED

==> /var/log/openhab2/openhab.log <==

2019-01-30 21:25:44.065 [DEBUG] [g.openwebnet.bus.MyHomeJavaConnector] - ##gw-openwebnet-connector## read returned -1

2019-01-30 21:25:44.068 [DEBUG] [g.openwebnet.bus.MyHomeJavaConnector] - ##gw-openwebnet-connector## let's try with a NEW SESSION...

2019-01-30 21:25:44.072 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - ##gw-openwebnet-socket## Trying openCommandSession() socket....  (192.168.1.41:20000)



2019-01-30 21:25:44.101 [INFO ] [g.openwebnet.bus.MyHomeJavaConnector] - COM SENDING   ============>>>>>>>>>>>> *15*00*56##

2019-01-30 21:25:44.130 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - COM RECEIVED  <<<<<<<<<<<<============ *#*1##

2019-01-30 21:25:44.133 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *15*00*56##

2019-01-30 21:25:44.136 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=15.56

2019-01-30 21:25:44.139 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== handleMessage() for thing: openwebnet:bus_cen_scenario_control:Screen10:56

2019-01-30 21:25:44.141 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== updateButtonState() for thing: openwebnet:bus_cen_scenario_control:Screen10:56

2019-01-30 21:25:44.503 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *1*0*13##

2019-01-30 21:25:44.506 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=1.13

2019-01-30 21:25:44.508 [DEBUG] [et.handler.OpenWebNetLightingHandler] - ==OWN:LightingHandler== updateLightState() for thing: openwebnet:bus_on_off_switch:Screen10:13

==> /var/log/openhab2/events.log <==

2019-01-30 21:25:44.521 [vent.ItemStateChangedEvent] - WestPIRLights_Switch changed from ON to OFF

==> /var/log/openhab2/openhab.log <==

2019-01-30 21:25:44.632 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== # 56 sending CEN virtual release...

2019-01-30 21:25:44.635 [INFO ] [g.openwebnet.bus.MyHomeJavaConnector] - COM SENDING   ============>>>>>>>>>>>> *15*00#1*56##

2019-01-30 21:25:44.679 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - COM RECEIVED  <<<<<<<<<<<<============ *#*1##

2019-01-30 21:25:44.680 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *15*00#1*56##

2019-01-30 21:25:44.683 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=15.56

2019-01-30 21:25:44.685 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== handleMessage() for thing: openwebnet:bus_cen_scenario_control:Screen10:56

2019-01-30 21:25:44.687 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== updateButtonState() for thing: openwebnet:bus_cen_scenario_control:Screen10:56

2019-01-30 21:25:44.889 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== # 56 updating state to 'RELEASED'...

==> /var/log/openhab2/events.log <==

2019-01-30 21:25:44.901 [vent.ItemStateChangedEvent] - WestPIRLights4hrs_CEN changed from PRESSED to RELEASED

==> /var/log/openhab2/openhab.log <==

2019-01-30 21:25:45.183 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *1*1*13##

2019-01-30 21:25:45.187 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=1.13

2019-01-30 21:25:45.191 [DEBUG] [et.handler.OpenWebNetLightingHandler] - ==OWN:LightingHandler== updateLightState() for thing: openwebnet:bus_on_off_switch:Screen10:13

==> /var/log/openhab2/events.log <==

2019-01-30 21:25:45.205 [vent.ItemStateChangedEvent] - WestPIRLights_Switch changed from OFF to ON

==> /var/log/openhab2/openhab.log <==

2019-01-30 21:25:45.816 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *1*0*13##

2019-01-30 21:25:45.820 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=1.13

2019-01-30 21:25:45.823 [DEBUG] [et.handler.OpenWebNetLightingHandler] - ==OWN:LightingHandler== updateLightState() for thing: openwebnet:bus_on_off_switch:Screen10:13

==> /var/log/openhab2/events.log <==

2019-01-30 21:25:45.837 [vent.ItemStateChangedEvent] - WestPIRLights_Switch changed from ON to OFF

It tried again from my phone and again saw this

2019-01-30 20:49:57.732 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *25*21#24*210##

2019-01-30 20:49:57.737 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=25.210

2019-01-30 20:49:57.741 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=25.210 has NO DEVICE associated, ignoring it

Hallo Mark,
In your log I see *15*00*56## but it’s a CEN, while from your app. code *25*21#24*210## is a CEN+

Oh yeah… I forgot I used both and IR. Well spotted. I think its time for me to get some sleep :slight_smile:

Hallo Stefan,
I tried with some tests, but I can not reproduce the problem.
In the animation, last part, I used the app. openHAB

good morning michele,

yes i know that the same settings do work for you, but sorry they don´t work for me - as you can see in my attached logs.

cen+ is working well but cen doesn´t :frowning_face:

best stefan

Hi @bastler
actually when in CEN you press a physical button with a short pressure (<0.5sec) you should see on the OWN client log something like:
MON RECEIVED <<<<<<<<<<<<<< *15*01*71#4#01## (I call it CEN_PRESSURE)
and then after:
MON RECEIVED <<<<<<<<<<<<<< *15*01#1*71#4#01## (I call it CEN_RELEASE_SHORT_PRESSURE)
—> Could you test it with a CEN physical button + OWN client? Do the two frames appear when you shortly press a physical button configured for CEN ?

Moreover, apparently this rule is not followed when you activate the CEN on the TouchScreen/domotica-app : in this case in the logs you have only the first message and not the second one. This breaks the current logic of the binding: which is to update the channel only after we are sure whether it is a short pressure or long pressure.

Also looking at this compatibility table at page 24 of the OWN specs , it seems that CEN are not completely supported by some versions of TouchScreens.
Which touchscreen is yours and which firmware version?
M

@massi
yes this is correct, if i activate from paperui or a physical button i have both lines in the log like:
paperui

but if i send command from touchscreen h4890 (firmware 4.0.15, hardware 2.0.0, pic 14.49.2) or from multimedia touchscreen mh4893 (firmware 2.1.30, hardware 2.1.30) the second line is missing.

strange because scenarios in mh200n i can start from everywhere.

so basically this is the explanation:
TS 3.5" (H4890), TS 10" MH4893 and Domotica app apparently are not able to support long pressure on CEN, and therefore they are not sending the second event (RELEASE_SHORT_PRESSURE, *15*N#1*where##).
I consider it almost a bug of BTicino, but since this is already declared in the specs document as a limitation (at least for TS3,5" and TS10", for Domotica app this is basically a bug), I will make a workaround in the binding to support also these devices so that CEN events triggered from these devices/app have the same behavior has the physical buttons.

Not strange: maybe MH202N is just listening for the first CEN PRESSURE event (without waiting to understand if it’s short or long pressure) and then triggers the scenario.

Massi

Massimo,
I sent you an invitation, I hope I did well.
I solved part of Stefan’s problem

I created a new issue for this:

I have been trying to do some more testing on the S10. All my S10 buttons are CEN. Does anyone use CENplus on the S10 panel? The option is there when setting up a button but CENplus doesn’t seem to work for me.

Some more observations.

I created some rules. The trigger ‘when changed’ didn’t work but ‘when received update’ does. The rule initiates an Alexa voice announcement telling me over my Echo’s what the state is after the rule triggers and again a short while later.

CENplus from PaperUI
Pressed. Works but the release is very fast and Alexa is too late to catch ‘pressed’. I just hear ‘released’
Pressed_Ext. Alexa announces the change but there was no automatic ‘release’. Manually released from PaperUI.

CENplus from physical switch
Pressed. Works but release is also too fast for Alexa to catch ‘pressed’. I just hear ‘released’

CENplus from S10
Can’t get it to work on the BUS. MH202 scenarios are not triggered. Did it ever work?

CENplus from phone
No item state change detected and No device assoicated error

2019-02-02 17:01:43.090 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *25*21#24*210##

2019-02-02 17:01:43.096 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=25.210

2019-02-02 17:01:43.099 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=25.210 has NO DEVICE associated, ignoring it

2019-02-02 17:01:43.403 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *1*0*13##

2019-02-02 17:01:43.408 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=1.13

2019-02-02 17:01:43.412 [DEBUG] [et.handler.OpenWebNetLightingHandler] - ==OWN:LightingHandler== updateLightState() for thing: openwebnet:bus_on_off_switch:Screen10:13

==> /var/log/openhab2/events.log <==

<<<<<<<<<<<<< Scenario did run. Expected switch changed state >>>>>>>>>>>>>>>>
2019-02-02 17:01:43.428 [vent.ItemStateChangedEvent] - WestPIRLights_Switch changed from ON to OFF

CEN from paperUI
Works but release is too fast for my Alexa Rule to catch ‘pressed’. I just hear ‘released’

CEN from S10
Item didn’t update but Thing did

2019-02-02 17:05:39.132 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *15*00*56##

2019-02-02 17:05:39.136 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=15.56

2019-02-02 17:05:39.140 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== handleMessage() for thing: openwebnet:bus_cen_scenario_control:Screen10:56

2019-02-02 17:05:39.142 [DEBUG] [et.handler.OpenWebNetScenarioHandler] - ==OWN:ScenarioHandler== updateButtonState() for thing: openwebnet:bus_cen_scenario_control:Screen10:56

2019-02-02 17:05:39.478 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *1*0*13##

2019-02-02 17:05:39.482 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=1.13

2019-02-02 17:05:39.486 [DEBUG] [et.handler.OpenWebNetLightingHandler] - ==OWN:LightingHandler== updateLightState() for thing: openwebnet:bus_on_off_switch:Screen10:13

==> /var/log/openhab2/events.log <==

<<<<<<<<<<<<< Scenario did run. Expected switch changed state >>>>>>>>>>>>>>>>
2019-02-02 17:05:39.499 [vent.ItemStateChangedEvent] - WestPIRLights_Switch changed from ON to OFF

CEN from physical switch
I don’t have any set up that way :slight_smile:

Items file

//CEN
String WestPIRLights4hrs_CEN "CEN West PIR lights 4hrs"  <light> {channel="openwebnet:bus_cen_scenario_control:Screen10:56:button_0" }

//CEN plus. Addresses start with 2 + number 0-2047
String NightLights_CENplus "CENplus Night light"  <light> {channel="openwebnet:bus_cenplus_scenario_control:Screen10:23:button_1" } 
String WestPIR4hrs_CENplus "CEN plus West PIR 4hrs - phone"  <light> {channel="openwebnet:bus_cenplus_scenario_control:Screen10:24:button_1" }  

Thing file

//CEN
Thing bus_cen_scenario_control 56 "CEN West PIR lights 4hrs" @ "CEN"[ where ="56", buttons ="0" ]
//CEN plus. Addresses start with 2 + 0-2047
Thing bus_cenplus_scenario_control 23 "CENplus Night lights" @ "CEN" [ where ="23", buttons ="1" ]
Thing bus_cenplus_scenario_control 24 "CENplus West PIR 4hrs - phone" @ "CEN" [ where ="24", buttons ="1" ]

Rules file

rule "CEN S10 test"
when
    Item WestPIRLights4hrs_CEN received update //changed from RELEASED to PRESSED
then
  AlexaModeAnnouncement.postUpdate('Testing CEN from panel'+ WestPIRLights4hrs_CEN.state.toString)
  Thread::sleep(10000)
  AlexaModeAnnouncement.postUpdate(WestPIRLights4hrs_CEN.state.toString)
end

rule "CEN plus switch test"
when
    Item NightLights_CENplus received update //from RELEASED to PRESSED
then
  AlexaModeAnnouncement.postUpdate('Testing CEN plus from switch' + NightLights_CENplus.state.toString)
  Thread::sleep(10000)
  AlexaModeAnnouncement.postUpdate(NightLights_CENplus.state.toString)
end

rule "CEN plus phone test"
when
    Item WestPIR4hrs_CENplus received update //from RELEASED to PRESSED
then
  AlexaModeAnnouncement.postUpdate('Testing CEN plus from phone ' + WestPIR4hrs_CENplus.state.toString)
  Thread::sleep(10000)
  AlexaModeAnnouncement.postUpdate(WestPIR4hrs_CENplus.state.toString)
end

image

i, i have created a new scenario, that poweron amplifier of audio diffusion. I have configurated this scenario for start whit:
CEN A:8 PL: 1 BUTTON: 0
How i can create a item for simulate the pression of this button? I don’t understand, can you help me?