You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
You are viewing the article in preview mode. It is not live at the moment.
Home > DW Product Help > Software Applications > DW Spectrum IPVMS > Event Rules > DW Spectrum - Creating an API Arm/Disarm Event Rule
DW Spectrum - Creating an API Arm/Disarm Event Rule
print icon

Creating an Arm/Disarm Event Rule

-----------------------------------

Affected Roles: Administrator, Power Users

Related Digital Watchdog VMS Apps: DW Spectrum

Software Version: 6.0

Last Edit: May 12, 2025

-----------------------------------

 

Arm/Disarm Analytic Event Rules

There may be some cases where a user wants to enable or disable an Analytic Event Rule upon receiving a camera input signal, I/O module input, or use of a soft trigger in the DW Spectrum Client. For example, users may want to bookmark footage in the archive whenever an external sensor is tripped.

This article will outline how to create Event Rules that will enable or disable other Event Rules in DW Spectrum. For this example, we will use an input from an analytic camera as the trigger to invoke the arm/disarm action.

 

Related Articles

 

Initial Setup

Digest Authentication must be enabled for the DW Spectrum System. For more information, you may refer to DW Spectrum - Enabling Digest Authentication.

 

Part 1: Create an Event Rule

If you have already created your desired Event Rule(s), skip ahead to the next section of this article. Otherwise, create an Event Rule using the DW Spectrum Client or API.

For this example, we will create an Event Rule that will activate when a camera detects motion, responding by beginning to record video to the archive.

  1. Open the Event Rules menu and click “Add” to create a new rule.
  2. Configure the Event and Action parameters of the Event Rule.
    1. Event
      • When – set the triggering parameter. For this example, we will select “Motion on Camera”.
      • At – select the source camera or device.
    2. Action
      • Do – select the resulting action for the event. For this example, we will select “Camera recording”.
      • At – select the target camera.
      • Also record source camera – enable or disable to also record to the source camera’s archive.
      • Interval of action – enable to set a limit to how frequently the action can occur. For this example, we will disable this option.
      • Quality – set the video quality for the recording. For this example, we will leave the Quality, FPS, and Pre/Post Recording options at their default settings.

 

Finding the Target Camera Rule ID

For the arm/disarm rule to work, the target camera rule’s “ID” is required.

  1. Open a web browser (Chrome, Edge, etc.) and enter the following URL:

https://127.0.0.1:7001/#/api-tool/main?redirected=%2Fdevelopers%2Fapi&type=1

 

**NOTE: Digest Authentication must be enabled.

 

  1. Log in as an authorized user then change the URL address to the following:

http://127.0.0.1:7001/ec2/getEventRules

 

  1. A JSON response window will be displayed. Enable the Pretty-print option to reformat the lines of text.
    1. Locate the “actionType”: “<rule action> string. In this example, the rule action is “sendRecordingAction” in reference to the resulting action of the associated Event Rule.
    2. Use CTRL+F and search for the action of the Event Rule (e.g. “sendRecordingAction”).
      Once highlighted, locate the “id:” string (e.g. “id”: “{183ad996-b18b-4baa-98b7-55a849849f73}”).

 

Part 2: Create Event Rules to Arm/Disarm the Analytics Event

Creating an Arming Event Rule

To create an Event Rule to enable another rule:

  1. Add a new rule and configure the following:
    1. Event
      • When – select the trigger for the rule (e.g. Input Signal on Camera, I/O module, Soft Trigger, etc.). For this example, we will use a soft trigger.
      • At – select the source camera or device.
      • Availability – if selecting the “Soft Trigger”, select the users who will have access to the soft trigger button.
      • Name – create a name for the soft trigger.
      • Icon – select an icon for the soft trigger.
    2. Action
      • Do – select “Do HTTP(s) request”.
      • Interval of action – disable this option to allow an instant response action.
      • HTTP URL – enter the following string:

https://127.0.0.1:7001/ec2/saveEventRule”.

      • HTTP Content – enter the following into the content area:

{

"disabled": false,

"id": "{183ad996-b18b-4baa-98b7-55a849849f73}"

}

      • Content Type – select “application/json”.
      • Login – enter the username of the authorized user.
      • Password – enter the password of the authorized user.
      • Authentication Type – set as “Auto”.
      • Request Method – set as “POST”.
  1. Click the Apply button to save the rule.

 

 

Creating a Disarming Event Rule

To create an Event Rule to disable another rule:

  1. Add a new rule and configure the following:
    1. Event
      • When – select the trigger for the rule (e.g. Input Signal on Camera, I/O module, Soft Trigger, etc.). For this example, we will use a soft trigger.
      • At – select the source camera or device.
      • Availability – if selecting the “Soft Trigger”, select the users who will have access to the soft trigger button.
      • Name – create a name for the soft trigger.
      • Icon – select an icon for the soft trigger.
    2. Action
      • Do – select “Do HTTP(s) request”.
      • Interval of action – disable this option to allow an instant response action.
      • HTTP URL – enter the following string:

https://127.0.0.1:7001/ec2/saveEventRule”.

      • HTTP Content – enter the following into the content area:

{

"disabled": true,

"id": "{183ad996-b18b-4baa-98b7-55a849849f73}"

}

      • Content Type – select “application/json”.
      • Login – enter the username of the authorized user.
      • Password – enter the password of the authorized user.
      • Authentication Type – set as “Auto”.
      • Request Method – set as “POST”.
  1. Click the Apply button to save the rule.

 

 

Camera Rule Results

After creating an Event Rule to arm/enable or disarm/disable a subsequent Event Rule, you can test and check the results in the Event Rules menu.

If you set the When setting to “Soft Trigger”, you can use the soft trigger button while viewing the camera. Observe the target event rule resulting in being enabled (checked) or disabled (unchecked) to confirm that the rule set works.

You can then edit the rule and change the Event > When settings to select a different trigger for the event as needed.

 

 

 

For More Information or Technical Support

DW Technical Support:  866.446.3595 (option 4)

https://www.digital-watchdog.com/contact-tech-support/

______________________________________________________________________________

DW Sales:  866.446.3595                   [email protected]        www.digital-watchdog.com

scroll to top icon