No announcement yet.

Help Please with first script

  • Filter
  • Time
  • Show
Clear All
new posts

    Help Please with first script

    I am trying to write my first script for my new HomeSeer Zee system using HSTouch Designer. I have the following command, which works just fine from the one line script utility on the ActionWhenPressed property.


    All I want to do is, do this with a script file, rather than the one line.
    So, I ssh'd onto my zee and found the /usr/local/HomeSeer/scripts directory.
    I then created a file called camctrl.vb and put the following into it.

    sub Main()
    dim page
    page = hs.GetURL("","/cgi_bin/CGIProxy.fcgi?cmd=ptzStopRun&usr=admin&pwd=890house",TRUE,80 )
    end sub

    I saved it, made it executable, etc. as follows:

    homeseer@HomeTrollerZeeS2 /usr/local/HomeSeer/scripts $ ls -al
    total 24
    drwxr-xr-x 2 homeseer root 4096 Jul 9 09:52 .
    drwxr-xr-x 19 homeseer root 4096 Jul 6 07:43 ..
    -rw-r--r-- 1 root root 655 Aug 25 2015 BBMessenger.vb
    -rwxr-xr-x 1 homeseer root 139 Jul 9 09:20 camctrl.vb
    -rw-r--r-- 1 homeseer root 228 Nov 21 2014 ShutDown.txt
    -rwxr-xr-x 1 homeseer root 934 Nov 21 2014 Startup.vb
    homeseer@HomeTrollerZeeS2 /usr/local/HomeSeer/scripts $

    So then, in HS Touch Designer, I choose this script on the ActionWhenPressed property. I then save and deploy.

    Then button, which works just great without the script, now does nothing.
    What am I doing wrong?
    I've read so many posts, but find none that just walk me through a tutorial of doing what I'm trying to do --- which should be fairly simple.

    This shows up in the log so at least I know the script is being called:

    Running script camctrl.vb :Object reference not set to an instance of an object->Does entry point Main() exist in script? at A.c17b105f989efe61e5979e67bec1ef734.cffd66cb0782c50126727e3f a75582d7a () [0x00000] in :0

    Any help is APPRECIATED!!
    Last edited by John Schmidt; July 9, 2016, 10:23 AM.

    Looks like you are mixing vbscript and syntax. Try:

    Sub Main(ByVal Parms As object)
    Dim page As String
    page = hs.GetURL("","/cgi_bin/CGIProxy.fcgi?cmd=ptzStopRun&usr=admin&pwd=890house",TRUE,80 )
    End Sub
    HS 1990 Devices 1172 Events
    Z-Wave 126 Nodes on one Z-Net



      Dear Sparkman,

      THANK YOU!!
      THANK YOU!!
      THANK YOU!!
      THANK YOU!!
      THANK YOU!!
      THANK YOU!!
      THANK YOU!!
      THANK YOU!!
      THANK YOU!!

      Oh yes, it worked!