ARES Scripts
3 Python scripts are included with your Actions Relay Event Service (ARES) installation. Each script is designed to work with a different third party relay device that can electronically lock or unlock doors. The scripts are located here:
- On Windows:
C:\Program Files\RealNetworks\SAFR\ares\scripts
- On macOS:
/Library/RealNetworks/SAFR/ares/scripts
- On Linux:
/opt/RealNetworks/SAFR/ares/scripts
To run these scripts from the command line, do the following:
- If it's not already installed, install the latest version of Python 3.X. The Python installer can be downloaded from here: https://www.python.org/downloads/.
- Run the script in question. On Windows:
- Open Command Prompt (Admin) or Windows PowerShell (Admin) by right clicking on the Windows Start menu (located in the bottom left corner of the screen) and selecting the appropriate entry.
- Navigate to
C:\Program Files\RealNetworks\SAFR\ares\scripts
.
- Run
python <script syntax>
.
On Linux:
- Open Terminal.
- Run
sudo python /opt/RealNetworks/SAFR/ares/scripts/<script syntax>
.
On macOS:
- Open Terminal.
- Run
python /Library/RealNetworks/SAFR/ares/scripts/<script syntax>
.
To run these scripts from with SAFR actions, do the following:
- If it's not already installed, install the latest version of Python 3.X onto the machine where ARES is installed. The Python installer can be downloaded from here: https://www.python.org/downloads/.
- Within the SAFRActions.config file, set the rules -> Item X -> triggers -> Item 1 -> action -> Item 1 key to the following value:
- On Windows:
python ./scripts/<script syntax>
- On Linux:
sudo python ./scripts/<script syntax>
- On macOS:
python ./scripts/<script syntax>
This script uses the X-410 Relay to lock and unlock doors. The syntax to use the script is as follows:
Usage: relay-x410.py <relayHost> <relayNumber>
- relayHost: The URL of the X-410 relay.
- relayNumber: The channel on the X-410 relay to trigger.
Example:
relay-x410.py 192.168.1.2 1
This script uses a Numato USB Relay to lock and unlock doors. The syntax to use the script is as follows:
Usage: relay-numato.py <relayNumber> <delay> [tty.device]
- relayNumber: The channel on the Numato relay to trigger.
- delay: The number of seconds the relay is to be kept closed after triggering. This translates to the number of seconds the door will be unlocked.
Optional arguments:
- tty.device: The text telephone (TTY) device to use.
Example:
relay-numato.py 0 5
or
relay-numato.py 0 5 /dev/tty.usbmodem1411
This script uses an LCUS USB relay to lock and unlock doors. The syntax to use the script is as follows:
usage: relay-lcus.py [-h] [-p PORT] [-b {9600}] [-r {1,2,3,4}] [-d] [-q] <delay>
- delay: The number of seconds the relay is to be kept closed after triggering. This translates to the number of seconds the door will be unlocked.
Optional arguments:
- -h: Shows the script help message.
- -p PORT: Serial port device. (e.g. COM1, /dev/tty.usb-serial, etc.)
- -b {9600}: Serial port baud rate.
- -r {1,2,3,4}: Relay device number.
- -d: Enables DEBUG level logging.
- -q: Suppresses non-error output.