Skip to main content

Active Deterrent Sound & Light Alarm API

Viewtron AI security cameras with active deterrent features include built-in sirens, red and blue strobe lights, and two-way audio speakers that can be controlled via the HTTP API. Unlike webhook-based detections where the camera pushes events to your server, active deterrent control uses outbound API calls — your application sends HTTP requests to the camera to trigger or configure audio and light alarms.

The real power of active deterrent API control comes from combining it with AI detection webhooks. You can build a fully automated deterrence system: receive a human detection or intrusion webhook, verify the event in your application logic, then immediately trigger the camera's siren and strobe lights via API call — all running on local hardware with no cloud dependency. All Viewtron IP cameras and NVRs are NDAA compliant.

What You Can Build

  • Automated intruder deterrence — detect a person via intrusion detection webhook, then trigger siren and strobe lights on the same camera
  • Scheduled siren tests — periodically test active deterrent hardware via API to confirm operation
  • Multi-camera deterrence chain — detect intrusion on one camera, trigger alarms on multiple cameras in the area
  • Alarm panel integration — connect camera deterrent features to existing alarm and building management systems
  • Progressive response — start with white light, escalate to red/blue strobe, then activate siren based on dwell time
  • Two-way audio warnings — combine with audio alarm configuration for speaker-based verbal warnings

How It Works

  1. Verify camera supports active deterrent — not all models have sirens and strobe lights (check product specs)
  2. Read current configuration — use GetAudioAlarmOutConfig and GetWhiteLightAlarmOutConfig to see available settings
  3. Receive a detection webhook — your server receives an intrusion, line crossing, or other AI detection event
  4. Evaluate the event — check target type, confidence, time of day, or other criteria in your application logic
  5. Trigger deterrent via API — send HTTP requests to the camera to activate siren, strobe, or both
  6. Reset after timeout — deactivate the deterrent after a configurable period

Active Deterrent Endpoints

EndpointPurposeVersion
GetAudioAlarmOutConfigRead siren/audio alarm configurationv2.0 only
GetWhiteLightAlarmOutConfigRead white light/strobe alarm configurationv2.0 only
note

These endpoints are read-only configuration commands documented in API v2.0. Direct triggering of siren and strobe outputs works through the alarm output relay system or by combining detection rules with alarm actions configured on the camera. The ManualAlarmOut endpoint can also be used to trigger the relay output which may be wired to external sirens or lights.

Combining Detection Webhooks with Deterrent API Calls

The most common use case is an event-driven pipeline:

Camera detects person → Webhook POST to your server → Your logic decides →
API call back to camera → Siren/strobe activates

This requires two types of API interaction:

  1. Inbound webhooks (camera pushes to your server) — detection events with images
  2. Outbound API calls (your server sends to camera) — trigger alarm outputs

Parsing Detection Events and Triggering Deterrents

The simplest way to receive detection events and trigger deterrents. The SDK's ViewtronServer handles incoming webhooks while ViewtronCamera sends outbound alarm commands:

pip install viewtron
from viewtron import ViewtronServer, ViewtronCamera
import os
import threading

IMG_DIR = "images"
os.makedirs(IMG_DIR, exist_ok=True)

# Camera credentials for outbound API calls
camera = ViewtronCamera("192.168.0.55", "admin", "password")
ALARM_DURATION = 10

def on_event(event, client_ip):
if event.category != "intrusion":
return
print(f"Intrusion detected from {client_ip} — triggering deterrent")
print(f" Type: {event.get_alarm_description()}")

overview = event.get_source_image_bytes()
if overview:
with open(f"{IMG_DIR}/{event.get_time_stamp()}-deterrent-overview.jpg", "wb") as f:
f.write(overview)

# Trigger alarm relay on camera
camera.set_alarm_out(True)
threading.Timer(ALARM_DURATION, lambda: camera.set_alarm_out(False)).start()

server = ViewtronServer(port=5002, on_event=on_event)
server.serve_forever()

See the Python SDK reference for the full list of methods and event classes.

Known Firmware Bug

On IPC cameras, the firmware forcibly resets the alarm output when a perimeter alarm cycle ends, even when alarm output mode is set to manual_alarm and triggerAlarmOut is unchecked. This makes ManualAlarmOut unreliable for automation while perimeter detection is active on the same camera. NVR alarm outputs are not affected by this bug.

Relevant API Endpoints

EndpointPurposeReference
GetAudioAlarmOutConfigRead audio/siren alarm configuration (v2.0)Sound & Light Config
GetWhiteLightAlarmOutConfigRead white light/strobe alarm configuration (v2.0)Sound & Light Config
ManualAlarmOutTrigger or release alarm relay outputAlarm Input/Output Config
GetAlarmOutConfigRead alarm output relay configurationAlarm Input/Output Config
SetHttpPostConfigConfigure webhook destination for detection eventsWebhook Config

Integrations

Viewtron active deterrent cameras also integrate with automation platforms via published packages:

PlatformPackageWhat It Does
Home Assistantviewtron-home-assistantDetection events as native HA sensors — trigger deterrents via HA automations
Node-REDnode-red-contrib-viewtronDetection events direct to Node-RED flows — build deterrent logic visually

Questions & Development Inquiries

Mike Haldas is available for questions, consultation, and custom software development for Viewtron API related projects. Email details about your project to mike@viewtron.com.