Announcement

Collapse
No announcement yet.

HS3 Running event from Command Line

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

    HS3 Running event from Command Line

    Does anyone have a method for triggering an event from the command line. I have a NVR running on the system, that I can get to execute a command when it detects motion, and I would like to use it to run events.

    I found this script by searching the forums:
    Set hsi = CreateObject("HomeSeer2.application")
    hsi.SetHost("localhost")
    rval = hsi.Connect("MyUsername", "MyPassword")
    If rval <> "" Then
    MsgBox(rval)
    End If

    Set hs = hsi.GetHSRef

    hs.TriggerEvent("TestSend")

    However it is based on HS2. Replacing HomeSeer2 with HomeSeer3 doesn't make a difference. I get ActiveX component can't create object: HomeSeer2.application.

    I am not a VB programmer. I know enough what to copy, and that is about it.

    Any ideas?

    #2
    Did you get anywhere with this? I could use something similar!

    Comment


      #3
      Take a look here http://forums.homeseer.com/showthread.php?t=165152

      Comment


        #4
        I have written an app that might be of use to some, it will accept an event name by command line and then try and trigger the event. So you would run it with

        C:\Path\Path\HS3EventRun.exe eventname="Test Event"

        to run the event with the name of Test Event. It should support a remote connection if you also specify server=(IP address) so this should work (although I have not tested it)

        C:\Path\Path\HS3EventRun.exe server=192.168.0.15 eventname="Test Event"

        If it connects it will run the event and exit, if it does not connect it will also exit. You will need to have the HSCF.dll, Scheduler.dll and HomeSeerAPI.dll in the directory this application resides in.

        Edit: http://seriousface.ddns.net/plugins/old/HS3EventRun.zip
        Last edited by mrhappy; May 6, 2018, 04:31 AM. Reason: Attachment added

        Comment


          #5
          Originally posted by mrhappy View Post
          I have written an app that might be of use to some, it will accept an event name by command line and then try and trigger the event. So you would run it with

          C:\Path\Path\HS3EventRun.exe eventname="Test Event"

          to run the event with the name of Test Event. It should support a remote connection if you also specify server=(IP address) so this should work (although I have not tested it)

          C:\Path\Path\HS3EventRun.exe server=192.168.0.15 eventname="Test Event"

          If it connects it will run the event and exit, if it does not connect it will also exit. You will need to have the HSCF.dll, Scheduler.dll and HomeSeerAPI.dll in the directory this application resides in.

          This is it here, https://www.dropbox.com/s/p7b9matppe...S3EventRun.exe

          Thanks mrhappy this will definitely help me out in my setup

          Cheers Ken
          HSPRO,HS3PRO, BLsecurity, , MCSxap, HSTouch Android, UltraGCIR, CM15a, USBUIRT, BLUSBUIRT, WIFIRGB, BLAB8SS, BLcontrol, BLGData, BLLAN,BLOccupied, BLRadar, BLVolume, iTunesDAAP, UltraGCIR3, Airplayspeak, BLalarm, BLbackup, BLLED, BLrandom, BLReminders, BLRF, BL Speech, Hyperion, IFTTT, KINECT, XBMC, MCSprinkers PRO, PHLocation, ULtrapioneer, Ultralog, ultraweatherbug, Z,troller, GC-100, GC WIFICC, GC-WIFI SERIAL, Nitrogen logic depth camera controllers,

          Comment


            #6
            I would be interested to try this - but the link says nothing there :-(

            Comment


              #7
              Thank you - I have house guests - as soon as they have gone, I'll have a play!

              Comment


                #8
                Thank you.

                That is just what I was looking for. However when running, I get:

                Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'HSCF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. at HS3EventRun.Main.Main()

                What am I missing?

                Comment


                  #9
                  Are the Hscf.dll, scheduler.dll and homeseerapi.dll files in the same directory as the exe file?

                  Comment


                    #10
                    It works

                    A quick bit of feedback.
                    I have HS3 running in a virtual machine as a test setup.
                    I created a test event that simply increments a counter.
                    I ran HS3EventRun.exe from the VM host, having copied the relevant files into the same directory.
                    The counter increments as it should.
                    Thank you.

                    Comment


                      #11
                      No worries thanks for letting me know it works.

                      Comment


                        #12
                        WebcamXP

                        Just for further info - somebody else might like to know - I'm using it in conjunction with WebcamXP. This allows a program to run when motion is detected on a camera.
                        The path to your program goes in one dialogue box and parameters (IP and event name) in another.

                        Comment


                          #13
                          I have been running this program for a while in conjunction with BlueIris but noted that it had stopped working. So I have been investigating and it loads the programme displays the message 'connecting to xx.xx.xx.xx you want me to run event name; yyyyyyyyyyyyy which then remains on the screen

                          Occasionally it gives me an error message that flashes up and says 'object reference is not set to an instance of an object - disconnected from client' however it disappears quite quickly,

                          I can't recall changing anything on either homeseer of BlueIris and the server and event name referenced appear to be correct.

                          Does anyone have any ideas on what may be causing the issue?

                          Steve

                          Comment


                            #14
                            Check that your dll's are up to date in whatever folder you have the hs3eventrun.exe file in, HS make changes to these sometimes which can lead to them being out of date.

                            Comment


                              #15
                              Attached is a small c# application I wrote a while back that can run the new JSON commands for HS3. It really only works well with triggering events as I just ignore the return value. I dropped the RunJSON.exe in my HS3 directory and created a shortcut to it on my desktop. Then simply edit the short cut adding your JSON command to the end of the target ie
                              Code:
                              "C:\Program Files (x86)\HomeSeer HS3\RunJSON.exe" http://172.17.32.31:81/JSON?request=runevent&group=Speaking&name=SpeakTheTime
                              Attached Files
                              💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                              Comment

                              Working...
                              X