Announcement

Collapse
No announcement yet.

Ranged values with 1 "status" and get device string in script

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

    Ranged values with 1 "status" and get device string in script

    Is there a way to set up a range of values that have 1 status and then get that device string through script?

    For instance say I have a device with 1 through 33 which is low, 34 through 36 which is medium, and 67 though 100 which is high.

    I have done this by creating a new Range Value and setting the "prefix" to the status I want and telling to not include the values. I also set this range as status only. This works for the display screen, but I want to access this "status" from scripting. I tried hs.deviceString, but it doesn't return the status only an empty string. Is there a way to easily do this without having to get the value in script and then check it against hard coded ranges (is x >= lowPoint and x<= highPoint)?

    #2
    Ok, so I figured this out. You can use hs.CAPIGetStatus to get it.

    Note that CAPIGetStatus returns an iCAPIStatus object, that is why I have Status() (which is a property of that returned object).

    Thanks to @Sparkman (Al) for helping me with this

    Code:
    Sub Main(ByVal Parms As String)
    	Dim ParmArray() As String = Parms.tostring.split(",")
    	hs.SetDeviceValueByRef( 660 , 360 , true )
    	hs.WriteLog( "Info" , "Franks location: " + hs.CAPIGetStatus(1982).Status() )
    end sub

    Comment


      #3
      Yes...use hs.capigetstatus http://www.homeseer.com/support/home...igetstatus.htm, try this

      hs.writelog("", hs.CAPIGetStatus(61).Status)

      Replacing 61 with your device reference.

      Comment

      Working...
      X