| Using Variables |
Indigo Variables provide an easy way to create complex conditional logic and quickly view the status of your home control system. Create a new Variable whenever you need Indigo to keep track of the state, or value, of part of your system. For example, you could create a Variable that keeps track of the number of times a motion detector is triggered. Or you could use a variable to keep track of the state of your home, such as, "away", "in bed", "asleep".
Indigo creates an internal Variable to keep track of sunset and sunrise states, called isDaylight. Because isDaylight is an Indigo created variable, it can be viewed but not edited or deleted.
Creating a Variable
You can leave the Variable List window visible while running Indigo. By using Variables to keep track of critical states of your home control system, you can quickly see the state of your home simply by looking at the Variable List window.
Organizing Variables
Variables may be organized into folders, as shown in the following figure:

To create a new folder, click on the + button at the bottom left corner of the Variable List and give it a name (you may have folders only one level deep - nested folders aren't supported). Folders are indicated in the list by a disclosure triangle next to the name. To move a variable to a folder just drag it onto the folder name. Use the - button at the lower left to delete a folder. If the folder isn't empty, you'll be promted with options for moving the variables in the folder or deleting them with the folder.
You'll also notice a column called Remote Display. This column, like those in the Home Window list views, indicates whether the variable or variable folder will be displayed in remote UIs, such as (Indigo Touch and Web control pages. If a folder is not displayed in remote UIs, then none of the variables in it will be displayed regardless of the state of the Remote Display checkbox for that variable.
Tip: you can reorder the table columns by clicking and dragging the column header.
Note: variables in grey text (isDaylight in the above example) are read-only variables - nothing about these variables may be changed and they may not be moved into a folder.
Using Variables to Trigger Actions
Once a Variable has been created you can Trigger Actions whenever its state (or value) changes. To do this create a Trigger Action and select the Type Variable Changed.

Using Variables as Conditionals
Use the Condition panel inside the Trigger Action or Time/Date Action dialogs to use a Variable state (or value) as a conditional before an Action is executed.

Modifying Variable Values in Actions
The Modify Variable Action Type can be selected from any of the Action panels (Trigger Action, Time/Date Action, Action Group) to modify the state (or value) of a Variable. You can set the value of the Variable, increment it by 1, or decrement it by 1.

Accessing Variable Values from AppleScript
Indigo Variable values can be accessed and modified from AppleScript. Note that Indigo Variables are not the same as AppleScript variables. To access or modify an Indigo Variable use the AppleScript DOM notation "value of variable." Note both the Variable name and its value should always be in quotes (or AppleScript strings). For example, here the Indigo Variable houseMode has its value compared to the string "away":
if value of variable "houseMode" is "away" then log "no one home!"
And here the value of Indigo Variable houseMode is set to the string "asleep":
set value of variable "houseMode" to "asleep"