walkman9999 Posted March 17 Posted March 17 Am I writing this correctly? My intention is to trigger THEN if either of the /Main House/Sensors are tripped AND the $Gates_ProgON is 0. I wasn't sure if I needed the parenthesis around the separate pairs of conditions with an OR in between or not. North Gate OPEN - [ID 0019][Parent 0031] If 'Main House / Sensors / North Gate' is switched On And $Gates_ProgON is 0 Or 'Main House / Sensors / ZY 033 North_Gate' Access Control is Window/door is open And $Gates_ProgON is 0 Then $North_Gate_Open = 1 Run Program '_North Gate' (If) Else - No Actions - (To add one, press 'Action') Quote
lgilsenberg Posted March 17 Posted March 17 I would likely write it like this just for clarity North Gate OPEN - [ID 0019][Parent 0031] If ( 'Main House / Sensors / North Gate' is switched On Or 'Main House / Sensors / ZY 033 North_Gate' Access Control is Window/door is open ) And $Gates_ProgON is 0 Then $North_Gate_Open = 1 Run Program '_North Gate' (If) Else - No Actions - (To add one, press 'Action') Quote
Guy Lavoie Posted March 17 Posted March 17 7 minutes ago, lgilsenberg said: I would likely write it like this just for clarity North Gate OPEN - [ID 0019][Parent 0031] If ( 'Main House / Sensors / North Gate' is switched On Or 'Main House / Sensors / ZY 033 North_Gate' Access Control is Window/door is open ) And $Gates_ProgON is 0 Then $North_Gate_Open = 1 Run Program '_North Gate' (If) Else - No Actions - (To add one, press 'Action') That's the better, more predictable way of doing it. Quote
Goose66 Posted March 17 Posted March 17 Not that it matters here since you have no Else statements, but be aware that this program will also run every time the Gates_ProgON variable is changed. Quote
walkman9999 Posted March 17 Author Posted March 17 Thanks for the insight. Right now, Gates_ProgON can be fired with a second gate. That program has a different Then action. Should I create individual variables for each program, or is there a way to write the statements in each program so they do not fire each other off. (The second gate program is identical, using different sensors.) Also, can I import the updated text into EISY, or do I have to recreate it using the UI? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.