Skip to main content

Node-RED IP Camera Integration

The Viewtron AI Camera node for Node-RED receives AI detection events directly from Viewtron IP cameras and outputs structured JSON messages. License plate recognition, human detection, vehicle detection, face detection, and people counting — all processed on the camera with no cloud service, no middleware, and no bridge required. The camera posts events directly to your Node-RED flow.

Viewtron IP Camera --> HTTP POST (XML) --> Viewtron AI Camera node --> JSON --> Your Flow

Viewtron AI Camera node in Node-RED with live LPR events

Install

Install from the Node-RED palette manager or the command line:

Palette Manager: Menu > Manage palette > Install > search node-red-contrib-viewtron

Command line:

cd ~/.node-red
npm install node-red-contrib-viewtron

npm: node-red-contrib-viewtron

How It Works

Viewtron AI cameras run all detection on-device and push HTTP POST events when they detect a license plate, person, vehicle, or face. The Viewtron AI Camera node creates an HTTP listener on a configurable port. When the camera sends an event, the node parses the XML payload and outputs a structured JSON message to the appropriate output.

No middleware, no bridge, no cloud API — the camera connects directly to the Node-RED node over your local network.

Outputs

The node has 5 outputs, one per detection category:

OutputCategoryKey Fields
1LPRplate_number, plate_status (Authorized / Blacklisted / Temporary / Unknown), vehicle (brand, color, type)
2Intrusiontarget_type (person, car, motorcycle), event_id, status
3Faceface.age, face.sex, face.glasses, face.mask
4Countingtarget_type, boundary
5OtherVideo metadata and unclassified events

Wire each output to the flow logic you need — separate handling for plates vs. people vs. faces.

Common Fields

Every event message includes:

FieldDescription
msg.payload.event_typeRaw alarm type from camera (e.g., VEHICE, PEA)
msg.payload.categoryNormalized category: lpr, intrusion, face, counting, metadata
msg.payload.camera_ipIP address of the camera that sent the event
msg.payload.timestampEvent timestamp from the camera
msg.topicSet to viewtron/{category} for easy MQTT republishing

Images

When Original picture and Target picture are enabled on the camera, msg.payload.source_image (full scene) and msg.payload.target_image (cropped detection target) are included as base64 JPEG strings. These payloads can be large (300KB+) — leave the camera image options unchecked if you only need the detection data.

The Include images checkbox on the node controls whether images are passed through to the output or stripped.

What You Can Build

  • Gate and garage access — read license plates and trigger relay nodes to open gates for authorized vehicles
  • Unknown vehicle alerts — send Telegram, email, or push notifications when an unrecognized plate is detected
  • Person detection lighting — trigger smart lighting when a person is detected in a zone
  • Intrusion alarms — wire to siren or alarm panel nodes when someone enters a restricted area
  • Vehicle counting dashboards — feed counting data to InfluxDB + Grafana for parking or traffic analytics
  • MQTT republishing — forward structured events to an MQTT broker for consumption by Home Assistant, AWS IoT, or other subscribers
  • Multi-camera routing — use Switch nodes to route events by camera IP, detection type, or plate status

Camera Setup

1. Add the Node to Your Flow

Drag the Viewtron AI Camera node from the palette onto the canvas and set the listen port (default: 5002).

2. Configure HTTP POST on the Camera

Open your camera's web interface and navigate to Network > Advanced > HTTP Notification.

Viewtron camera HTTP POST settings

Set the Push Protocol Version to V1, then click Add to create a server entry.

Push Protocol Version

The camera's HTTP POST settings have a Push Protocol Version dropdown. You must select V1. The V2 protocol sends alarm status events but images don't come through reliably.

3. Configure the Server Connection

HTTP POST server configuration

SettingValue
EnableChecked
Domain/IPYour Node-RED machine's IP address
Server PortPort configured in the node (default: 5002)
Path/API
Connection TypePersistent connection
Send HeartbeatChecked
Heartbeat Interval30 seconds
Smart Alarm DataCheck Smart event data
Original pictureOptional — include full scene image in events
Target pictureOptional — include cropped target image in events
Smart Alarm TypeSelect the detection types you want (e.g., License Plate Detection)

