Announcement

Collapse
No announcement yet.

Scripting: Any way of getting a "label" not just a "value"?

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

  • Scripting: Any way of getting a "label" not just a "value"?

    Today, for example, I have an occupancy variable (as a device) that can have values 0 to 3. On the device page, labels appear such as Unoccupied or Probably Occupied.

    When I use scripting, however, I see now way to look up the label (e.g., "Unoccupied") given the value (e.g., 0).

    Ideas?

  • #2
    You can use hs.CAPIGetStatus(xxxx) where xxxx is the reference id of the device.
    HS 3.0.0.548: 1965 Devices 1146 Events
    Z-Wave 3.0.1.262: 122 Nodes on one Z-Net

    Comment


    • #3
      Full code:

      Code:
        Dim iRef As Integer = hs.GetDeviceRefByName("xxx")
        Dim CS As ICAPIStatus = hs.CAPIGetStatus(iRef)
        Dim sLabel As String = CS.Status

      Comment


      • #4
        Thanks much. Works great. I see that I can also get an image of the state. (PS: sparkman, just visited Calgary for the first time last week. It's a bit cold there!)

        Comment


        • #5
          Originally posted by tahl View Post
          Thanks much. Works great. I see that I can also get an image of the state. (PS: sparkman, just visited Calgary for the first time last week. It's a bit cold there!)
          Yes, it's been the coldest February in a long time. We've only had a day or two with normal seasonal temperatures and the rest have been well below.
          HS 3.0.0.548: 1965 Devices 1146 Events
          Z-Wave 3.0.1.262: 122 Nodes on one Z-Net

          Comment

          Working...
          X