Skip to main content

TriggerVirtualAlarm

Triggers a virtual alarm input on the NVR. Virtual alarms allow external systems to fire NVR alarm events, triggering recording, push notifications, and alarm output actions just like a physical alarm input.

FieldValue
Endpoint/TriggerVirtualAlarm/{virtualAlarmId}
MethodGET
ProductsNVR only
Request BodyNone
Version Note

v2.0 only. This is an undocumented command discovered through testing. It is not available on v1.9 firmware.


Virtual Alarm ID Calculation​

Virtual alarm IDs start after the physical alarm inputs. If the NVR has 16 physical alarm inputs, then:

Virtual AlarmID
Virtual alarm 117
Virtual alarm 218
Virtual alarm 319
......

Use GetAlarmInInfo to see the full list of physical and virtual alarm inputs and determine the correct ID.


Example​

GET http://{host}:{port}/TriggerVirtualAlarm/{id} with HTTP Basic authentication. These examples use plain HTTP (requests in Python, built-in fetch in Node.js 18+). Read the XML root status attribute and treat only status="success" as success. On any other status, the errorCode attribute is the failure code (errorDesc is included on v2.0). The response root declares xmlns="http://www.ipc.com/ver10", so the samples match tags by local name.

Placeholder host 192.168.1.100, user admin, and password your-password are not a live device.

curl --max-time 5 -u admin:your-password "http://192.168.1.100:80/GetAlarmInInfo"
curl --max-time 5 -u admin:your-password "http://192.168.1.100:80/TriggerVirtualAlarm/17"

Response Example​

<?xml version="1.0" encoding="UTF-8"?>
<config version="2.0.0" xmlns="http://www.ipc.com/ver10" status="success" errorCode="0" errorDesc="Successful"></config>

Use Cases​

  • AI inference boxes -- External AI systems can trigger NVR alarm events when they detect objects or events.
  • Third-party software integration -- Business logic or automation software can trigger NVR recording and push notifications.
  • Home automation -- IoT platforms can trigger NVR alarms based on sensor events (door contacts, motion sensors, etc.).

Example: AI detection box triggering an NVR alarm​

An edge AI device detects an object, then sends a virtual alarm to the NVR with GET /TriggerVirtualAlarm/{id}. The NVR records, bookmarks the event, and pushes a notification, using the actions configured for that virtual input — the same actions a physical alarm input runs (recording, push notification, email, and alarm-output relay).

A detection box typically does this:

  1. At startup, GET /GetAlarmInInfo and keep every id whose alarmInType is virtual. On an NVR with 16 physical alarm inputs, virtual alarm 1 is ID 17.
  2. When the device detects an object, GET /TriggerVirtualAlarm/{id}.
  3. If the NVR does not answer, or the XML root status is not success, retry 3 times, 2 seconds apart.
  4. Log errorCode whenever status is not success.

Recording, bookmarks, push notifications, and relay outputs are configured on the NVR under Alarm settings. The Python and Node.js examples above are the calls that loop makes.


Notes​

  • The virtual alarm behaves identically to a physical alarm input -- it will trigger any configured alarm actions (recording, alarm output relay, push notification, email).
  • Virtual alarm configuration (linked actions, alarm output triggers) is done through the NVR web interface under Alarm settings.
  • This endpoint uses GET rather than POST, making it simple to trigger from scripts, webhooks, or browser-based tools.