- Code: Select all
tell application "IndigoServer"
if the value of variable "Awake" is "true" and the value of variable "NightstandLight" is "0" then
dim device "Bedroom Upstairs Nightstand Light" to "100"
else
if the value of variable "Awake" is "true" and the value of variable "NightstandLight" is "100" then
dim "Bedroom Upstairs Nightstand Light" to "40"
else
if the value of variable "Awake" is "true" and the value of variable "NightstandLight" is "40" then
dim "Bedroom Upstairs Nightstand Light" to "100"
else
if the value of variable "Awake" is "false" and the value of variable "NightstandLight" is "0" then
dim "Bedroom Upstairs Nightstand Light" to "40"
else
if the value of variable "Awake" is "false" and the value of variable "NightstandLight" is "40" then
dim "Bedroom Upstairs Nightstand Light" to "100"
else
if the value of variable "Awake" is "true" and the value of variable "NightstandLight" is "off" then
dim "Bedroom Upstairs Nightstand Light" to "100"
end if
end if
end if
end if
end if
end if
end tell
Thanks,
Carl