Custom Component: Unifi Protect

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

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.

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.

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

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

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

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) [homeassistant.components.stream.stream.camera.g4_framsidan] Error from stream worker: Error demuxing stream: [Errno 5] I/O error: 'rtsps://192.168.1.1:7441/CsRwS5oKY8gRzelh?enableSrtp'; 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