Announcement

Collapse
No announcement yet.

Can't Control Z Wave Device in VB Script

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

    Can't Control Z Wave Device in VB Script

    I trying to write a VB script that will control my Z Wave devices on my Hometroller SEL. The command I'm using to control the devices is hs.SetDeviceValueByRef(488,State, true) and I'm using the controlling device in the device group.

    The state and status will change saying the device is ON/OFF or Locked/Unlock, but the actual state doesn't change unless I physically change the device or control it in HS3 Device List or on the app.

    I also have a few Insteon devices and my script can control them no problem. Is there a Z Wave setting I'm not aware of?

    Current Date/Time: 9/11/2019 4:38:03 PM
    HomeSeer Version: HS3 Pro Edition 3.0.0.548
    Linux version: Linux hometrollerSEL 3.16.0-031600-generic #201408031935 SMP Sun Aug 3 23:56:17 UTC 2014 i686 i686 i686 GNU/Linux System Uptime: 5 Days 1 Hour 22 Minutes 30 Seconds
    IP Address: 10.0.0.2
    Number of Devices: 148
    Number of Events: 46
    Available Threads: 194
    HSTouch Enabled: True
    Event Threads: 1
    Event Trigger Eval Queue: 0
    Event Trigger Priority Eval Queue: 0
    Device Exec Queue: 0
    HSTouch Event Queue: 0
    Email Send Queue: 0

    Enabled Plug-Ins
    0.0.0.31: drhsIpPlugIn
    2.0.0.1: EZFlora
    5.0.0.59: Global Cache Pro
    3.0.7.2: Insteon
    3.0.1.14: Kodi
    3.0.1.19: weatherXML
    3.0.1.252: Z-Wave

    #2
    You need to use CAPI commands to control. Search the forum as there are many examples posted.
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #3
      Here's a simple subroutine I use.
      To call it, include it in your script and call: DeviceAction(DeviceName,Function) where Function is "On", "Off", or a Dim Level #
      You can modify this to suit yourself.

      Sub DeviceAction(Device As String, Level As String)
      Dim objCAPIControl As CAPIControl
      Dim DvRef As Integer = hs.GetDeviceRefByName(Device)
      If IsNumeric(Level) Then
      If Level < 0 Then Level = 0
      hs.CAPIControlHandler(hs.CAPIGetSingleControl(DVRef,false, Level, false, True))
      Else
      hs.CAPIControlHandler(hs.CAPIGetSingleControl(DVRef, True,Level.ToUpper,False,False))
      End If
      End Sub
      Real courage is not securing your Wi-Fi network.

      Comment


        #4
        Ed Tenholder has created a very useful toolset to help write vb.net scripts in HS3. His tenScriptAid tool will provide example CAPI code for any of your HS devices, for example.

        Mike____________________________________________________________ __________________
        HS3 Pro Edition 3.0.0.548, NUC i3

        HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

        Comment


          #5
          Go to: https://www.youtube.com/watch?featur...&v=Lt5cPChb9jw

          tenholde

          Comment


            #6
            Thank you everyone! this has been most helpful. Especially with the tenScriptAid. saved me a lot of head scratching

            Comment

            Working...
            X