Click Save, then deploy your flow in Node-RED. The camera must be rebooted after initial HTTP POST configuration changes.

Connection Status

The camera maintains a persistent HTTP connection and sends heartbeats to confirm the server is reachable. The node status shows a green dot when listening and updates with the latest event data (e.g., plate number and status).

Plate Status

The LPR camera maintains an on-device plate database. Each detected plate is matched against the database and assigned a status:

StatusMeaning
AuthorizedPlate is on the camera's allow list
BlacklistedPlate is on the camera's block list
TemporaryPlate is on a temporary list with a valid date range
UnknownPlate is not in the database, or a listed plate with an expired date range
Date Range Validation

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.

Plates are added to the camera's database through its web interface or via the Viewtron API.

Example: LPR Gate Access

Import this flow to get started with license plate gate access control. The Viewtron AI Camera node reads plates, and a Switch node routes authorized vehicles to one action and unknown vehicles to another.

[
{
"id": "viewtron1",
"type": "viewtron-camera",
"name": "Gate Camera",
"port": "5002",
"includeImages": false,
"wires": [["switch1"], [], [], [], []]
},
{
"id": "switch1",
"type": "switch",
"name": "Authorized?",
"property": "payload.plate_status",
"rules": [
{"t": "eq", "v": "Authorized"},
{"t": "eq", "v": "Unknown"}
],
"outputs": 2,
"wires": [["gate_open"], ["notify"]]
},
{
"id": "gate_open",
"type": "debug",
"name": "Open Gate"
},
{
"id": "notify",
"type": "debug",
"name": "Alert: Unknown Vehicle"
}
]

Replace the debug nodes with your actual gate control and notification nodes. The msg.payload.plate_number field is available in both outputs for logging or display.

Supported Event Types

IPC v1.x (Direct from Camera)

Alarm TypeCategoryDetection
VEHICE / VEHICLElprLicense plate recognition
VFDfaceFace detection
PEAintrusionPerimeter intrusion
AOIENTRYzone_entryZone entry
AOILEAVEzone_exitZone exit
LOITERloiteringLoitering detection
PASSLINECOUNTcountingPeople/vehicle counting

NVR v2.0 (Forwarded via NVR)

Alarm TypeCategoryDetection
vehiclelprLPR with vehicle brand, color, type, model
videoFaceDetectfaceFace with age, sex, glasses, mask attributes
regionIntrusionintrusionPerimeter intrusion
lineCrossingline_crossingTripwire line crossing
targetCountingByLinecountingCounting by line
targetCountingByAreacountingCounting by area

Version detection is automatic — the node handles both IPC and NVR formats transparently.

Node Settings

SettingDefaultDescription
Port5002HTTP listener port for camera events
Include imagesOffPass base64 JPEG images through to output (source_image, target_image)

Node-RED vs. Home Assistant

Both integrations receive the same camera events. Choose based on your use case:

Node-REDHome Assistant
ArchitectureCamera → Node-RED (direct)Camera → Bridge → MQTT → HA
Best forCustom logic, industrial automation, dashboards, multi-system integrationSmart home automations, mobile notifications, device control
Setupnpm install, drag nodeDocker container + MQTT broker
ProgrammingVisual flow editorYAML automations or HA UI
MQTTOptional (can republish)Required

You can run both — point the camera's HTTP POST at Node-RED, then use Node-RED's MQTT output to also feed events into Home Assistant.

Compatible Cameras

Any Viewtron IP camera or NVR with HTTP POST support works with this node. Recommended models:

ModelDetection TypesBest For
LPR-IP4License plate recognitionDriveways, gates, parking entrances
AI security camerasHuman, vehicle, face detectionPerimeter security, access control
NVRsAll types (forwarded from cameras)Multi-camera systems

All Viewtron products are NDAA compliant.

Resources

Video Guides & Blog Posts

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.