Samfox2 / homebridge-videodoorbell

Video-Doorbell plugin based on homebridge-camera-ffmpeg for Homebridge.
Apache License 2.0
96 stars 18 forks source link

homebridge-videodoorbell

npm version npm GitHub last commit Donate

Video-Doorbell plugin based on homebridge-camera-ffmpeg for Homebridge

Receive a "doorbell" notification with snapshot to your mobile phone! Use a HTTP request or any other HomeKit button to trigger the event.

Compared to a "simple" camera plugin this plugin uses the HomeKit video doorbell profile. A "doorbell" notification with snapshot is sent to all iCloud connected devices. If the same (HomeKit) room containing this camera also has a Lock mechanism accessory, the notification will show a working UNLOCK button. HomeKit/iOS will link them together automatically when they are in the same room.

Triggering HomeKit rich notifications

You can trigger a HomeKit rich notification from outside with a simple curl command: curl -X POST -d 'ding=dong&dong=ding' http://IP_OF_HOMEBRIDGE_RUNNING_DEVICE:PORT_DEFINED_IN_CONFIG

You can also show a trigger button in HomeKit that activates the doorbell notification. Use the HomeKit automation system to have other buttons or events in HomeKit trigger the doorbell notification.

Installation

  1. Install ffmpeg on your computer, see here a for compilation guide on RasPi: https://github.com/KhaosT/homebridge-camera-ffmpeg/wiki
  2. Install this plugin using: npm install -g homebridge-videodoorbell
  3. Edit config.json and add the camera.
  4. Run Homebridge
  5. Add extra camera accessories in Home app. The setup code is the same as homebridge.

Config.json Example

{
  "platform": "Video-doorbell",
  "cameras": [
    {
      "name": "Camera Name",
      "port": 5005,
      "videoConfig": {
        "source": "-re -i rtsp://myfancy_rtsp_stream",
        "stillImageSource": "-i http://faster_still_image_grab_url/this_is_optional.jpg",
        "maxWidth": 1280,
        "maxHeight": 720,
        "maxFPS": 30
      }
    }
  ]
}

Optional Parameters

global per-camera parameters
{
  "platform": "Video-doorbell",
  "cameras": [
    {
      "name": "Camera Name",
      "port": 5005,
      "button": true,
      "motion": true,
      "throttle": 3000,
      "manufacturer": "ACME, Inc.",
      "model": "ABC-123",
      "serialNumber": "1234567890",
      "firmwareRevision": "1.0",
      "videoConfig": {
        "source": "-re -i rtsp://myfancy_rtsp_stream",
        "stillImageSource": "-i http://faster_still_image_grab_url/this_is_optional.jpg",
        "maxStreams": 2,
        "maxWidth": 1920,
        "maxHeight": 1080,
        "nativeWidth": 1920,
        "nativeHeight": 1080,
        "maxFPS": 30,
        "vcodec": "h264_omx",
        "audio": true,
        "packetSize": 188,
        "debug": true
      }
    }
  ]
}

Using another Video Processor

{
  "platform": "Video-doorbell",
  "videoProcessor": "avconv",
  "cameras": [
    ...
  ]
}
{
  "platform": "Video-doorbell",
  "videoProcessor": "/my/own/compiled/ffmpeg",
  "cameras": [
    ...
  ]
}