I am doing something wrong in the logic because this does not work. Here is the dump of the logic, please help.
*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
Version: 3.4 config 19226 cdata 19082 ui 19237 pluginDevice 242
System: Vera version 1.7.4453 on Sercomm G450; loadtime 1576251124; systemReady 1576251231; Lua 5.1; JSON dkjson 1.2
House mode: plugin 1; system 1; tracking off
Sun data:
Geofence: not running
====================================================================================================================================
Bedroom wall trigger (#259)
Version 19082.39 11/22/19 15:58:17
Message/status: Not tripped
Variable/expressions
0: SwitchState getstate( 264, "urn:upnp-org:serviceId:SwitchPower1", "Status" ) [last "0"(string)]
1: AppModuleState getstate( 107, "urn:upnp-org:serviceId:SwitchPower1", "Status" ) [last "0"(string)]
Condition group "Bedroomwallswitch" (AND) false as of 11-25.20:34:19 <root>
&-F-service Bedroom Wall Switch (264) urn:upnp-org:serviceId:SwitchPower1/Status change [1 => 0 at 14:58:41; F/F as of 14:58:41/14:58:41] <condk3tmqp7>
&-F-group "AppModuleChanges" (AND) false as of 23:48:44 <grpkqvz48i>
| &-F-service Bedroom Lights (107) urn:upnp-org:serviceId:SwitchPower1/Status change [1 => 0 at 23:48:44; F/F as of 23:48:44/23:48:44] <condkqw1ptk>
Activity root.true
Device Bedroom Lights (107) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="{SwitchState}" )
Device Bedroom Wall Switch (264) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="{AppModuleState}" )
Events
12/13/19 09:33:46 reload: notice=Luup reload
12/13/19 09:33:46 start:
12/13/19 14:57:53 devicewatch: device=264, old="1", name=Bedroom Wall Switch, var=urn:upnp-org:serviceId:SwitchPower1/Status, new="0"
12/13/19 14:57:53 variable: oldval=1, variable=SwitchState, newval=0
12/13/19 14:57:53 condchange: newState=true, cond=condk3tmqp7, oldState=false
12/13/19 14:57:53 evalchange: newState=true, cond=condk3tmqp7, oldState=false
12/13/19 14:57:53 condchange: newState=false, cond=condk3tmqp7, oldState=true
12/13/19 14:57:53 evalchange: newState=false, cond=condk3tmqp7, oldState=true
12/13/19 14:58:03 devicewatch: device=264, old="0", name=Bedroom Wall Switch, var=urn:upnp-org:serviceId:SwitchPower1/Status, new="1"
12/13/19 14:58:03 variable: oldval=0, variable=SwitchState, newval=1
12/13/19 14:58:03 condchange: newState=true, cond=condk3tmqp7, oldState=false
12/13/19 14:58:03 evalchange: newState=true, cond=condk3tmqp7, oldState=false
12/13/19 14:58:03 condchange: newState=false, cond=condk3tmqp7, oldState=true
12/13/19 14:58:03 evalchange: newState=false, cond=condk3tmqp7, oldState=true
12/13/19 14:58:21 devicewatch: device=264, old="1", name=Bedroom Wall Switch, var=urn:upnp-org:serviceId:SwitchPower1/Status, new="0"
12/13/19 14:58:21 variable: oldval=1, variable=SwitchState, newval=0
12/13/19 14:58:21 condchange: newState=true, cond=condk3tmqp7, oldState=false
12/13/19 14:58:21 evalchange: newState=true, cond=condk3tmqp7, oldState=false
12/13/19 14:58:21 condchange: newState=false, cond=condk3tmqp7, oldState=true
12/13/19 14:58:21 evalchange: newState=false, cond=condk3tmqp7, oldState=true
12/13/19 14:58:36 devicewatch: device=264, old="0", name=Bedroom Wall Switch, var=urn:upnp-org:serviceId:SwitchPower1/Status, new="1"
12/13/19 14:58:36 variable: oldval=0, variable=SwitchState, newval=1
12/13/19 14:58:36 condchange: newState=true, cond=condk3tmqp7, oldState=false
12/13/19 14:58:36 evalchange: newState=true, cond=condk3tmqp7, oldState=false
12/13/19 14:58:36 condchange: newState=false, cond=condk3tmqp7, oldState=true
12/13/19 14:58:36 evalchange: newState=false, cond=condk3tmqp7, oldState=true
12/13/19 14:58:41 devicewatch: device=264, old="1", name=Bedroom Wall Switch, var=urn:upnp-org:serviceId:SwitchPower1/Status, new="0"
12/13/19 14:58:41 variable: oldval=1, variable=SwitchState, newval=0
12/13/19 14:58:41 condchange: newState=true, cond=condk3tmqp7, oldState=false
12/13/19 14:58:41 evalchange: newState=true, cond=condk3tmqp7, oldState=false
12/13/19 14:58:41 condchange: newState=false, cond=condk3tmqp7, oldState=true
12/13/19 14:58:41 evalchange: newState=false, cond=condk3tmqp7, oldState=true
Devices
ZWave (1) urn:schemas-micasaverde-com:device:ZWaveNetwork:1 (19/0); parent 0; plugin -
Bedroom Wall Switch (264) urn:schemas-upnp-org:device:BinaryLight:1 (3/3); parent 1; plugin -
Bedroom Lights (107) urn:schemas-upnp-org:device:BinaryLight:1 (3/3); parent 1; plugin -