Announcement

Collapse
No announcement yet.

New at writing scripts HELP!

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

    New at writing scripts HELP!

    I'm trying to write my first script in VB. I have lots to do in the script, but just to get a reality check I wrote the following script:

    Sub Main(parms as object)
    hs.SetDeviceValueByName("Basement Office Desk Light", 0)
    End Sub

    I thought it would turn off the desk light in my basement office. When I execute it, the desk light remains lit, BUT, when I look at the status of the desk light on the Device Management page, it says the light is off.

    Huh?

    What am I doing wrong?

    Thanks.

    Bob

    #2
    Hi Bob, you need to use a CAPI command to actually control the light. Search then board for details.


    Sent from my Phone using Tapatalk
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #3
      There are a couple of very useful tools. I recommend you check out tenscripting

      http://tenholder.net/tenWare2/homeseer.aspx

      TenScriptAid is a standalone program that is also very helpful. It will give you the correct CAPI syntax for each of your devices
      HS4 Pro on Shuttle NC10U, Win10; Z-NET
      Number of Devices: 1005
      Number of Events: 293

      Plug-Ins: BLLock, DirecTv, EasyTrigger, Honeywell WiFi Thermostat, Marquis monoprice Amp, MeiHarmonyHub, PHLocation2, Pushover 3P, UltraM1G3, rnbWeather, Worx Landroid, Z-Wave

      External applications: Homebridge-homeseer, Geofency, EgiGeoZone.

      Comment


        #4
        Also, if you are going to write more extensive scripts, look at the following:

        http://tenholder.net/tenWare2/tenScripting/default.aspx

        Make sure to download the HS3 version.

        tenholde
        tenholde

        Comment


          #5
          Well duh! All I had to do was read through the help file a little further, and I'd have found that. Works like a charm. Now I can write the rest of my script. Thanks guys!

          Comment

          Working...
          X