Using Conditions

When creating Trigger Actions or Time/Date Actions, you have the option to add a condition that will further decide if you want the actions to occur.

Condition: Always

Simple enough: the condition will always allow the actions to execute. This is the default condition.

Condition: If dark (before sunrise, after sunset)

These use Indigo's built-in sunrise and sunset calculations to ensure that the actions will only be executed when it is dark outside. For instance, if you have a motion sensor linked to a porch light - you probably only want the light to come on when it's dark outside.

Condition: If daylight (after sunrise, before sunset)

The opposite of the above condition.

Condition: If variable is true

If the value of the selected variable is "true" (no quotes), the actions will execute.

Condition: If variable is false

If the value of the selected variable is "false" (no quotes), the actions will execute.

Condition: If variable equals

If the value of the selected variable is equal to the value typed into the box, the actions will execute.

Condition: If variable not equal to

If the value of the selected variable is not equal to the value typed into the box, the actions will execute.

Condition: If variable greater than

If the value of the selected variable is greater to the value typed into the box, the actions will execute. Obviously, this assumes that the value contained in the variable is a number - if it is not a number, the condition will always fail and the action will not run.

Condition: If variable less than

If the value of the selected variable is less than the value typed into the box, the actions will execute. This one also assumes that the value contained in the variable is a number - if it is not a number, the condition will always fail and the action will not run.

Condition: If script returns true (Pro only feature)

If this option is selected, the AppleScript that's typed into the text field below it will be executed. If the script returns a valid AppleScript true result, then the actions will be executed. Note: the Compile and Test button will attempt to determine if the script will return a valid boolean value, but since a script may have many complex paths, every case can't be exercised. If the script returns a value that can't be (somewhat) safely coerced into a boolean value, then it will fail, the actions will not execute, and an error will show in the Indigo Log. It's up to you to ensure that your script returns a valid boolean value.