Home Assistant Security Camera Integration
Viewtron AI security cameras integrate with Home Assistant via MQTT auto-discovery. The camera runs all AI processing on-device — license plate recognition, human detection, vehicle detection, and face detection — then sends events to a lightweight bridge that publishes them as native Home Assistant sensors. No Frigate, no Coral TPU, no cloud API, no subscription.
Viewtron IP Camera → HTTP POST (XML) → Viewtron Bridge → MQTT → Home Assistant
The bridge is built on the Viewtron Python SDK and handles both IPC (v1.x) and NVR (v2.0) event formats automatically.
What Home Assistant Receives

When a license plate is detected, two sensors appear on the Viewtron device in Home Assistant:
| Sensor | What It Shows | Example |
|---|---|---|
| License Plate | The plate number that was read | ABC1234 |
| Plate Status | Whether the plate is in the camera's database | Authorized |
The Plate Status sensor has four possible values:
| Status | Meaning |
|---|---|
| Authorized | Plate is on the camera's allow list |
| Blacklisted | Plate is on the camera's block list |
| Temporary | Plate is on the temporary list and within its valid date range |
| Unknown | Plate is not in the camera's database, or a listed plate with an expired date range |
Date range validation applies to all list types — not just temporary plates. An allow list or block list plate with an expired end date will also come through as Unknown. The camera validates dates internally and simply omits the vehicleListType field when a plate is outside its valid range.
Supported Detection Types
| Detection | HA Entity | Status |
|---|---|---|
| License Plate Recognition (LPR) | sensor.viewtron_*_plate + sensor.viewtron_*_plate_status | Tested and supported |
| Human / Vehicle Detection | binary_sensor.viewtron_*_intrusion | Coming soon |
| Face Detection | binary_sensor.viewtron_*_face | Coming soon |
| Object Counting | sensor.viewtron_*_counting | Coming soon |
All detection types use the same bridge architecture. Entities auto-discover via MQTT — no manual YAML configuration in Home Assistant.
What You Can Automate
- Gate and garage access — open gates and garage doors when an authorized license plate is recognized
- Unknown vehicle alerts — send a phone notification with the plate number when an unrecognized vehicle arrives
- Person detection lighting — turn on driveway or porch lights when a person is detected at night
- Intrusion alarms — trigger sirens or alarm panels when someone enters a restricted zone after hours
- Face-based access control — unlock doors when a recognized face is detected
- Vehicle counting — track how many vehicles enter and exit a parking area throughout the day
- PTZ camera presets — move a PTZ camera to a preset position when an event triggers
Installation
Docker (Recommended)
docker run -d --name viewtron-bridge --restart unless-stopped \
--network host \
-e BRIDGE_PORT=5002 \
-e MQTT_BROKER=localhost \
ghcr.io/mikehaldas/viewtron-bridge
| Variable | Default | Description |
|---|---|---|
BRIDGE_PORT | 5002 | Port the bridge listens on for camera HTTP POST events |
MQTT_BROKER | localhost | MQTT broker hostname or IP |
MQTT_PORT | 1883 | MQTT broker port |
MQTT_USERNAME | (empty) | MQTT username (if broker requires auth) |
MQTT_PASSWORD | (empty) | MQTT password |
SAVE_IMAGES | false | Save event images to disk |
Manual Install
git clone https://github.com/mikehaldas/viewtron-home-assistant.git
cd viewtron-home-assistant
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp config.yaml.example config.yaml
# Edit config.yaml with your MQTT broker address
python3 viewtron_bridge.py
For boot persistence, create a systemd service — see the full setup guide on GitHub.
MQTT Broker
The bridge requires an MQTT broker. Most Home Assistant users already have Mosquitto running.
Home Assistant OS: Settings > Add-ons > Add-on Store > search "Mosquitto broker" > Install > Start.
Docker / Linux: Run Mosquitto in Docker:
docker run -d --name mosquitto --restart unless-stopped \
-p 1883:1883 eclipse-mosquitto:2 \
sh -c 'echo -e "listener 1883\nallow_anonymous true" > /mosquitto/config/mosquitto.conf && exec mosquitto -c /mosquitto/config/mosquitto.conf'
Then add the MQTT integration in Home Assistant: Settings > Devices & Services > Add Integration > MQTT.
Camera Setup
1. Configure AI Detection
Enable the detection type you want on your camera. For LPR cameras, enable License Plate Detection and draw the detection zone. For AI cameras, configure intrusion zones with person/vehicle filters.
See the application guides for detection-specific setup instructions, or the HTTP POST Setup guide for webhook configuration.
2. Point HTTP POST at the Bridge
In the camera's web interface, go to Network > HTTP POST > Edit > Add:
- Server IP: the machine running the Viewtron bridge
- Port:
5002(or your configuredBRIDGE_PORT) - Path:
/API
Select the detection types you want forwarded to Home Assistant and click Save.
3. Verify in Home Assistant
The first time a camera sends an event, a Viewtron device appears automatically in Home Assistant under Settings > Devices & Services > MQTT. No restart required.
Example Automations
Open garage door for authorized plates:
- alias: "Open garage for authorized plates"
trigger:
- platform: state
entity_id: sensor.viewtron_ipc_plate_status
to: "Authorized"
action:
- service: cover.open_cover
target:
entity_id: cover.garage_door
Send phone notification for unknown vehicles:
- alias: "Alert on unknown vehicle"
trigger:
- platform: state
entity_id: sensor.viewtron_ipc_plate_status
to: "Unknown"
action:
- service: notify.mobile_app_phone
data:
title: "Unknown vehicle detected"
message: "Plate {{ states('sensor.viewtron_ipc_plate') }} detected"
Turn on lights when person detected at night:
- alias: "Driveway lights on person detection"
trigger:
- platform: state
entity_id: binary_sensor.viewtron_ipc_intrusion
to: "on"
condition:
- condition: sun
after: sunset
action:
- service: light.turn_on
target:
entity_id: light.driveway
How the Bridge Works
The Viewtron bridge is built on the Viewtron Python SDK (pip install viewtron). The SDK parses the camera's XML events into Python objects, and the bridge translates those into MQTT messages with Home Assistant auto-discovery payloads.
- Camera detects an event (plate read, person, face) and sends an HTTP POST with XML data
- Bridge receives the XML and parses it using the
viewtronSDK — version detection is automatic - Bridge publishes the event to MQTT with HA discovery config
- Home Assistant creates/updates sensors automatically
- Your automations trigger based on sensor state changes
The bridge handles both IPC direct (v1.x) and NVR forwarded (v2.0) event formats. You can connect cameras directly to the bridge, or have an NVR forward events from all connected cameras.
Viewtron vs. ONVIF in Home Assistant
Home Assistant's built-in ONVIF integration provides video streaming and basic motion detection. Viewtron cameras support ONVIF for video streams, but the Viewtron integration goes further:
| Capability | ONVIF | Viewtron Integration |
|---|---|---|
| Live video stream | Yes | Use ONVIF for video |
| Basic motion detection | Yes | Yes |
| License plate recognition | No | Yes — plate number, authorization status, plate image |
| Human vs. vehicle classification | No | Yes — AI classifies person, car, motorcycle |
| Face detection | No | Yes — with attributes (age, sex, glasses, mask on NVR) |
| Vehicle attributes | No | Yes — brand, color, type, model (NVR v2.0) |
| Object counting | No | Yes — entrance/exit counts by line or area |
| Plate database management | No | Yes — via Python SDK |
Use both: ONVIF for video streaming in your HA dashboard, and the Viewtron integration for AI detection events and automations.
Managing the Plate Database
The LPR camera maintains an on-camera plate database with allow list, block list, and temporary entries. You can manage plates through:
- Camera web interface — add plates manually or bulk import from CSV
- Viewtron Python SDK — manage plates programmatically:
from viewtron import ViewtronCamera
camera = ViewtronCamera("192.168.0.20", "admin", "password")
# Add an authorized plate
camera.add_plate("ABC1234", owner="Mike", list_type="whiteList")
# Query the database
plates = camera.get_plates()
# Remove a plate
camera.delete_plate("ABC1234")
See the LPR Config API reference for the full plate database API.
Compatible Cameras
Any Viewtron IP camera or NVR with HTTP POST support works with this integration. Recommended models:
| Model | Detection Types | Best For |
|---|---|---|
| LPR-IP4 | License plate recognition | Driveways, gates, parking entrances |
| AI security cameras | Human, vehicle, face detection | Perimeter security, access control |
| NVRs | All types (forwarded from cameras) | Multi-camera systems |
All Viewtron products are NDAA compliant.
Resources
- GitHub: viewtron-home-assistant — bridge source code, Docker image, example automations
- Python SDK: viewtron on PyPI —
pip install viewtron - Docker Image:
ghcr.io/mikehaldas/viewtron-bridge
Related Documentation
- Viewtron Python SDK — the SDK that powers this integration
- License Plate Recognition — LPR application guide with webhook format details
- Human Detection — person and vehicle detection events
- Face Detection — face detection and recognition
- Webhook Event Notification — complete webhook setup reference
- HTTP POST Setup — camera webhook configuration
Video Guides & Blog Posts
- LPR Camera API Setup and Demo — video walkthrough of configuring LPR webhooks and viewing live plate reads
- ANPR / LPR Camera System Overview — camera installation, plate capture zones, and system design
- LPR Camera for Home Use — residential driveway and garage setup with the LPR-IP4
- LPR Camera Installation Best Practices — mounting angles, distances, and IR illumination for reliable plate capture
Questions & Development Inquiries
- Email: mike@viewtron.com
- Phone: 561-433-8488
- Forum: NVR Webhook Setup Guide
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.