All Projects → mzac → unifi-video-mqtt

mzac / unifi-video-mqtt

Licence: GPL-3.0 License
No description or website provided.

Programming Languages

shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to unifi-video-mqtt

Mqttnet
MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
Stars: ✭ 2,486 (+5550%)
Mutual labels:  mqtt, mqtt-server
Emqx
An Open-Source, Cloud-Native, Distributed MQTT Message Broker for IoT.
Stars: ✭ 8,951 (+20243.18%)
Mutual labels:  mqtt, mqtt-server
ccu-addon-mosquitto
Mosquitto packaged as Addon for the Homematic CCU3 and RaspberryMatic
Stars: ✭ 23 (-47.73%)
Mutual labels:  mqtt
laav
Asynchronous Audio / Video Library for H264 / MJPEG / OPUS / AAC / MP2 encoding, transcoding, recording and streaming from live sources
Stars: ✭ 50 (+13.64%)
Mutual labels:  mqtt
swifitch-software
Software for SWIFITCH HW
Stars: ✭ 12 (-72.73%)
Mutual labels:  mqtt
rpi2mqtt
Connect RaspberryPi GPIOs and 1-Wire temperature sensors to MQTT 🍰🔘📡
Stars: ✭ 20 (-54.55%)
Mutual labels:  mqtt
GoogleSpeak
No description or website provided.
Stars: ✭ 14 (-68.18%)
Mutual labels:  mqtt
zwave-core
Flexible Z-Wave Service Server - Access your Z-Wave nodes fast and independent - Planned/supported: REST-API, Browser UI, MQTT* - Perfect for maintaining big node-numbers, drop-in ozwcp replacement!
Stars: ✭ 19 (-56.82%)
Mutual labels:  mqtt
tutorials.IoT-over-MQTT
📙 FIWARE 203: Provisioning Ultralight with an alternative transport: IoT over MQTT
Stars: ✭ 49 (+11.36%)
Mutual labels:  mqtt
sonos2mqtt
🔈 Sonos mqtt controller. Control your speakers from your mqtt server. mqtt-smarthome insprired.
Stars: ✭ 50 (+13.64%)
Mutual labels:  mqtt
texecom2mqtt-hassio
Home Assistant add-on. Connect to Texecom Premier Elite alarm panels and publish updates to MQTT. Supports arming/disarming as well as zone updates and alarm events.
Stars: ✭ 15 (-65.91%)
Mutual labels:  mqtt
server
MyController 2.x server
Stars: ✭ 14 (-68.18%)
Mutual labels:  mqtt
gatling-mqtt
A Gatling stress test plugin for MQTT
Stars: ✭ 37 (-15.91%)
Mutual labels:  mqtt
BLE-Beacon-Tracking-System
Indoor Beacon Tracking System based on BLE
Stars: ✭ 18 (-59.09%)
Mutual labels:  mqtt
ocaml-mqtt
MQTT client for OCaml/ReasonML
Stars: ✭ 14 (-68.18%)
Mutual labels:  mqtt
MQTT.jl
An asynchronous MQTT client library for julia
Stars: ✭ 15 (-65.91%)
Mutual labels:  mqtt
homely
🏠 - A bunch of mosquittos. IoT wiring and notification framework, with an unix style.
Stars: ✭ 15 (-65.91%)
Mutual labels:  mqtt
rpi-enviro-mqtt
Send air quality data from a Pimoroni RPi Enviro+ over MQTT
Stars: ✭ 30 (-31.82%)
Mutual labels:  mqtt
mqtt-datasource
MQTT Datasource for Grafana allows streaming data from any MQTT broker running either locally or remotely.
Stars: ✭ 99 (+125%)
Mutual labels:  mqtt
jMQTT
Jeedom plugin to interface as a client with an MQTT broker.
Stars: ✭ 16 (-63.64%)
Mutual labels:  mqtt

unifi-video-mqtt

Introduction

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 Protect

If you are looking for Unifi protect please see this fork:

Reference

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

1559209064.179 2019-05-30 19:07:44.179/ACST: INFO   [uv.analytics.motion] [AnalyticsService] [REDACTED|Front Door] MotionEvent type:start event:17 clock:14369834 in AnalyticsEvtBus-0
1559209090.983 2019-05-30 19:08:10.983/ACST: INFO   [uv.analytics.motion] [AnalyticsService] [REDACTED|Front Door] MotionEvent type:stop event:17 clock:14396566 in AnalyticsEvtBus-1

Todo

  • Re-write in Python as it might be more efficient

Requirements

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

Installation

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 https://github.com/mzac/unifi-video-mqtt.git
cd /tmp/unifi-video-mqtt
cp unifi-video-mqtt.sh /usr/local/bin
chown unifi-video:unifi-video /usr/local/bin/unifi-video-mqtt.sh
chmod a+x /usr/local/bin/unifi-video-mqtt.sh
cp unifi-video-mqtt.service /etc/systemd/system
systemctl daemon-reload
systemctl enable unifi-video-mqtt

IMPORTANT!!!

Before starting the service, make sure to edit /usr/local/bin/unifi-video-mqtt.sh with your specific settings:

# MQTT Vars
MQTT_SERVER="192.168.x.x"
MQTT_PORT="1883"
MQTT_TOPIC_BASE="camera/motion"

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

# Camera Defs
CAM1_NAME="camera_name"
CAM1_ID="F0xxxxxxxxxx"

Test it to make sure it works:

/usr/local/bin/unifi-video-mqtt.sh

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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].