If, Then, Else?

What would be the best way to code an if, then, else statement in PLEG?

Currently, I have a condition where when the housekeeper enters a code on my door, all of the lights turn on for 2 hours and then I get a notification.

I have another PLEG that says if all of our phones are gone and it is a “summer day” (tracking the high temp), set the thermostats in the house at 85.

I’d like to have PLEG check IF the Housekeeper code is entered and it is summer and we are all gone, turn on the AC for them for 2 hours, ELSE “don’t change anything” with the thermostats.

It is just a matter of setting up the conditions such that only the ones you want go true.

So one of your first conditions (closer to the top of the condition list) would be the IF, its action would be the THEN, and you could have a subsequent condition (further down the list), that is just NOT (insert the name) of the IF condition…

For UI7 users, the Next Gen version allows the user to define actions for when the condition (OR ANY INPUT) is true as well as a different set of actions when the condition (OR ANY INPUT) is false.

So you no longer need to create a Condition that is the NOT of an existing condition.

Sorry, I should have noted that I’m on UI5 for Vera Lite.

If I understand you correctly, I create single conditions that are “true” (housekeeper entered code, summer day, everyone away) and just use the “and” statement to test if the conditions are all true?

similar to below?

Housekeeper entered code → send alert and turn on lights
Housekeeper code entered and summer day and all away → set AC temperatures

[quote=“Kmitchel, post:4, topic:192901”]Sorry, I should have noted that I’m on UI5 for Vera Lite.

If I understand you correctly, I create single conditions that are “true” (housekeeper entered code, summer day, everyone away) and just use the “and” statement to test if the conditions are all true?

similar to below?

Housekeeper entered code → send alert and turn on lights
Housekeeper code entered and summer day and all away → set AC temperatures[/quote]

Yep!