Announcement

Collapse
No announcement yet.

HS3 Running event from Command Line

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

  • frankc
    replied
    Originally posted by mrhappy View Post
    to run that bit of code as a compiled EXE from vb.net you could use the Process.Start call (http://www.dotnetperls.com/process-vbnet) but I would wonder why because you could just embed that code into VB to start with.
    I'm wanting to run an event from a windows vb.net form application. So as soon as I can run an HS3 event from the compiled application, I'll be set. A line similar to the following would be the right way to do it I think. But I'm not sure of the syntax:

    results = System.Diagnostics.Process.Start("C:\Program Files (x86)\Homeseer HS3\HS3EventRun.exe eventname='Test Event'")

    And perhaps a better way to run the event from the compiled program is to include the vb piece of your source code for "HS3EventRun.exe" rather than the .exe app. I think that is what you mean by "embed that code into VB to start with". But I haven't got that piece figured out.

    I know that Rich's JSON/vb.net example accomplishes this goal, but I haven't quite distilled it down far enough to find the appropriate syntax to execute a JSON command from a vb.net compiled program. Most likely your 'HS3EventRun' uses similar source code to Rich's example (??)

    Does that make sense?

    I appreciate the guidance with this MH.

    Leave a comment:


  • langenet
    replied
    I'm further confused - I don't have a RunJSON.exe in my HS3 root directory.
    I haven't ventured with JSON in HS3 yet... Am I missing something?

    Robert

    Leave a comment:


  • mrhappy
    replied
    Originally posted by frankc View Post
    I need some advice regarding the syntax to be used to execute this 'command line' from within a vb.net script. I've tried several approaches but haven't got it to work yet.

    Thank you
    I'm a bit confused really what you are trying to do - could you elaborate a bit further? I mean to run that bit of code as a compiled EXE from vb.net you could use the Process.Start call (http://www.dotnetperls.com/process-vbnet) but I would wonder why because you could just embed that code into VB to start with.

    Leave a comment:


  • frankc
    replied
    vb.net syntax

    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.
    I need some advice regarding the syntax to be used to execute this 'command line' from within a vb.net script. I've tried several approaches but haven't got it to work yet.

    Thank you

    Leave a comment:


  • frankc
    replied
    While this is an older thread, I still found the contents valuable.

    Mr. Happy's script works fine.

    Rupp's works great too. But I added double quotes around the JSON command in his example:

    Code:
    "C:\Program Files (x86)\HomeSeer HS3\RunJSON.exe" "http://172.17.32.31:81/JSON?request=runevent&group=Speaking&name=SpeakTheTime"

    Leave a comment:


  • dexterdom
    replied
    Originally posted by Rupp View Post
    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

    Hi Rupp, I tried your program on Windows 7 (on both 32 and 64 bit versions) and the program crashes ("Program Stopped Working"). Could this be corrupt?

    Leave a comment:


  • theendisnye
    replied
    Originally posted by mrhappy View Post
    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.
    Brilliant thank you that got everything back up and working. Steve

    Leave a comment:


  • Rupp
    replied
    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

    Leave a comment:


  • mrhappy
    replied
    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.

    Leave a comment:


  • theendisnye
    replied
    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

    Leave a comment:


  • IanIreland
    replied
    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.

    Leave a comment:


  • mrhappy
    replied
    No worries thanks for letting me know it works.

    Leave a comment:


  • IanIreland
    replied
    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.

    Leave a comment:


  • mrhappy
    replied
    Are the Hscf.dll, scheduler.dll and homeseerapi.dll files in the same directory as the exe file?

    Leave a comment:


  • Kevin75135
    replied
    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?

    Leave a comment:

Working...
X