Announcement

Collapse
No announcement yet.

Trigger event from command line on neworked pc - Solved!

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Trigger event from command line on neworked pc - Solved!

    Hi Guys,

    What's the nest way to trigger an event on my homeseer pc via the command line on another pc on the same LAN?

    I have iSPY camera software on a pc and I want to trigger events on homeseer when it detects movements.

    Thanks

    Jim

    #2
    I do this with BlueIris. It can run a command-line when movement is detected.
    Assuming this is Windows, create a eventDetected.cmd script that has the following lines:
    @echo off
    wscript runEvent.vbs

    Now, runEvent.vbs can connect to HS and interact however you need - run an event, update some values, etc.

    My scripts actually send data to HS via a URL POST with my own custom .ASP page to handle. I dont create a HS object on the client, just send BlueIris info over to HS via HTTP.
    HS4Pro on a Raspberry Pi4
    54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
    Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

    HSTouch Clients: 1 Android

    Comment


      #3
      Thanks for this, can you show the content of your vbs script?

      Comment


        #4
        Yep - here's a piece of that .VBS that passes data back to homeseer:

        PHP Code:
        ''call BlueIris.asp to pass the totals
        Page 
        "http://homeseer/blueiris.asp"
        Set myDoc CreateObject("MSXML2.ServerXMLHTTP")
        myDoc.open "POST",Page,false
        myDoc
        .setRequestHeader "Content-Type""application/x-www-form-urlencoded"
        myDoc.send "action=lastevent&camera=lrcam&datetime=" lrcam_lastdate "&todayvideos=" lrcam_today "&totalvideos=" lrcam 
        The blueiris.asp file that lives on HS is:
        PHP Code:
        <%
            
        dim action,camera,datetime,totalvideos,todayvideos
            
            action 
        Request.QueryString("action")
            
        camera Request.QueryString("camera")
            
        datetime Request.QueryString("datetime")
            
        totalvideos Request.QueryString("totalvideos")
            
        todayvideos Request.QueryString("todayvideos")

            
        ''hs.writeLog "BlueIris","action=" action "  camera=" camera "  datetime=" datetime " totalvideos=" totalvideos "  todayvideos=" todayvideos

            
        if(camera="lrcam"then
                hs
        .setDeviceString "V20",datetime,true
                hs
        .setDeviceString "V23","Total Videos on File: " totalvideos,true
                hs
        .setDeviceValue "V23",totalvideos
                hs
        .setDeviceString "V24","Videos Recorded Today: " todayvideos,true
                hs
        .setDeviceValue "V24",todayvideos
            end 
        if

        %> 
        HS4Pro on a Raspberry Pi4
        54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
        Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

        HSTouch Clients: 1 Android

        Comment


          #5
          Thanks buddy, this is working a dream!

          Comment


            #6
            Originally posted by codey View Post
            Thanks buddy, this is working a dream!
            cool! Glad to help!
            HS4Pro on a Raspberry Pi4
            54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
            Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

            HSTouch Clients: 1 Android

            Comment

            Working...
            X