npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-dahua-alerts

v1.3.0

Published

Routes motion alerts for Dahua, Alhua and Lorex camera streams to `homebridge-camera-ffmpeg`

Downloads

102

Readme

homebridge-dahua-alerts

verified-by-homebridge npm version npm total downloads

Routes motion alerts for Dahua, Alhua, Amcrest and Lorex camera streams to homebridge-camera-ffmpeg

Like this plugin? -> Buy me a ☕coffee☕

This plugin only supports VideoMotion alerts, not any SmartMotion detection. You must disable those features in order for this plugin to work correctly. Please check issue #15 if you have compatible hardware and would like to contribute SmartMotion dectection


Confirmed working with: | Dahua DVR | Dahua/Amcrest Standalone Camera | Lorex DVR | | - | - | - | | - | IP3M-943B | - | | - | IP5M-B1186EB | - | | - | DH-IPC-HDW3641TMP | - | | NVR4208-8P | - | - | | - | -| LHV1004 DHV | | DHI-HCVR4116HS-S3 | - | - | | DH-XVR5116HS-X | - | - | | - | DH-IPC-HDBW4631R-S | - | | DHI-NVR4104HS-P-4Ks2 | - | - | | - | - | NR818 | | - | N43AJ52-B | - |

but lots of Dahua/Lorex NVRs and standalone cameras share this VideoMotion api.

Installation

  1. Install Homebridge using the official instructions.
  2. Install homebridge-camera-ffmpeg
  3. Configure your RTSP streams in homebridge-camera-ffmpeg
    1. Configure "porthttp": 8088 for Http-based Automation](https://sunoo.github.io/homebridge-camera-ffmpeg/automation/http.html)
    2. Configure "motion": true for the camera streams you want motion detection
    3. Configure "motionTimeout": 0 to disable automatically resetting the motion after 1 second default
    4. (Optional) Configure "localhttp": true to ensure HTTP automations only work from same device (for enhanced security)
  4. Install homebridge-dahua-alerts.
  5. Configure your NVR and camera settings.
    • Ensure you have enabled https or port 443 on your device if you're getting ECONNREFUSED in the debug logs. Not required by all.

Sample config.json

  • Configuration for one NVR with multiple cameras

homebridge-camera-ffmpeg

{
    "name": "Camera FFmpeg",
    "porthttp": 8088,
    "localhttp": true,
    "cameras": [
        {
            "name": "Driveway",
            "motion": true,
            "motionTimeout": 0,
            "videoConfig": {
                "source": "-i rtsp://admin:<snip>@192.168.1.XX:554/cam/realmonitor?channel=1&subtype=1"
            }
        },
        {
            "name": "Porch",
            "motion": true,
            "motionTimeout": 0,
            "videoConfig": {
                "source": "-i rtsp://admin:<snip>@192.168.1.XX:554/cam/realmonitor?channel=2&subtype=1"
            }
        },
        {
            "name": "Backdoor",
            "motion": true,
            "motionTimeout": 0,
            "videoConfig": {
                "source": "-i rtsp://admin:<snip>@192.168.1.XX:554/cam/realmonitor?channel=4&subtype=1"
            }
        }
    ],
    "platform": "Camera-ffmpeg"
}

homebridge-dahua-alerts

{
    "cameras": [
        {
            "index": 0,
            "cameraName": "Driveway"
        },
        {
            "index": 1,
            "cameraName": "Porch"
        },
        {
            "index": 3,
            "cameraName": "Backdoor"
        }
    ],
    "homebridgeCameraFfmpegHttpPort": 8088,
    "host": "XX.XX.XX.XX",
    "user": "admin",
    "pass": "XX",
    "platform": "dahua-alerts"
}
  • homebridgeCameraFfmpegHttpPort must match the porthttp config in the homebridge-camera-ffmpeg config
  • host is the IP of the NVR or camera
  • user is username of the NVR or camera
  • pass is the password of the NVR or camera
  • useHttp (optional) use HTTP instead of HTTPS to connect to host

For each camera you want to monitor, add a new entry to the cameras array.

  • index if the camera's channel number substracted by 1 (the index starts from 0, the camera channel starts from 1)
  • cameraName must match the name of the camera specified in the homebridge-camera-ffmpeg config

Override Camera Connection Credentials

This is useful if you have standalone IP Camera(s) (not going through an NVR), a mix of IP Cameras and NVR(s), or multiple NVRs.

To define a host/user/pass on a camera simply add the cameraCredentials object. If you have a top level host/user/pass defined, this object will override it.

    "cameras": [
        {
            "index": 0,
            "cameraName": "Driveway"
            "cameraCredentials": {
                    "host": "XX.XX.XX.XX",
                    "user": "admin",
                    "pass": "XX"
            }
        },
  • If using a standalone camera, the index will always be 0

Local development

  • npm run build to get JS output in dist

Credits

Referenced nayrnet/node-dahua-api for the Dahua/Lorex motion alerts API.