No announcement yet.

Aborting poll issue

  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    The script is pretty simple:

    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
       ' 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.execx10("Main HVAC PollStatus","OFF")
    ' removed for winter
    '   hs.waitsecs(waitTime)
    '   hs.polldevice(acUnit) 
          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)
          pi = Nothing
       End Try   
    End Sub
    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.

    Tasker, to a person who does like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.


    • #17
      I seem to have been able to eliminate my problems with some adjustments to polling times and eliminating polling of some lighting devices. Not perfect but the errors have stopped except for some occasional ones.


      • #18
        One thing I have tried to do in my network is randomize my polling times for any non updating devices (I use a lot of Cooper switches so I do not have to poll those). This has resulted in my polls being fairly consistent and not having too many stomping issues.

        Example: If I want to poll every 5 minutes instead of using 300 seconds I use 286 or 308.