Skip to main content

Vehicle Detection & Parking Management API

Viewtron AI security cameras include built-in illegal parking detection (PVD) that runs entirely on the camera hardware — no cloud service or external AI software required. When a vehicle parks in a designated prohibited zone and remains beyond a configurable time threshold, the camera sends an HTTP POST webhook to your server with the detection event data, including images of the violation.

Parking violation detection (PVD) is distinct from license plate recognition (LPR) — PVD detects the presence of a stationary vehicle in a prohibited zone, while LPR reads the plate number from a moving or stationary vehicle. PVD is also distinct from general vehicle detection via intrusion detection, which detects a vehicle entering a zone but does not track how long it remains parked. All Viewtron IP cameras and NVRs are NDAA compliant.

Testing Status

PVD (illegal parking detection) has not been fully tested via HTTP Post webhook delivery. The camera configuration endpoint GetSmartPvdConfig is confirmed working, and the IPC smartType PVD is documented. The webhook XML format is expected to follow the same CommonImagesLocation pattern as other IPC smart detection events. This page will be updated as testing is completed.

What You Can Build

  • No-parking zone enforcement — detect vehicles that park in fire lanes, handicapped zones, or restricted areas
  • Loading zone monitoring — alert when a vehicle exceeds the allowed time in a loading dock or delivery zone
  • Fire lane compliance — automated monitoring of fire lanes with violation logging and image capture
  • Parking lot management — track illegal parking in reserved spots, employee-only areas, or visitor zones
  • Tow company integration — automatically notify towing services when a parking violation exceeds a threshold
  • Municipal parking enforcement — log violations with timestamped images for citation evidence

How It Works

  1. Configure a parking violation zone on the camera — define a polygon region where parking is prohibited
  2. Set the dwell time threshold — configure how long a vehicle must remain parked before triggering an alert
  3. Enable HTTP POST webhooks — point the camera at your server's IP and port
  4. Your server receives XML when a violation occurs — the POST includes the PVD event data with images
  5. Parse the event using the Viewtron Python SDK (pip install viewtron) or Node.js SDK
  6. Take action — save violation images, log to CSV, send alerts, or trigger enforcement workflows

Event Data Included

Each parking violation webhook POST is expected to contain:

FieldDescription
smartTypePVD (IPC illegal parking detection)
boundaryPolygon coordinates of the prohibited parking zone
rectBounding box of the detected vehicle
eventId / targetIdUnique IDs for the event and tracked target
statusSMART_START, SMART_PROCEDURE, or SMART_STOP
sourceBase64DataFull-frame JPEG image (base64 encoded)
targetBase64DataCropped vehicle JPEG image (base64 encoded)
currentTimeDetection timestamp

Parsing Parking Violation Events

The simplest way to receive parking violation events. The SDK's ViewtronServer handles HTTP connections, keepalives, XML parsing, and version detection — you just write the callback:

pip install viewtron
from viewtron import ViewtronServer
import os

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

def on_event(event, client_ip):
if event.category != "intrusion":
return
# PVD events use the intrusion category with PVD alarm type
if event.get_alarm_type() not in ("PVD", "illegalParking"):
return
print(f"Parking violation detected from {client_ip}")
print(f" Type: {event.get_alarm_description()}")
print(f" Time: {event.get_time_stamp_formatted()}")

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

target = event.get_target_image_bytes()
if target:
with open(f"{IMG_DIR}/{event.get_time_stamp()}-parking-violation-vehicle.jpg", "wb") as f:
f.write(target)

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.

Relevant API Endpoints

EndpointPurposeReference
GetSmartPvdConfigRead parking violation detection zone configurationParking Violation Config
SetHttpPostConfigConfigure webhook destinationWebhook Config
GetAlarmStatusPoll current alarm stateAlarm Status

Integrations

Viewtron vehicle detection also integrates with automation platforms via published packages:

PlatformPackageWhat It Does
Home Assistantviewtron-home-assistantVehicle detection events as native HA sensors — automate gates, alerts, notifications
Node-REDnode-red-contrib-viewtronVehicle detection events direct to Node-RED flows — no middleware needed

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.