Why doesn't multiple triggers with "OR" work in a condition?

Why won’t the following conditions fire when ANY door is opened or closed? I’m sure this is basic PLEG logic, but can’t get past it.

Conditions:
DoorsOpen No MBR_Door_Open OR KIT_Door_Open OR ENT_Front_Open OR GRG_Entry_Open true 2014-03-07 13:34:16.432 0
DoorsClosed No !MBR_Door_Open OR !KIT_Door_Open OR !ENT_Front_Open OR !GRG_Entry_Open true 2014-03-07 13:34:16.435 0

Triggers:
MBR_Door_Open MBR - Sliding Door Contact Sensor armed is tripped false 2014-03-07 13:48:47.888 2014-03-07 13:50:20.929
GRG_Entry_Open GRG - Inside Contact Sensor is tripped true 2014-03-07 12:20:23.005 2014-03-06 21:16:35.832
KIT_Door_Open KIT - Sliding Door Contact Sensor is tripped true 2014-03-07 10:54:12.677 2014-03-07 09:57:29.817
ENT_Front_Open ENT - Front Door Sensor is tripped false 2014-03-07 12:16:23.385 2014-03-07 12:16:28.245

Log:
50 03/07/14 13:50:20.928 luup_log:153: PLEG-153:TriggerPropertyUpdate:Tripped <0x2b821680>
50 03/07/14 13:50:20.929 luup_log:153: PLEG-153:TPU:Tripped :0=1 <0x2b821680>
50 03/07/14 13:50:20.929 luup_log:153: PLEG-153:TriggerPropertyUpdate:Name:MBR_Door_Open State:false Device:92 <0x2b821680>
50 03/07/14 13:50:20.930 luup_log:153: PLEG-153:EvalConditions:Multi Trigger:MBR_Door_Open <0x2b821680>
50 03/07/14 13:50:20.932 luup_log:153: PLEG-153:EvalConditions:Condition:BY_Alley_Gate_Open_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.933 luup_log:153: PLEG-153:EvalConditions:Condition:BY_Lawn_Gate_Open_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.936 luup_log:153: PLEG-153:EvalConditions:Condition:DBR_Left_Window_Open_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.954 luup_log:153: PLEG-153:EvalConditions:Condition:DBR_Right_Window_Open_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.955 luup_log:153: PLEG-153:EvalConditions:Condition:DHW_Crawl_Open_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.959 luup_log:153: PLEG-153:EvalConditions:Condition:MBA_Window_Open_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.961 luup_log:153: PLEG-153:EvalConditions:Condition:MBR_Door_Open_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.964 luup_log:153: PLEG-153:EvalConditions:Condition:UBR_Window_Open_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.967 luup_log:153: PLEG-153:EvalConditions:Condition:DR_Window_Open_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.970 luup_log:153: PLEG-153:EvalConditions:Condition:LR_Left_Window_Open_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.972 luup_log:153: PLEG-153:EvalConditions:Condition:LR_Right_Window_Open_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.975 luup_log:153: PLEG-153:EvalConditions:Condition:KIT_Door_Open_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.976 luup_log:153: PLEG-153:EvalConditions:Condition:Water_SE_Crawl_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.977 luup_log:153: PLEG-153:EvalConditions:Condition:Water_SW_Crawl_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.978 luup_log:153: PLEG-153:EvalConditions:Condition:Water_MBA_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.979 luup_log:153: PLEG-153:EvalConditions:Condition:Water_UBA_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.980 luup_log:153: PLEG-153:EvalConditions:Condition:Water_KIT_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.981 luup_log:153: PLEG-153:EvalConditions:Condition:Water_GRG_TTS Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.982 luup_log:153: PLEG-153:EvalConditions:Condition:PerimeterOn Trigger:MBR_Door_Open Result:false <0x2b821680>
50 03/07/14 13:50:20.983 luup_log:153: PLEG-153:EvalConditions:Condition:PerimeterOff Trigger:MBR_Door_Open Result:true <0x2b821680>
50 03/07/14 13:50:20.985 luup_log:153: PLEG-153:EvalConditions:Condition:DoorsOpen Trigger:MBR_Door_Open Result:true <0x2b821680>
50 03/07/14 13:50:20.989 luup_log:153: PLEG-153:EvalConditions:Condition:DoorsClosed Trigger:MBR_Door_Open Result:true <0x2b821680>

