Announcement

Collapse
No announcement yet.

Trying to turn a device on without triggering

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

    Trying to turn a device on without triggering

    I'm trying to turn on a device without triggering any events associated with it.
    I can turn it on using CAPI but how would I change "Do_Update" in the CAPI Control Object to False?
    This is my script which I got from the HS3 Help.

    Sub Main(parm as object)

    Dim objCAPIControl As CAPIControl
    ' Dim Do_Update As Boolean

    ' objCAPIControl = hs.CAPIGetSingleControl(40, Do_Update, False)
    objCAPIControl = hs.CAPIGetSingleControlByUse(40, ePairControlUse._On)
    hs.CAPIControlHandler(objCAPIControl)

    End Sub

    Any help would be appreciated.

    #2
    Just use the hs.setdevicevaluebyref command instead.

    Cheers
    Al
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #3
      Unfortunately, that sets the Homeseer device to On but doesn't actually control the device. You have to use CAPI control to control the actual device.

      Comment


        #4
        Originally posted by andyf View Post
        Unfortunately, that sets the Homeseer device to On but doesn't actually control the device. You have to use CAPI control to control the actual device.
        Ok, I misunderstood what you are trying to do. I thought you wanted to change the status of the device in HS without actually controlling the device. I'm not sure there is a way with the CAPI command. You could use the status of a virtual device as a condition with those events and set the virtual as needed when you want to trigger the events.

        Cheers
        Al
        HS 4.2.8.0: 2134 Devices 1252 Events
        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

        Comment


          #5
          Thanks Al, I think all I need is a little help with VB scripting.

          The CAPI Control Object looks like this:

          Public Class CAPIControl
          Inherits MarshalByRefObject
          Public Do_Update As Boolean
          Public SingleRangeEntry As Boolean
          Public Property CCIndex As Integer
          Public Property Range As clsValueRange
          Public ReadOnly Property Ref As Integer
          Public Property Label As String
          Public Property ControlType As Enums.CAPIControlType
          Public ControlButtonType As Enums.CAPIControlButtonImage
          Public ControlButtonCustom As String
          Public Property ControlLocation As Enums.CAPIControlLocation
          Public Property ControlLoc_Row As Integer
          Public Property ControlLoc_Column As Integer
          Public Property ControlValue As Double
          Public Property ControlString As String = ""
          Public Property ControlStringList() As String()
          Public Property ControlFlag As Boolean
          Public Property ControlUse As ePairControlUse
          End Class

          I want to be able to change the first entry in the Class, "Do_Update" to False. There seems to be a function to set ON/OFF/DIM which I am using successfully to control the device.

          objCAPIControl = hs.CAPIGetSingleControlByUse(40, ePairControlUse._On)

          But before I call the CAPI handler I want to set "Do_Update" to False but I can't figure out how to do that.

          EDIT: It appears I expected it to be more complicated than it was.

          objCAPIControl.Do_Update = False

          seems to do the job. It just doesn't prevent events from triggering. Bah!

          This is the script I am using:

          Sub Main(parm as object)

          Dim objCAPIControl As CAPIControl

          objCAPIControl = hs.CAPIGetSingleControlByUse(40, ePairControlUse._On)
          objCAPIControl.Do_Update = False
          hs.CAPIControlHandler(objCAPIControl)

          End Sub

          The help files states that if "Do_Update" is False it will prevent Homeseer from triggering events based on this action. I'm not seeing this, my events are still triggering.
          Last edited by andyf; July 6, 2017, 08:16 AM.

          Comment

          Working...
          X