Announcement

Collapse
No announcement yet.

Point in the right direction??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Point in the right direction??

    Hi Folks,

    Anyone tell me where I'm going wrong, no errors coming up but the script is not turning the device on and off? (Boiler A2)

    Cheers

    Code:
    Sub Main()
    dim temp
    dim Nsp
    dim Dsp
    dim Asp
    dim schedule
    dim overide
    dim boiler
    dim Nsb
    
    temp = hs.devicevalue(12)
    Nsp = hs.devicestring(20)
    Dsp = hs.devicestring(21)
    Asp = hs.devicestring(22)
    schedule = hs.devicevalue(8)
    overide = hs.devicevalue(23)
    Nsb = hs.devicevalue(19)
    boiler = hs.devicevalue(18)
    
    hs.writelog "Temp", temp
    hs.writelog "nsp", Nsp
    hs.writelog "Dsp", Dsp
    hs.writelog "Asp", Asp
    hs.writelog "Schedule", schedule
    hs.writelog "Overide", overide
    hs.writelog "boiler", boiler
    hs.writelog "Nsb", Nsb
    
    if overide = 100 & temp > Asp then
    hs.setdevicevalue "A2", 100
    
    hs.writelog "info", overide
    
    End if
    
    if overide = 1 & temp > Asp then
    hs.setdevicevalue "A2", 0
    End if
    
    If overide = 0 and schedule = 1 and temp < Asp then
    hs.setdevicevalue "A2", 100
    End if
    
    If overide = 0 and schedule = 1 and temp > Asp then
    hs.setdevicevalue "A2", 0
    End if
    
    If overide = 0 and schedule = 0 and Nsb = 100 and temp < Nsp then
    hs.setdevicevalue "A2", 100
    End if
    
    If overide = 0 and schedule = 0 and Nsb = 100 and temp > Nsp then
    hs.setdevicevalue "A2", 0
    End if
    
    If overide = 0 and schedule = 0 and Nsb = 0 and temp < Dsp then
    hs.setdevicevalue "A2", 100
    End if
    
    If overide = 0 and schedule = 0 and Nsb = 0 and temp > Dsp then
    hs.setdevicevalue "A2", 0
    
    End if
    
    
    End Sub

  • #2
    setDeviceValue doesn't turn on/off devices. You have to use CAPI for HS3 scripting. Search the board for CAPI and there are a couple of examples.
    -Rupp
    sigpic

    Comment


    • #3
      Here's the CAPI example.
      http://board.homeseer.com/showthread.php?t=161009
      -Rupp
      sigpic

      Comment


      • #4
        Thanks Rup,

        But makes absolutely no sense to me...

        I need to get studying!

        Comment

        Working...
        X