Homebridge plugin for a web based motion sensor.
npm install homebridge-motionsensor-webI built this for my Ubiquiti UniFi Video cameras. They have motion detection built in and they write to a log file (/var/log/unifi-video/motion.log) when they detect motion. I have built a bash script that you can install as a service to send web requests when logs are written to that file. You can find this in the project /UniFi Video Service/unifi-video-motion-logwatch.sh. I've used systemd to run it as a daemon on my Ubuntu UniFi Video NVR machine. I understand that the official Ubiquiti NVR may run Debian 7 (Wheezy) so systemd may not be available. You will have to use initd. You will also need to change the permission on /var/log/unifi-video/motion.log so that anyone can read the file (chmod a+r /var/log/unifi-video/motion.log).
npm install -g homebridge-motionsensor-web/start and /stop. It also requires a search parameter on the end that specifies the configured sensorName.#### Example Starthttp://{IP_OF_HOMEBRIDGE_SERVER}:{CONFIGURED_PORT}/start?sensorName=MyConfiguredSensorName
#### Example Stophttp://{IP_OF_HOMEBRIDGE_SERVER}:{CONFIGURED_PORT}/stop?sensorName=MyConfiguredSensorName
example.config.json.httpPort - You must provide the port that the plugin will bind to, to listen to web requestsname - Friendly name for the sensorsensorName - The parameter value for parameter sensorName in the web requestmanufacturer - Manufacturermodel - Modelserial - SerialstopDelayMs - Set this to the millisecond value you want to delay the stop event from firing after it has fired. (Now that I look at this, I don't really use this, probably can take it out.) DEFAULT: 1500startAfterStopFuseMs - Set this to a millisecond value. This will prevent any new start motion events from firing (for the given time) after the last start motion event. I created this as my cameras would trigger a motion start, then I will turn on a light, and then leave them on for 5 minutes, and then turn off the light. When the light turns off it triggers another motion start event, so would get stuck in a loop. I resolved it by using this and setting it to 5 minutes plus 10 seconds. DEFAULT: 750