Raspberry Pi Homebridge

more

Install nodejs

setup repo

curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -

install Node.js

sudo apt install -y nodejs gcc g++ make python net-tools

test node is working

node -v

Step 2: Install Homebridge and Homebridge UI

sudo npm install -g --unsafe-perm homebridge homebridge-config-ui-x

set to switch on as a service

sudo hb-service install --user homebridge

Install camera

sudo npm install -g homebridge-camera-ffmpeg

mpre

and/or maybe

npm install -g homebridge-ip-camera

connect

http://<ip address of your server>:8581

edit config

/var/lib/homebridge

add to homebridge config:

{
      "platform": "Camera-ffmpeg",
      "cameras": [
        {
          "name": "piCam",
          "uploader": false,
          "videoConfig": {
              "source": "-re -f video4linux2 -i /dev/video0",
              "stillImageSource": "-re -f video4linux2 -ss 0.9 -i /dev/video0 -vframes 1",
              "maxStreams": 2,
              "maxWidth": 1920,
              "maxHeight": 1080,
              "maxFPS": 30,
              "vcodec": "h264_omx"
          }
        }
      ]
    }

add multiple camera

``{ "platform": "Camera-ffmpeg", "cameras": [ { "name": "piCam", "uploader": false, "videoConfig": { "source": "-re -f video4linux2 -i /dev/video0", "stillImageSource": "-re -f video4linux2 -ss 0.9 -i /dev/video0 -vframes 1", "maxStreams": 2, "maxWidth": 1920, "maxHeight": 1080, "maxFPS": 30, "vcodec": "h264_omx" } }, { "name": "piCam", "videoConfig": { "source": "-re -i http://admin:192.168.178.71:8081/usr/bin/motion", "stillImageSource": "-i 192.168.178.71:8081/", "maxStreams": 2, "maxWidth": 1920, "maxHeight": 1080, "maxFPS": 15 } } ] }



# adding motion

`"motion" : true,`

# File storage

try /data/output/Camera1/
/home/ftp/sdcard/Camera1