Announcement

Collapse
No announcement yet.

Send an HTTP command

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

    Send an HTTP command

    I'm thinking there should be some way - maybe not even a script - that can be used to send an http command from HS to another server. Here is what I need to send:

    http://x.x.x.x:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.ExternalEvent&method= "Trigger"&version=1&eventId=1&eventName="This is external event1"&account="{account}"&password="{password}"

    I am about to try it from a browser, and expect it should work once I fill in IP address / password & usernames.

    Is there a spimple way to do this? I found "URLAction" but that requires programming -

    Any assistance appreciated.


    #2
    It's what URLAction is for. You can run &hs.URLAction from an event as an immediate script command. Also, take a look at Big6 or mcsMQTT. They both can send HTTP requests.
    "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

    Comment


      #3
      Thanks! I think that's what I was looking for. Will give it a try.

      Comment


        #4
        OK - thats the programming part.
        I tried &hs.URLAction http://x.x.x.x:5000/webapi/entry.cgi...lEvent&method= "Trigger"&version=1&eventId=1&eventName="This is external event1"&account="{account}"&password="{password}"
        But it errors.

        With the proper account / password which works great from a web browser.

        Any example would be super!

        Comment


          #5
          hs.geturl(url,"",TRUE,80)

          this works

          Comment


            #6
            Here, HS talks to our BlueIris server all day long,, the first script is from a immediate script, second example is from a script that sends banner info to BI.

            ​​Blair

            &hs.geturl("localhost","/admin?camera=Cam09&trigger&user=userxx&pw=userxx",TRUE,9080)

            send parameters to BlueIris host port 9080
            hs.getURL("localhost","/admin?macro="+theMacro+"&text="+totalStatus+"&user=userxx&pw =userxx",FALSE,9080)send parameters to BlueIris host port 9080
            Blair

            HomeSeer: HS3 Pro | Blue-Iris 4 on Windows10Pro
            | Devices: 832 | Events: 211 |
            Plug-Ins: Z-Wave | RFXCOM | UltraRachio3 | Sonos
            BLLAN | BLLOCK | NetCAM | Global Cache Pro | Blue-Iris4

            Comment


              #7
              Try this immediate script command:

              Code:
              &hs.URLAction("http://x.x.x.x:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.ExternalEvent&method=Trigger&version=1&eventId=1&eventName=This is external event1&account={account}&password={password}", "GET", "", "")
              You may need to change any spaces in the eventName to %20 i.e.

              This%20is%20external%20event1

              Don't add any extra quotation marks!
              Jon

              Comment


                #8
                Thank you Blair & Jon00 (especially Jon00!) I would have spent 8 hours trying to figure this out on my own.
                Can't wait to try this tonight!

                Comment

                Working...
                X