Not sure why the Applescript is not picking up the logic to test the state of a device. Seems to always trigger a false for the "on" state. I am assuming the last two insteon commands are from cleanup. The index on the device was 8. Any suggestions ?
Here is the applescript:
tell application "IndigoServer"
send insteon group instnTurnOn using name DeviceName
log "Send Insteon Command On"
delay 5.0
if (time date action ("_delayed_action_" & DeviceName) exists) then
delete time date action ("_delayed_action_" & DeviceName)
end if
if (on state of device DeviceName) = true then set the value of variable DeviceName to "true"
--GrowlDevice(DeviceName)
else
log "Attempt Restart"
send insteon group instnTurnOn using name DeviceName
delay 5.0
-- test to see if it is running for the second time
if (on state of device DeviceName) = true then
set the value of variable DeviceName to "true"
log "GrowlDevice Command next"
--GrowlDevice(DeviceName)
log "GrowlDevice Command should have sent"
else
log "Pump did not start on 2nd attempt"
set theMessage to (DeviceName & " did not start")
Growl(DeviceName, theMessage)
end if
end if
set theDelayName to ("_delayed_action_" & DeviceName)
set DelayAction to ("FeaturesOff(\"" & DeviceName & "\")")
--display dialog theDelayAction
CreateDelay(theDelayName, DelayTime, DelayAction, "Script")
end tell
end FeaturesOn
Here is the Log
2010-10-11 18:00:00 Time/Date Action Pond Pump Timer
2010-10-11 18:00:00 Script Send Insteon Command On
2010-10-11 18:00:05 Script Attempt Restart
2010-10-11 18:00:10 Script Pump did not start on 2nd attempt
2010-10-11 18:00:10 Time/Date Action Check Weather Conditions
2010-10-11 18:00:10 Sent INSTEON "PowerLinc Interface" on (group/scene

2010-10-11 18:00:10 Sent INSTEON "PowerLinc Interface" on (group/scene
