CornerBit / HikSink

Converts Hikvision camera events to MQTT
MIT License
70 stars 7 forks source link

HikSink Logo

GitHub release (latest SemVer) Docker Pulls Docker Image Size (latest by date) GitHub license GitHub Workflow Status

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:

For example, these are the entities discovered on a DS-2CD2185FWD-I IP camera automatically loaded into Home Assistant:

HikSink Discovered Entities

Installation

Option 1: Docker

The easiest way to run HikSink is with the provided Docker image.

  1. Download and modify the sample_config.toml file to include your MQTT and camera details.
  2. 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

  1. Install the rust programming language compiler.
  2. Clone the repository into a folder of your choosing.
    git clone https://github.com/CornerBit/HikSink
  3. Compile the HikSink binary.
    cd HikSink
    cargo build --release
  4. Copy the sample config and modify it to include your MQTT and camera details.
    cp sample_config.toml config.toml
  5. Run it!
    ./target/release/hik_sink

Development

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.