Did you check the “repeats” box for those conditions? if a door is always open and one always closed, it won’t work until they are all open or all closed.

Using the “Repeats” checkbox on the conditions will force it to re-evaluate everytime the condition becomes true, not just when it turns true from false.

[quote=“SirMeili, post:2, topic:180037”]Did you check the “repeats” box for those conditions? if a door is always open and one always closed, it won’t work until they are all open or all closed.

Using the “Repeats” checkbox on the conditions will force it to re-evaluate everytime the condition becomes true, not just when it turns true from false.[/quote]

To expand further on this, you can see in your status report that they were never false (0).

So, once all doors are closed, DoorsOpen will become false. The first door opened after that will cause this condition to become true. If you open another door it will NOT fire again because it was already true (as long as you kept the first door open). Using “Repeats” fixes this because when the next door opens, it sets the true TS again and the condion’s actions are fired again.

The same is for true the other condition DoorsClosed. Once all doors are opened, the first door closed will fire the actions. If you don’t use the “repeats” checkbox, it will not fire again until all doors are opened and one of the doors is closed.

When I checked repeats, it now fires multiple events (Open and Closed conditions) when opening one door…I would have expected one.

Hmmm… I guess that makes sense because when you open one door it updates DoorsOpen, and at the same time it re-evaluates DoorsClosed because something in the condition has changed and it’s still true.

Ok. Maybe RTS or someone more knowledgeable can chime in. Sorry my suggestion didn’t really help that much (and I was so confident that I finally “GOT” Pleg…LOL)

What do you want to achieve with this logic?

This is not mission critical. I would like the Start Trek sliding door “swoosh” noise to play any time any one of the 4 doors open. :wink: Another noise plays when it closes. A Luup action which tells my TTS software to play a wav file on each event.

I know that I can create 8 conditions (4 doors x 2 states)…but was trying to learn PLEG to understand why I’m getting stuck making this shortcut collapse in 2 conditions.

Like This

_PlaySwooshIn = (DoorAOpen OR DoorBOpen OR DoorCOpen OR DoorDOpen)

_PlaySwooshOut = (!DoorAOpen OR !DoorBOpen OR !DoorCOpen OR !DoorDOpen)

I think you are looking for the sound to be made regardless if the room is occupied and if any Door is opened/closed, yeah?

The challenge is to allow individual door triggers regardless of the state of other doors. Setting Repeats means that both conditions are likely to fire whenever any door state changes.

I would look for a way to use sequence expressions rather than Repeats. Something like:

DoorsClosed No (!MBR_Door_Open and (DoorsClosed; !MBR_DoorOpen)) OR (!KIT_Door_Open and (DoorsClosed; !KIT_DoorOpen)) OR …

Thanks Rex and SirMilli!

DoorsOpen
(MBR_Door_Open and (DoorsOpen; MBR_Door_Open)) OR (KIT_Door_Open and (DoorsOpen; KIT_Door_Open)) OR (GRG_Entry_Open and (DoorsOpen; GRG_Entry_Open)) OR (ENT_Front_Open and (DoorsOpen; ENT_Front_Open))

DoorsClosed
(!MBR_Door_Open and (DoorsClosed; !MBR_Door_Open)) OR (!KIT_Door_Open and (DoorsClosed; !KIT_Door_Open)) OR (!GRG_Entry_Open and (DoorsClosed; !GRG_Entry_Open)) OR (!ENT_Front_Open and (DoorsClosed; !ENT_Front_Open))

If it works, great. I would have expected:

DoorsOpen
(MBR_Door_Open and (DoorsOpen; MBR_Door_Open)) OR (KIT_Door_Open and (DoorsOpen; KIT_Door_Open)) OR (GRG_Entry_Open and (DoorsOpen; GRG_Entry_Open)) OR (ENT_Front_Open and (DoorsOpen; ENT_Front_Open))

updated :slight_smile: