Page 1 of 1

Unifi Protect

Posted: Monday 01 July 2024 11:41
by CronoS
Hi,

I am just recently using Unifi Protect with two G5 Flex camera's around my house and now I want to extend this setup where I want to buy a Unifi G4 Protect doorbell. I do not mind to use the Unifi Protect app for controling or configuring the doorbell, but I do want to have a trigger in Domoticz when the doorbell is pushed. This for external lighting for example. Anyone familiar if it is possible to connect Unifi Protect using Domoticz?

At this moment I use a Shelly 1 in combination with a push button, that works OK but I want to change this..

Re: Unifi Protect

Posted: Wednesday 03 July 2024 21:06
by heggink
Hey CronoS,
It takes a little work but you can make it happen. You will need: Homebridge, a unifi cloud key (ucpk) where you connect your unifi defices. Since you have camera's, I assume you have one, a mosquitto broker and node-red.
Here's what I did:
  • install node-red (I run it in a container on my NAS)
  • install mosquitto (same, container)
  • install homebridge (same, container)
  • install the Homebridge UniFi Protect plugin and configure it to connect to your uckp using a LOCAL ADMIN (follow instructions to bypass 2FA) as well as an MQTT broker
From now, the homebridge plugin will post all activity on the mqtt broker where you can subscribe to any activities (motion on your camera's, doorbell presses).

Once that's up and running, you can build a simple node red flow to subscribe to the topic you want to monitor. In my case, I track motion as well as doorbell presses. WIthin node-red, there are nodes that subscribe to topics, functions that can check messages and otehrs that can call domotcz to activate a switch (I sens messages through mqtt to domoticz to activate a switch rather than calling a URL but both work equally well).

Let me know if you need any help setting it up. Not sure if there are more efficient ways but this at least works for me and works really well.