HikSink streams Hikvision camera and NVR events (motion, line crossing, tamper, illegal logins, etc.) to MQTT messages for consumption by home automation software like Home Assistant. Some key features of HikSink are:
- Easy Camera Authentication: Supports digest authentication used by default by Hikvision so you don't need to lower your security settings.
- Full Event Type Support: Automatically learns event types that HikSink doesn't yet know about.
- Home Assistant Integration: Supports the Home Assistant MQTT discovery protocol. Provides offline notifications for individual cameras.
- Failure hardened: Connections to cameras lost due to network issues or exceptions are automatically reestablished.
- Low CPU and memory footprint: Written in Rust and requires less than 20 MB of memory. Can easily run on a Raspberry Pi.
For example, these are the entities discovered on a DS-2CD2185FWD-I IP camera automatically loaded into Home Assistant:
Option 1: Docker
The easiest way to run HikSink is with the provided Docker image.
- Download and modify the sample_config.toml file to include your MQTT and camera details.
- Run the docker container.
docker run -d \ --name=hiksink \ --restart=unless-stopped \ -v <path/to/config.toml>:/app/config.toml \ cornerbit/hiksink:latest
Option 2: Running Standalone
- Install the
rustprogramming language compiler.
- Clone the repository into a folder of your choosing.
git clone https://github.com/CornerBit/HikSink
- Compile the HikSink binary.
cd HikSink cargo build --release
- Copy the sample config and modify it to include your MQTT and camera details.
cp sample_config.toml config.toml
- Run it!
A dev container is provided to ease setup and testing. It's optional, but brings along a working Home Assistant instance, MQTT server, and the rust compiler.
Some tests use the insta snapshot testing library. This is installed automatically in the dev container.