Integrations: Integrations

API

The API examples and docs have moved to https://ispysoftware.github.io/Agent_API/

Python Wrapper

There's a python wrapper for basic UI functionality here: agent-py .

URL Parameters

You can open Agent DVR to a specific view by calling the Agent DVR url with (case sensitive):

  • ?start=Live&viewIndex=3 (live view on view 3)
  • ?start=TimeMachine (timemachine view)
  • ?start=Timeline (timeline view)
  • ?start=Photos (photos view)
  • ?start=Recordings (recordings view)
  • ?start=Floorplans&planIndex=2 (floorplans view on plan 2)
  • ?start=VR (virtual reality)

You can open Agent DVR with a specific language (bypassing the language selection). Just pass in the 2 letter language code: ?lang=fr

You can pass in the name of a saved filter to apply using a filter parameter - eg: ?start=Recordings&filter=intruder. You can also pass in a from and to time for the filter using javascript ticks. eg ?start=timeline&from=1657841514949&to=1657852514949.

Set default theme options (theme options are available in the account menu - theme settings):

  • ?theme=darkly&variant=dark&large=false
  • ?theme=sketchy&variant=primary&large=true

Auto play audio on load (may also require changing browser settings):

  • ?playaudio=true

Start in minimised mode (top and bottom UI bars hidden):

  • ?mini=true

Pass in local username and password for auto login (caution - this will expose your credentials to the network):

  • ?un=username&pwd=password

Commands

To access Commands in Agent DVR, click on the Server icon at the top left of the Agent DVR UI, and select "Commands" under System. A quick shortcut is to press "C".


Agent DVR includes several pre-built commands that can control multiple devices simultaneously. These commands utilize the API to perform various tasks. You have the flexibility to add your own custom commands for calling the API or running software on your computer.

Calling a Script File

To execute a generic script file, simply add a .bat file (or .sh file on Linux/OSX) to the commands directory. The script's filename (without the extension) will appear in the Commands list and can be clicked to run. Note: You might need to reload the UI for it to appear.

Calling the API

Create a new .bat file in the Commands folder where Agent DVR is installed. The first line should be:
REM ispy-internal
This line indicates that the file should be processed internally by Agent DVR, not executed as a standalone application.

The subsequent lines are interpreted as commands for the Agent DVR's API. For instance:

REM ispy-internal
switchon&group=external
switchoff&group=internal
record&group=external
broadcast 'external cameras are on and recording'

These commands are appended to API calls in the format /command.cgi?cmd=.... Thus, you can use any command available in the API.

The example commands above will activate all devices labeled as "external", deactivate all "internal" devices, start recording on "external" devices, and send a broadcast message to all connected clients.

Refer to the readme command button for examples and the API documentation for a list of available commands.

Remember to use & instead of ? to separate parameters in your commands.

After reloading the UI and pressing "C", your new command should be visible in the list. Click on it to execute.

From version 3.8.1.0+, you can use location names in commands (e.g., switchon&location=home). Just assign a location to your devices first!

Amazon Alexa

From version 2.9.5.0, Agent DVR offers Amazon Alexa integration. This feature allows you to control Agent DVR using voice commands through Alexa-enabled devices. You can arm or disarm the system or display live video feeds on Alexa Show devices.

To set it up, select 'Alexa' under Integrations in the Server menu of Agent DVR. This redirects you to Amazon for linking your accounts.

Once linked, run Alexa's discovery process. It should find two devices: the security panel and the camera control.

Now you can use voice commands like:

  • "Alexa, arm Agent in home mode"
  • "Alexa, show Agent camera"

Set your security code in Agent DVR Settings for operations requiring authentication. The default code is 1234.

The Alexa profiles (Home / Away / Night) match those in Agent DVR. Configure them in Server - Profiles.

For multiple servers, set a server name in settings and use it in voice commands.

Home Assistant

Agent DVR fully integrates with Home Assistant, allowing you to add Agent DVR into your Home Assistant setup. Embed the Agent DVR panel in the lovelace UI or select individual cameras. It also includes a control for the main security panel. For more information, see the Home Assistant link under Server - Integrations.

IFTTT (If This Then That)

IFTTT lets you set up actions and triggers with IoT devices. Start by linking your IFTTT account with iSpyConnect.com, accessible under Server - Integrations.

Push Alerts

Setting up mobile push alerts is detailed at Setting up Push Alerts.

Telegram

Telegram Bot Example

Connect Agent DVR with the Telegram chatbot for control and live alert notifications. Enable Push notifications in device settings for live alerts. Begin by selecting the Telegram button under the Server icon in the remote web interface.