I thought this may be simple but with my limited knowledge of AS it has me stumped.
What I'm after is to calculate the time our hot tub will arrive at 100 degrees
based on it's current temperature. It heats at a rate of 10 degrees an hour...slow I know.
- Code: Select all
tell application "IndigoServer"
set theTemp to (value of variable "wsTemp_HotTub" as integer)
set theTime to (100 - theTemp)
set theTime to (theTime * 6)
set the value of variable "HotTubReadyTime" to time string of ((date (value of variable "ClockTimeAmPm")) + (theTime * minutes))
end tell
So basically, I think, I just need to subtract the hot tub temperature from 100, then multiply by 6 and add that as minutes
to the current time and set the HotTubReadyTime variable to that.
Any help greatly appreciated!
Thanks,
Carl