Announcement

Collapse
No announcement yet.

CAPIControl Buttons ?

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

  • CAPIControl Buttons ?

    I have created devices that show up in the Device Management tab page with buttons and when the buttons are pressed I get an indication that they were pushed but how/where is the the code that gets executed? In HS2 we had functions like ButtonPressed() to deal with the code for the buttons. What do we use now? This is the code used to create buttons:

    Code:
                Pair = New VSPair(ePairStatusControl.Both)   ' This is what appears in the device actions...
                Pair.PairType = VSVGPairType.SingleValue
                Pair.Value = 0
                Pair.Status = "OFF"
                Pair.Render = Enums.CAPIControlType.Button
    
                If Not hs.DeviceVSP_AddPair(dvRef, Pair) Then               
                End If
    
                Pair = New VSPair(ePairStatusControl.Both)   ' This is what appears in the device actions...
                Pair.PairType = VSVGPairType.SingleValue
                Pair.Value = 1
                Pair.Status = "ON"
    
                If Not hs.DeviceVSP_AddPair(dvRef, Pair) Then          
                End If
    What would the code look like?
    Last edited by lpitman; May 22nd, 2013, 09:05 AM.
    -Larry

    A member of "The HA Pioneer Group", MyWebSite

    Plugins:
    VWS, AB8SS, lrpSpeak, Calendar, Arduino, Harmony, BlueIris, Sprinklers, ZipBackup...

    Hardware:
    Intel NUC8i7BEH1 running Windows 10 Pro headless, HS3 Pro, Plex running on Synology dual High Availability DS-1815+ NAS (24Tb each), Synology Surveillance Station running on DS-416 Slim (8Tb), Samsung SmartThings, Google Home, Alexa, Hubitat Elevation, ZNET, Ubiquiti UniFi Network, Davis Vantage Pro II Weather Station. Whole house speaker system using a couple of AB8SS switches. Vantage Pro II Weather Station, Rain8Net Sprinklers, Hubitat Elevation, Google Home, Alexa, DSC Security System, Ubiquiti UniFi Network.

  • #2
    You want to use SetIOMulti()
    It will send you a list of the CAPIControl objects. You then iterate through and grab the device reference id to do what you want.
    HS3Pro Running on a Raspberry Pi3
    64 Z-Wave Nodes, 168 Events, 280 Devices
    UPB modules via OMNI plugin/panel
    Plugins: Z-Wave, BLRF, OMNI, HSTouch, weatherXML, EasyTrigger
    HSTouch Clients: 3 Android, 1 Joggler

    Comment


    • #3
      Thanks that did the trick.
      -Larry

      A member of "The HA Pioneer Group", MyWebSite

      Plugins:
      VWS, AB8SS, lrpSpeak, Calendar, Arduino, Harmony, BlueIris, Sprinklers, ZipBackup...

      Hardware:
      Intel NUC8i7BEH1 running Windows 10 Pro headless, HS3 Pro, Plex running on Synology dual High Availability DS-1815+ NAS (24Tb each), Synology Surveillance Station running on DS-416 Slim (8Tb), Samsung SmartThings, Google Home, Alexa, Hubitat Elevation, ZNET, Ubiquiti UniFi Network, Davis Vantage Pro II Weather Station. Whole house speaker system using a couple of AB8SS switches. Vantage Pro II Weather Station, Rain8Net Sprinklers, Hubitat Elevation, Google Home, Alexa, DSC Security System, Ubiquiti UniFi Network.

      Comment

      Working...
      X