I created this years ago (HS2 and XP at the time, still HS2 but Win 7 now) and at some point it stopped working and I just never got around to looking at it. The ini file is updating fine but I the on/off status for the cirtual device z95 is no longer changing. Any idea how to fix this?
'*********************************************************** *****************************
'
' The purpose of this script is to take the value stored in the HVAC.ini file
' add it to whatever value exists in HVAC.ini.
'
'*********************************************************** *****************************
sub main()
dim TotalTime
SoFarTime =hs.GetIniSetting("Downstairs","Minutes_Today",0,"HVAC.ini")
TempTime = hs.GetIniSetting("Downstairs","Minutes_This_Session",0,"HVAC .ini")
TotalTime= CDbl(SoFarTime) + CDbl(TempTime)
hs.SaveINISetting "Downstairs","Minutes_Today",TotalTime,"HVAC.ini"
hs.SaveINISetting "Downstairs","Minutes_This_Session",0,"HVAC.ini"
'*********************************************************** *****************************
' If the total time the fan has run is > 20000 minutes turn on the virtual
' device which to indicate the filter needs changing. at 8:00 each morning
' an email will be sent to me if this virtualdevice is set to on. If the fan
' runtime is <20000, and the virtual device is already ON then I have reset
' the ini file and the device should be turned off
'*********************************************************** *****************************
if CDbl(TotalTime)>20000 then
if hs.IsOff ("z95") then
hs.ExecX10 "z95","On",0
end if
end if
if CDbl(TotalTime)<20000 then
if hs.IsON ("z95") then
hs.ExecX10 "z95","Off",0
end if
end if
end sub
'*********************************************************** *****************************
'
' The purpose of this script is to take the value stored in the HVAC.ini file
' add it to whatever value exists in HVAC.ini.
'
'*********************************************************** *****************************
sub main()
dim TotalTime
SoFarTime =hs.GetIniSetting("Downstairs","Minutes_Today",0,"HVAC.ini")
TempTime = hs.GetIniSetting("Downstairs","Minutes_This_Session",0,"HVAC .ini")
TotalTime= CDbl(SoFarTime) + CDbl(TempTime)
hs.SaveINISetting "Downstairs","Minutes_Today",TotalTime,"HVAC.ini"
hs.SaveINISetting "Downstairs","Minutes_This_Session",0,"HVAC.ini"
'*********************************************************** *****************************
' If the total time the fan has run is > 20000 minutes turn on the virtual
' device which to indicate the filter needs changing. at 8:00 each morning
' an email will be sent to me if this virtualdevice is set to on. If the fan
' runtime is <20000, and the virtual device is already ON then I have reset
' the ini file and the device should be turned off
'*********************************************************** *****************************
if CDbl(TotalTime)>20000 then
if hs.IsOff ("z95") then
hs.ExecX10 "z95","On",0
end if
end if
if CDbl(TotalTime)<20000 then
if hs.IsON ("z95") then
hs.ExecX10 "z95","Off",0
end if
end if
end sub
Comment