Is it just me or are there no automation triggers for the unifi video platform?
Unifi Video can send email/push notification alerts on motion for example. Is this possible within the current API? I read somewhere it used to work but doesn’t any more?
I used to have a sensor with each UniFi camera that indicated its mode, either idle or recording…with motion recording, that could be made to work as a trigger. Bonus points for being able to mask off areas to which you don’t want to pay attention. But I haven’t seen that in a while now.
I came up with a python script that I run as a shell_command when a motion detector (z-wave) is tripped, but I think that’s the reverse direction from what you’re looking for.
d3vilb0y, Just follow the mqtt binary sensor component guide.
I spent about an hour playing with this last night and it works awesome! Did a little automation that when my driveway camera detects motion to turn on the porch light.
Thank you mzac for your work on this. Been waiting for something like this for like a year. LOL, just bought some esp8266 chips and PIR sensors to build my own motion detector unit, but couldn’t figure out a pretty way to set it up on the outside of my house that my wife would be ok with. Now I don’t have to.
Awesome work by you! I only had to make a couple modifications to get it to work for me. First off I installed it on one of the ubiquiti pre-configured UVC-NVR’s which is using an older version of debian so i couldn’t do the systemctl script, but rather did the init script for automatic start at boot. I also am using cloudmqtt as an mqtt broker so I had to add some variables of port, username, and password to the mqtt script. Other than those changes though your instructions were perfect for me.
Haha also found that once it got darker the porch light turning off actually caused another motion event, which in turn caused the light to come back on and it was an infinite loop of on and off. So i created a couple timers. 1st when there is motion triggering the light to come on it also starts a timer of 2 minutes. Once that timer goes from active to idle it triggers another automation to start another 5 second timer, and turn off the light. In my original automation that is turning on the light when it detects motion there is a condition that the 5 second timer can’t be active. This keeps it from automatically coming back on when the light switches off. Really an excellent little system and helps utilize these awesome unifi camera’s full potential.
p.s. I do recommend going into your camera settings and changing the motion sensitivity to a lower setting, and extending the length of time that motion has to be present before triggering an event. Found that dust, and fast flying moth’s were constantly setting off my motion detection.
Got it working now, the debian package of mosquitto_pub is not yet able to specify version as in the ubuntu version (when you try and runt he integrated broker), got disconnected the whole time. so instead i went for the cloudmqtt, cheers for mentioning it Camwise!
Thanks @mzac ! Anyone get this working for more than 1 camera? I have it working for 1 but I have 3 others I’d like it to work for and it doesn’t seem to parse for the other ones…