No announcement yet.

Can't Control Z Wave Device in VB Script

  • 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
    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:
    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 drhsIpPlugIn EZFlora Global Cache Pro Insteon Kodi weatherXML Z-Wave

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


      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))
      hs.CAPIControlHandler(hs.CAPIGetSingleControl(DVRef, True,Level.ToUpper,False,False))
      End If
      End Sub
      Real courage is not securing your Wi-Fi network.


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

        Mike____________________________________________________________ __________________
        HS3 Pro Edition, NUC i3

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


          Go to:



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