Custom Component: Unifi Protect

Wow, wasn’t trying to piss anyone off here.


I think you may be inferring tone that is not there. He is actually pointing you in the right direction. This thread is really for the integration itself and your request is a frontend specific type of request. If you create a WTH request, you’ll definitely get my Vote on that thread.

Thanks for the quick response @AngellusMortis

I’ve also noticed this behavior, but thought it was an issue with my automation. I would also love to see this option available.

The last couple of weeks my HA instalaltion has started consuming a lot of CPU all of a sudden, goes from 4% to 28% and HA becomes unresponsive and a lot of things stops working.

Looking in the log I don’t getany clue but the closets entry to the time when it happens is the following. Does anyone know what it is and what it menas? I have 8 of these for two cameras.

2022-10-26 15:09:45.075 ERROR (stream_worker) [] Error from stream worker: Error demuxing stream: [Errno 5] I/O error: 'rtsps://'; last error log: [tls] The specified session has been invalidated for some reason.

Please post a py-spy (Instructions to install Py-spy on HAOS) and a callgrind.out file from the profiler integration

hi Nick, I see you linking to that final post, which meanwhile is in the middle of much more context in that post. I just copied it into a Community guide, so you can link to that directly :wink:

1 Like

Thank you for your reply. Since that sounded a bit more complicated then I’m capable of I disabled the Protect integration and jsut hours later the same issue happened again so the integration is off the hook and I’m clueless how to fix this again :slight_smile:

I have successfully added the integration and my cameras all show up. I have created a dashboard and placed all my cameras. Good so far. My problem, is that only one camera shows the maximize square within the image and I can’t see what I am missing in the settings for the other cameras

EDIT: It was my error. I use Chrome global dark mode so every page gets a makeover. In some cases. where a site has a dark mode theme available in settings, like the Ubiquity web interface, I sometimes don’t see onscreen controls. I had enabled RTSP for the one camera (by mistake) but I couldn’t see the onscreen switch. Although I could see a snapshot image of the other cameras I was not getting the stream. Once it was enabled in the UI app for each camera, everything works as advertised.

Thanks IMG_20221110_114306899_2

Quick question to everyone.

I use Smart Detection for both Vehicle & Person and wondering if the Motion can be disabled? Or does the HA rely on Motion for Smart detection to work?

Thanks in advance.

I think this entity changes to what type of motion event is true:
It’d be nice if there were individual sensors for each supported detection type.
I made this with the help of others, I forget who, sorry:

  - platform: template
        friendly_name: Front Door Person Detected
        device_class: "motion"
        value_template: "{{ (is_state('sensor.front_door_detected_object', 'person')) }}"

This will be fixed in 2022.12.0. The “Detected Object” sensor has been split out into a single binary sensor for each detection type. Including the new ones for Smoke, CO and License Plates.

The issue before was that the Detected Object sensor could only show a single object and packages almost always came with a person so the person would be shown instead.

The Detected Object sensor will also be deprecated in the new release as well and removed in a future version of HA.



Thanks for the update. Sounds as if any rule to alert based on Person/Object will need to be reworked on 2022.12.0.

Are you planning to update the Smart Detection Blueprint as well? Just curious as I’m assuming this will break the existing one.

How ungrateful, I just realized all of the clips from UniFi Protect are available in in the Media section in HA. Thanks!
All the pieces for my desires are available.
Does anybody have a card that can browse media so I don’t have to navigate away from a security lovelace page for example?
I’d love to have a card for a live camera view and a card to view the clips which are already available in HA.
Thanks if anybody has a card that can show the media browser.

Truly wish there was as well. I love the one Frigate uses and someone requested this feature recently in this thread. They were advised to create a WTH feature request but don’t remember if they ever did. I would certainly vote for a generic way to display media content in a card. :crossed_fingers: that some talented dev can make this happen.


I think it was me. I’m basically asking the same question now realizing that there’s even more data already in HA.

Is there a way to disable the Media component of the Protect Integration. Eg I don’t want the media to be browsable by anyone but admin.

No. There is not. And even if there was, it would not actually prevent users from accessing anything in Protect. Let me put this in bold to properly illustrate the point:

Do not give access to Home Assistant to anyone you do not trust, or that you do not want to have access to everything Home Assistant has access to.

Home Assistant does not have a permission system. The only thing an “admin” account really does for Home Assistant is hide things from the UI. It does not actually really protect anything (some things might check if the user is an admin, but again, the permission system does not really exist).

If you are running HA OS or HA Supervised (anything with Add-on support), an attacker can get your UniFi Protect IP address, username and password in like 30 seconds if they know where to look. Just as I assume you can get the login info for any other external service that does not properly support oauth/OIDC/some other kind of non-password auth as well.

If you want a permission system, see

WTH2 - WTH!? No RBAC - Role Based Access Control? (Users & Groups rights).

I have an unusual issue in that my G4 Doorbell is showing all of the binary sensors as Open/Closed states:

The Show As in the entity properties are left as default:


My G4 Bullet doesn’t have this problem at all and shows these as On/Off:


I’ve tried deleting the integration, rebooting and restarting, but the problem persists.

Does anyone have any ideas?

Man that sux.
I don’t really care about the access. I just want to remove the protect streams from media browser. Surely (don’t call me Sherly) must be some config some place that lets users turn off that kind of thing?