HOMEBRIDGE UNIFI PROTECT CAMERA MOTION SENSOR
This Homebridge plugin generates a motion sensor per unifi protect camera that is registered on the provided account.
To experiment with this plugin:
- Checkout the git repo
- Install Homebridge (you can use
npm run install-homebridge)
- Adjust the dummy config under
npm run debug-pluginto start a homebridge instance that points to the local config
To install this plugin simple type
sudo npm install homebridge-unifi-protect-motion-sensors -g --unsafe-perm=true.
Next open the config.json that contains your Homebridge configuration and add a block like the following one to the platforms array:
"platform": "Unifi-Protect-Motion""name": "display-name""room": "room-name""controller": "url-to-controller""username": "firstname.lastname@example.org""password": "password""motionscore": 50"motioninterval": 15000"delay": 500"retries": 2
- The platform name has to be
Unifi-Protect-Motionto link to the plugin.
roomfields are for the display name and room name inside of the HomeKit app.
controllerfield is the bare url where your unifi protect is hosted (cloud key gen2+), most likely
passwordfields are your unifi protect login credentials.
motionscorefield is the minimum score that will register as a motion event. The default in the unifi protect software is 50 (0 to 100, omit the % sign).
- This field is optional and will default to 50 if omitted
motionintervalfield is the amount of milliseconds that are between each check, each check is one call to the unifi protect api. A sane default is 10 or 15 seconds.
- This field is optional and will default to 15000ms (15s) if omitted
retriesfields specify the initial delay between the calls and the amount of retries to the unifi Protect API should any of the calls fail. Each subsequent call will double the previous delay up to the maximum amount of retries specified. 500 milliseconds and 2 retries are a good default.
- Both fields are optional and will default to 500ms and 2
All the motion sensors are automatically enumerated and added as accessories. One for each camera
Each motion sensor will be available as a separate accessory in the Home app.
To enable rich motion notifications:
- Go to the settings of the sensor in the Home app
- Enable notifications for the sensor
- Put the sensor in the same room as the corresponding camera is!
- You can add the unifi cameras to the Home app by following this guide
- whenever motion is detected you will get a notification from the home app with a snapshot from the camera
- Ubiquiti UniFi CloudKey Gen2 Plus - Cloud key with unifi protect functionality
- 2x Ubiquiti UniFi Video UVC-G3-AF - PoE Camera