hms-nvr
A tiny C++ service that watches your Amcrest cameras and turns their event streams into clean MQTT messages. Motion, doorbell rings, and camera-down alerts land on your broker in real time — ready for Home Assistant, YOLO detection, or n8n automations. Just ~230 KB at runtime.
What it does
One small daemon between your cameras and your automations.
Amcrest event streams
Long-polls each camera's HTTP event stream over libcurl with digest auth — no cloud, no polling APIs, just the events the camera already emits.
Clean MQTT events
Publishes motion start/stop, doorbell rings (PhoneCallDetect), and camera-down alerts as compact JSON payloads on predictable topics.
Multi-camera & resilient
Monitor any number of cameras with per-camera event filters. Motion dedup suppresses duplicates and connection alerting fires after repeated failures.
Get it running
Pull the image, point it at a YAML config, and you are publishing events.
Run with Docker
docker run -d \
-v ./config/hms-nvr.yaml:/etc/hms-nvr/hms-nvr.yaml:ro \
-p 8898:8898 \
ghcr.io/hms-homelab/hms-nvr:latest A health endpoint at http://localhost:8898/health reports per-camera connection state and MQTT status.
Configure a camera
cameras:
- id: "front_door"
name: "Front Door"
host: "192.168.2.43"
username: "admin"
password: "password"
events:
- VideoMotion
- PhoneCallDetect
enabled: trueMQTT topics
camera/event/motion/start {"camera_id":"patio"}
camera/event/motion/stop {"camera_id":"patio"}
camera/event/doorbell {"camera_id":"front_door"}
hms_nvr/alert/camera_down {"camera_id":"...","failures":N}
hms_nvr/status online / offline (retained) Pairs with hms-detection for YOLO inference: it consumes motion/start, grabs RTSP frames, and publishes results an n8n workflow can turn into phone notifications. Set publish_motion_stop: false when using it.
Open source & MIT licensed
Grab the source, the prebuilt container, the systemd unit, and the example config — everything you need to wire Amcrest cameras into your home automation stack.