UniFi Protect Blueprints

Below are some officially maintained blueprints for the UniFi Protect integration.

Requirements

To take full effect of this automation blueprint, your Home Assistant instance needs some setup beforehand.

  • UniFi Protect running v2.6.17 or newer
  • Home Assistant Running v2022.12.0 or newer
  • A valid HTTPS certificate and properly configured external URL
    • If you are using Home Assistant Cloud, this is already set up for you.
    • If this is not setup correctly, the actionable notifications and attachments will not appear in the notifications.
    • You do not need your whole Home Assistant to be publicly accessible. Only the paths /api/unifiprotect/* and /api/webhook/* need to be accessible outside of your network.

Doorbell Ring Notifications

Requires a G4 Doorbell or G4 Doorbell Pro

Features

  • Receive notifications when someone rings your doorbell
  • Includes of a thumbnail from the camera at the moment it was rang

Optional features

  • Actionable notification to unlock the door / open a gate and play a TTS message
  • Actionable notification to respond to the person at the door
  • Actionable notification to mute further notifications for a configurable amount of time
  • Include a playback video leading up the doorbell ring. Note May significantly delay the receiving of the notification.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Images

In Home Assistant

In Action

Motion / Smart Detection Notifications

Features

Smart Detections requires a G4, AI or G5 Series camera.

  • Receive notifications when motion or a smart detection event is trigger by one of your UniFi Protect cameras
  • Includes a thumbnail of the event from UniFi Protect
  • If you are using iOS, you can instead stream the camera directly to your device
  • Will automatically update the notification with a video clip of the event after it completes.

Optional features

  • Filter for device tracker to “not be home” before triggering
  • Actionable notification to mute further notifications for a configurable amount of time

Motion / Smart Detection Notifications

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

License Plate Smart Detection Notifications

Requires UniFi Protect v2.7+ and an AI series camera capable of License Plate detection (AI Bullet, AI Theta, or AI DSLR). This the same as the Smart Detection Notification blueprint above, but it is explictly for detecting and displaying License Plates detected by an AI series camera.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Images

In Home Assistant

In Action

image

Source Code / Contributing

You can find the source for the blueprints on Github.

Huge thanks to @hunterjm who I got a lot of great inspiration from to really improve the blueprints a lot for his blueprints for Frigate. My blueprints were oringanly a mess and required like 6 different blueprints and I was able to get them all down to just 2 after looking at his.

23 Likes

Looking good! Glad to hear you were able to get some inspiration from my blueprint. I would recommend adding the optional presence filter to your notifications however. I didn’t have that in my blueprint initially and especially for people with interior cameras, the notifications become very noisy even with cooldown when you are home and walking around inside.

It’s just an optional filter for device tracker entities or groups checking if they are “home” or not before sending the notification.

Thanks for the blueprint! It looks like the timestamp on iOS notifications is 4 hours ahead? Any thoughts on how to set the correct time/offset?

Just checked it and it correct. The logs reflect the correct time and offset. Any ideas on where else to check?

Not sure what was causing this but the timestamps are now correct without any changes. Thanks for the great work!

Regarding the Doorbell notification for Companion App (Android), is there anything special to be done to get the camera image directly in the notification like in the screenshots?

I only get the text (without image)

Thank you for a fast reply.
I found the error. I had an / at the end in my image base url:
E.g : https://HASS-URL/

Has anyone figured out how to get the URL redirect for tapping on a notification to open the UniFi Protect app AND navigate to that specific camera?

If there wasn’t a streaming delay for the camera feeds via HA, I’d stick with viewing through the HA app directly, but since the true live feed is available via the native app, I’d like to tap on it and have it open the UniFi protect app. Is this possible?

I wasn’t, but just enabled LL-HLS.

I’m now seeing about a 2 second delay when preload stream is selected, and 4-5 seconds when preload stream is not selected.

Does this sound right?

@AngellusMortis would it be possible to modify the Blueprint for the smart detections to be based on presence and time? (I’ve been tryign to ask for this repeatedly on the Unifi Forums, but the employees don’t listen, and it used to work before the protect redesign)

i.e.
I am home, but don’t want alerts 6am - 11pm but want alerts from 11pm to 6am.
I am away, I want all alerts.

Thanks for the awesome work on the Blueprints.

Hello again, I am confused on the setup for the Smart Detection blueprint. I have a G4 Doorbell, G4 Pro and a G4 Bullet (all with the official integration) so I should have smart detections. But when I try to use the blueprint, i get “No matching entities found” in the “Smart Dection Entity” section.

Nope. 10 charrrr

1 Like

Thanks for the blueprints. It works really good. One thing that could be useful if clicking notification can open stream. Is this even possible? I am using iOS

The easiest way to do this would be to have the presence filter set in your blueprint, but create a separate automation that is triggered by time which turns on and off the automation created by your blueprint in Home Assistant.

Hey guys,

ich have an Unifi Doorbell pro an with the Doorbell Notification i got only the Picture from the Pakage Camera!? Any chance to switch it to the main Cam?

And can you integrate the option to launch a App on the Phone (Android)?

Thanks!

Rockhound

Nope. 10 charrrr

Hi an Thanks für your reply.

In your blueprint i can only select one Entity (the Doorbell Pro), but i cant select ohne of the Both Cameras.

I make 2 Pictures to show this in your blueprint and in the Device section.

All Apps and Firmwares are up to Date!

By the way, i can open the Protect app on the Phone wehn i put this link in Lovelace View: app://com.ubnt.unifi.protect

I hope you can help me with the Cam Problem.

here the Cam entitys:

Screenshot 2022-04-21 092045

and for the Package-Cam:

Screenshot 2022-04-21 092103