Relay Script with relay in camera
Comments
-
Did some research myself. It's possible to write a new script in apple script or java-script.
But does this mean it is possible to run a C# script on a relay from another manufacturer then the pre-installed ones? Or run a JASONP command? As for example:
"http://192.168.1.25/gpio/ts/2?ac=123456&delay=100"
(In this example case relay is 2 closed 10 seconds and then released through a JASONP command. In which:
- Path: /gpio/ts/{n}, n is used to indicate the relay number
- Parameter: delay={#} )
-
Hi Nico,
You can call any URL via an AppleScript using curl, like this:
do shell script "curl 'http://the-url'"
So using your example:
do shell script "curl 'http://192.168.1.25/gpio/ts/2?ac=123456&delay=100'"
Save the script into the ~/Documents/SecuritySpy/Scripts/ folder, and it will be available as an action in SecuritySpy.
As for the Axis I/O ports, see this document: I/O Port API
An example would be:
do shell script "curl 'http://address/axis-cgi/io/port.cgi?action=2%3A%2F300%5C'"
This sets port 2 to active, waits 300 ms and then sets the port to inactive. There are more examples in the Axis documentation.
Hope this helps!
