The script is pretty simple:
I disabled a lot of stuff in there, as it is mostly experimental at the moment.
I just run that script once every 10 minutes.
--Dan
Code:
Sub pollHVACDevices(ByVal par as object) Dim waitTime = 25 Dim myHighTemp = 78 Dim pi As Object Dim tempLoft As String Dim tempFurnace As String Dim acUnit = hs.GetDeviceCode("HVAC Air Conditioner") Dim furnaceTherm = hs.GetDeviceCode("HVAC Furnace Thermostat") Dim floaterTherm = hs.GetDeviceCode("HVAC Floater Thermostat") Dim floater = 2 Dim furnace = 1 'open is 2; 3 is closed ' [URL]http://192.168.0.2:9000/Developer/WebHelp/HomeSeer_Plug-In_SDK.htm#Thermostat_API/Set_Properties_or_Methods.htm[/URL] ' Mode: ' 0=Off, 1=Heat, 2=Cool, 3=Auto ' GetCurrentMode heating right now ' GetModeSet set for which mode now hs.execx10("Main HVAC PollStatus","ON") hs.polldevice(floaterTherm) hs.waitsecs(waitTime) hs.polldevice(furnaceTherm) hs.execx10("Main HVAC PollStatus","OFF") ' removed for winter ' hs.waitsecs(waitTime) ' hs.polldevice(acUnit) Try pi = hs.Plugin("ZWave Thermostats") tempFurnace = math.truncate(pi.GetTemp(1)) tempLoft = math.truncate(pi.GetTemp(2)) ' if(hs.devicestatus("[15") = 3) then ' if(tempLoft > myHighTemp) then ' ' if the AC has been off for it's cooldown period (5 min) then ' ' turn it on if the loft's temp is greater than the set point of myTempHigh ' if(lastChangeGreaterThanMinutes(acUnit & "|5") and hs.isoff(acUnit)) then '' hs.execx10(acUnit,"ON") ' end if ' end if ' end if ' if(hs.devicestatus("[15") = 2) then ' hs.execx10("Q20","OFF") ' end if 'need to figure out better method to check this... ' 0=Off, 1=Heat, 2=Cool, 3=Auto ' if(hs.devicestatus("[15") = 3) then '' 'if(lastChangeGreaterThanMinutes(furnaceTherm & "|59")) then '' 'if(tempLoft > (tempFurnace + 1) AND tempFurnace > pi.GetHeatSet(furnace)) then '' ' if mode off and not heating '' if(pi.GetModeSet(furnace)=0 AND pi.GetOperating(furnace)=0) then '' ' turn the blower ON '' pi.CmdSetMode(furnace,2) '' hs.writelog("HVAC","Turning Blower ON!") '' else '' ' otherwise turn the blower off '' pi.CmdSetMode(furnace,0) '' hs.writelog("HVAC","Turning Blower OFF!") '' end if '' 'end if '' 'end if ' end if ''''hs.WriteLog("debug", pi.GetHeatSet(furnace)) Catch e As Exception hs.WriteLog("debug", e.Message) Finally pi = Nothing End Try End Sub
I just run that script once every 10 minutes.
--Dan
Comment