No description or website provided.
Branch: master
Clone or download
mzac Update for Unifi Video 3.10
Updated for unifi video 3.10, haven't had a chance to test it but it should work
Latest commit 5bbcc01 Feb 1, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
Dockerfile Create Dockerfile Jan 4, 2019
LICENSE Update Dec 15, 2018 Update Dec 15, 2018
unifi-video-mqtt.service Create unifi-video-mqtt.service Jun 20, 2018 Update for Unifi Video 3.10 Feb 1, 2019



This script can run on your Unifi Video server and push MQTT messages to a broker when motion is detected.

This can be useful for systems like Homeassistant that are lacking motion detection integration with Unifi Video.

Currently, the script is only setup for one camera but others can be added easily by modifying the script.


Unifi Video writes to /var/log/unifi-video/motion.log and it ouputs logs like this. This script parses this log:

1529536461.847 2018-06-20 19:14:21.847/EDT: INFO   Camera[F0xxxxxxxxxx] type:start event:13 clock:11856432 (Front Door) in ApplicationEvtBus-7
1529536479.865 2018-06-20 19:14:39.865/EDT: INFO   Camera[F0xxxxxxxxxx] type:stop event:13 clock:11874454 (Front Door) in ApplicationEvtBus-16


  • Unifi Video Server
  • MQTT Client
  • MQTT Server
  • Inotify Tools


The installation should be done on your server that is running Unifi video

Debian based install

apt install -y inotify-tools mosquitto-clients
cd /tmp
git clone
cd /tmp/unifi-video-mqtt
cp /usr/local/bin
chown unifi-video:unifi-video /usr/local/bin/
chmod a+x /usr/local/bin/
cp unifi-video-mqtt.service /etc/systemd/system
systemctl daemon-reload
systemctl enable unifi-video-mqtt


Before starting the service, make sure to edit /usr/local/bin/ with your specific settings:

# MQTT Vars

# MQTT User/Pass Vars, only use if needed
#MQTT_ID="yourid"  ## To make it work with hassio

# Camera Defs

Test it to make sure it works:


Create some motion on your camera and subscribe to your MQTT server and see if you see motion:

root@pi3:~# mosquitto_sub -h 192.168.x.x -t "camera/motion/#" -v
camera/motion/front_door on
camera/motion/front_door off

Once all changes are done, go ahead and start the daemon

systemctl start unifi-video-mqtt