This guide explains how to use Soft Triggers and Internal HTTPS requests within the Rules engine to control recording for single or multiple devices.
Prerequisites
A recording schedule must already be configured for the target devices.
Administrative access to the System Administration/Rules menu.
The Camera ID for each device (found in Camera Settings > General or via the API).
Option 1: Controlling a Single Device
This method uses a direct API call to a specific camera to toggle its recording schedule.
Rule 1: Start Recording
Event: Soft Trigger (Name it "Start Recording")
Action: Internal HTTPS request
Endpoint:
/rest/v4/devices/<cameraId>Method: PATCH
-
Content:
{ "schedule": { "isEnabled": true } } Interval of Action: Instant
Rule 2: Stop Recording
Event: Soft Trigger (Name it "Stop Recording")
Action: Internal HTTPS request
Endpoint:
/rest/v4/devices/<cameraId>Method: PATCH
-
Content:
{ "schedule": { "isEnabled": false } } Interval of Action: Instant
Option 2: Controlling Multiple Devices
If you need to start/stop recording on several cameras simultaneously with one click, use a Generic Event as a middleman.
Step A: Create the Main Trigger
Create a Rule where the Soft Trigger sends a Generic Event to the system.
Event: Soft Trigger
Action: Internal HTTPS request
Endpoint:
/rest/v4/events/genericMethod: POST
Content:
{"source": "StartRecording"}
Step B: Create Device-Specific Rules
For each device you want to include in the group, create a rule that listens for that Generic Event:
Event: Generic Event (Source contains:
StartRecording)Action: Internal HTTPS request
Endpoint:
/rest/v4/devices/<cameraId>Method: PATCH
Content:
{"schedule": {"isEnabled": true}}
To stop the group, simply repeat Step A and B using the keyword {"source": "StopRecording"}and Content {"schedule": {"isEnabled": false}}
Option 3: Scaling for Large Systems
When managing hundreds of devices, configuring individual event rules for each camera or device is inefficient. Instead, you can automate and scale your workflows by using centralized scripts or executing batch configuration updates via the API.
1. Running Centralized Scripts via API
Instead of triggering individual actions per device, you can develop a centralized script (written in Bash, Python, or Batch) that handles bulk commands.
To trigger these scripts dynamically within the system, you only need to configure two Event Rules (one for Start, one for Stop) that leverage internal HTTPS requests to execute your centralized code.
For a detailed step-by-step guide on configuring the API endpoints, payloads, and permissions required to trigger external code, see our support article:
2. Batch Updating Event Rules
If your system architecture requires modifying the Event Rules themselves across numerous servers or sites simultaneously, manual configuration becomes a bottleneck. You can use JSON-RPC methods combined with internal HTTPS actions to push batch updates to your rules instantly.
To learn how to structure JSON-RPC requests for bulk rule management, please refer to our dedicated guide:
Alternative Events
While this guide focuses on Soft Triggers and Generic Events, you can substitute the initial "Event" with Input Signal on Camera. This requires at least 2 inputs: for example Input 1 to start and Input 2 to stop.
Instead of the inputs on cameras, this inputs could also be used from a support I/O device.
Comments
0 comments
Article is closed for comments.