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