Custom Component: Unifi Protect

The most beautiful answer of all: It depends!
The username seems to be the same for all: ubnt

If you have a standalone camera its: ubnt/ubnt
If you have adopted the camera into a Video Server the password is located under the Protect app and then Settings and there should be a password setting (sorry dont own a uvds)
Same thing if you own a UDM (Pro)
If you have a UDR then it’s under the Protect app → Settings and look for the Recovery Code

You need to run a seperate ‘server’/docker container to convert the rtsp to webrtc. See https://github.com/deepch/RTSPtoWeb. You need to enter the server ip and port in the setup of the integration.

I tried it, but the provided rtsps streams from the unifi protect integration are not supported.
The provided URL is: rtsps://192.168.1.xx:7441/xxxxxxxxxxxxxxx?enableSrtp
When I manually change the URL to: rtsps://192.168.1.xx:7441/xxxxxxxxxxxxxxx the video is loading. However the WebRTC integration always updates the URL when changing views.

@AngellusMortis Is it possibel to remove the ?enableSrtp from the rtsps URL’s?

1 Like

No. We do not in any way support RTSPtoWeb to for UniFi Protect cameras. We also recommend against the HACS custom component for WebRTC using RTSPtoWeb as it downloads binaries from the Internet without verification.

RTSPtoWeb will never be supported by us directly for UniFi Protect in any capacity as it is a not a viable solution for playing UniFi Protect video feeds (there is never any audio since WebRTC does not support AAC and RTSPtoWeb cannot transcode). The recommended approach is to use LL-HLS or make a PR to pyunifiprotect to add support for the native Protect WebRTC.

If you want to insist on using for RTSPtoWeb, see the dedicated thread for it. People have gotten UniFi Protect cameras working in there.

Has there been any thought on this integration being discovered as a speaker? These could be used in various spots of the house to alerts through them.

Also, big thanks to the team for the Protect integration! Leveraging several rules to notify movement with the cameras. Something that UI took away. Now, 5+ rules per camera. Huge thanks again.

Everything that UniFi Protect exposes for the Smart Chime is already in Home Assistant. There is no interface to interact with the speaker directly.

Updated to version 2022.8 of Home Assistant and suddenly the “auto” camera update for my Unifi Protect Cameras wont work. The snapshot image is not displayed any more in the cards. Instead these are grayed out like the picture shown below.

Nothing is changed on the UniFi Protect side and anonymous snapshot is still enabled on each camera.

Yes I have the same problem. Up until now this integration actually worked with cloud accounts even though it said it didn’t. Unfortunatly that has changed. Deleting the integration and trying to readd it resolves in an “unkown error occurred”. This is within a local network with a local user.

Edit: the Unifi OS Update to 2.5.11 solved this issue for me… among a few other issues in Protect.

Please provide logs. Otherwise, there is nothing that can really be done to help either of you.

You may also consider making a Github Issue

Forgive me if I’ve missed this in the long thread.
Is there a way of going from a smart detection trigger and linking to the relevant thumbnail or video clip.
I see that the video clips are accessible from the media library, but can’t see how you would get the ids from an event.

Ideally I want it to work how I had it setup briefly in the early days of this as a custom component.

so…

  1. Smart detection occurs - I send a notification to telegram with a snapshot of the camera.
  2. When the event finishes - I update the noticification with the thumbnail of the event and provide a link to view the video of the event.

Is this possible ?

What’s the easiest way of achieving it ?

Thanks

Short answer is no.

I have tried to add the feature on 3 separate occasions and the core devs keep telling me different things that need to be implemented. So, I have given up on trying to implement it. Until they decide to overhaul notifications, you will not be able to resolve media items for entities.

1 Like

Thanks for letting me know.
At least I can stop trying.

I have a G4 Doorbell, not Pro - within Protect it notifies me when a package is detected, but does not flag this to the smart detect entity in HA.

E.g. yesterday my doorbell advised that a person was detected, then a package notification was sent. But the entity (sensor.front_doorbell_detected_object) only went from none, through person, back to none.
Are there plans for the integration to capture package detection? Note again, NOT a G4 Doorbell Pro, just the G4 Doorbell.

1 Like

Thanks for all the hard work on this everyone. I recently migrated from Frigate to Unifi Protect and can say it’s much more accurate/reliable for my deployment and love how well it integrates into Home Assistant. However, I really miss the custom frigate-hass-card to display my camera feed and events. I’m curious if anyone is aware of another custom card or a custom lovelace view that could provide a similar experience.

Thanks again!

Why not continue to use the frigate card? I use it to show my protect cameras on my dashboard (using the rtsp feed that unifi provides).

I’ve thought about that, but actually have better results with Unifi’s smart detections than I did with Frigate’s. I’m assuming you are using Frigate for it’s smart detections and Unifi’s at the same time then? Do you ever have a situation in which one or the other doesn’t detect when it should have?

1 Like

I am not currently and my frigate docker container has been shut down for some time now. I simply like the frigate card layout and functionality so I use it for my dashboard camera views. Of course I don’t get the snapshot/clip views etc. If that is what you are looking for then I am not aware of any cards that would give that all that functionality in one package.

Just an fyi, the Protect section under Media does allow you to view a lot of “clips” so there is potential of a specialized card being created in the future to tap into that. There would just need to be someone with the desire and frontend skills to put it together. Maybe one day. @AngellusMortis your thoughts?

The clip gallery is what I’m looking for specifically; the Frigate card is very polished and feature-rich. I’m using the webrtc-card by AlexxIT currently for the camera view.

1 Like

Frigate and other custom components are completely off topic for this post. I can only display things within the bounds of what HA core provides. If you do not like the avaiable Lovelace cards or how the media source works, they are doing month of WTH so go over there and request something better.

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

Thanks…

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