Announcement

Collapse
No announcement yet.

Combine Status values for multipe devices

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

    Combine Status values for multipe devices

    I would like to have a device "A1" with a status value equal to all of the devices in Room1, Floor2.
    Does anyone know how I might do that filter? Worst case, I can work with a script that queries each device i specify and appends the value to A1.

    Here is what I'm trying to accomplish:
    A general status for all of Room1, Floor2 that lists all of the status from each device in Room1, Floor2 that are NOT "off"

    I have HStouch setup with buttons that change the status of a device from off to "I need XYZ"
    There might be several in a "Room" so I would like a text box that queries the status of A1 to get the list of all devices in room 1, Floor2 that have status(s) not equal to Off.

    Make sense?

    #2
    Apparently this is more complicated than I thought?

    Comment


      #3
      I dont know how you could do that with device value, but in a device string, you can store the individual values with some name/value pairs delimited with a comma:

      hs.setDeviceString("A1","Floor1=OFF,Floor2=OFF,Floor3=OFF")

      You would then need a script to parse the values.

      Since you're using HSTouch, you might just consider using hidden text fields that are populated with the values that you need, then just use those values for the elements.

      If I were doing it, I would probably opt for a script though...
      HS4Pro on a Raspberry Pi4
      54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
      Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

      HSTouch Clients: 1 Android

      Comment


        #4
        You could loop through all of the HS devices using the hs.getdeviceenumrator (there is a looping example in the help file), when you loop through everything you could then check via the device class whether the device belonged to the room/floor you were after. If the device did then you could query it for its status (on/off) and append that info to the string of another device.

        One of the problems I can see is that i'm sure HSTouch removes HTML from the device string (would need to double check this) when you status track it so you would just end up with a funny string of letters that were difficult to understand (no breaks/tables).

        Comment


          #5
          let me step back a bit and figure this part out then:
          I have two listboxes in HStouch. When you select the option in the second listbox, it runs a script that passes what you picked in list box 1 and list box 2 ( as seperate parameters) when then I use this script to merge them into 1 and set it as the status of the device T1
          ----code----
          Sub Main(choice)

          hs.SetDeviceString "T1", choice, True

          End Sub
          ----code---
          How ever, my results looks like "listbox1choice*Listbox1choice[funny ASCII character]listbox2choice*listbox2choice"

          I must need to split the array that is sent to the script and not use "choice" but what?

          Comment

          Working...
          X