- Code: Select all
-- note: depends on nightly enablment of FishLightActive variable
tell application "Indigo"
if daylight then
log "Andrews motion during daylight"
remove delayed actions for device "Andrews Light"
remove delayed actions for device "Andrews Closet"
all off F in 10 * 60
else -- it is nighttime
if (FishLitTime <= 120) then
if (FishLightActive = true) then
if (on state of device "Andrews Fish Light" is false) then
log "Turning on Andrews Fish Light"
turn on "Andrews Fish Light" for 10 * 60
set value of variable "FishLitTime" to "FishLitTime" + 10
remove delayed actions for trigger "Andrews Motion"
set value of variable "FishLightActive" to False
set value of variable "FishLightActive" to True in 8 * 60
else -- fish light is already on
log "Leaving Andrews Fish Light on additional 10 min's"
remove delayed actions for device "Andrews Fish Light"
turn off "Andrews Fish Light" in 10 * 60
set "FishLitTime" to FishLitTime + 8
remove delayed actions for trigger "Andrews Motion"
set value of variable "FishLightActive" to False
set value of variable "FishLightActive" to True in 8 * 60
end if -- state of fish light
remove delayed actions for device "Andrews Light"
dim "Andrews Light" by 15 in 35 * 60
turn off "Andrews Light" in 40 * 60
else -- FishLitTime has reached daily limit
set value of variable "FishLightActive" to False
set value of variable "FishLitTime" to 0
log "Andrews fishlight has reached limit - disabling until next night"
end if -- Fishlight Active
end if -- FishLitTime
end if -- daylight
end tell
But now I'm getting the following error "Can't get true in 8. Access not allowed." on the following line:
set value of variable "FishLightActive" to True in 8 * 60