Custom Component: Unifi Protect

@AngellusMortis Happy Sunday sir. Hoping you can assist with getting Protect cameras integrated with the RtspWebrtc addon.

I kept getting stream errors once I added any of my Unifi cameras. After some playing around, I realized that when I edited the camera links in the RTSPWeb server addon, it was displaying the rtsps link. I always assumed the Protect integration used the non secure rtsp:// urls for the streams. I don’t believe that rtsps streams are compatible with webrtc.

Is there any way I can have the Protect integration use the rtsp stream instead? I realize that I can manually create these entities myself but it just feels unnecessary since I already have the streams being pulled in via the is awesome Protect integration. Any advice?

Use insecure ones which are disabled by default.

Thanks for that. Didn’t know there was a separate disabled camera feed.

Unfortunately I gave up on the addon once I realized it doesn’t support external access to the cameras without jumping through hoops. Reverted to the AlexxIT custom component.

Can I ask a question? How much delay you are seeing on Lovelace dashboard while these cameras are loading?

So I went ahead and deleted the HACS integration and rebooted HA as instructed. Protect was automagically added to the official integrations after rebooting. Nothing to worry about in the end. All working well (so far). Still no “pyunifiprotect” to be found no my system though.

Hmm, you’re right. Doesn’t appear to change state i.e. “none”.

From the patchnotes link @AngellusMortis provided, it does mention this as a “new” addition.

NEW: Added Detected Object sensor for cameras with smart detections. 
Values are none, person or vehicle. Contains event_score and 
event_thumb attributes.

Can’t really add much more than that to be honest. Please let us know if you get any further.

Anybody notice the feeds seem slower to load on the native integration vs previously on HACS? My cameras and HA are all hardwired so it’s not a wifi issue. I do have the high resolution rtsp feeds enabled but again, they were instantaneous on HACS. I can’t really quantify the slowness as consistent, sometimes just takes 5-15 seconds to load a stream now.

It might be because of the new stream encoding they added in 2022.2. It might take longer to load but should have lower latency. Not as good as Webrtc in my testing but much better than before 2022.2


We now enable Low Latency HLS (LL-HLS) by default to lower stream latency, thanks

It does work. If you are using logbook to check for changes, it will only report the most recent change for a given 1 minute interval. Meaning if your smart detection sensor goes from “none” to “person” and back to “none” in less than a minute, it will only report “none” in the logbook. Use the history instead of logbook for determining previous state.

If it is not updating, then that means you Websocket connection is not connected and you should check your logs.

All of the stream setup is handled by HA. Absolutely nothing changed for the streaming between HACS versions 0.11, 0.12 and the HA core version in the unifiprotect integration. 0.11 (vs. 0.10) added the multiple camera entities.

If something has changed in your HA install, it is likely something else that caused it. LL-HLS being enabled by default as part of 2022.2 as well is a very likely cause if you were not using LL-HLS previously. If you do not have a HTTP/2 proxy in front of your HA instance, the long load time be because of it trying to use LL-HLS, failing and then falling back to HLS.

Shout out to everyone involved in the core add-in! Installed and everything is working perfectly for rules detecting person and vehicle notifications! Am able to create all my rules and alerts!!! Even have internal camera’s enable/disable security mode via geofencing.

UI screwed the pooch when taking away multiple schedules to a single camera. But that is where this HA add-on comes in.

Next steps for me, to work in snip-its with the notifications.

I am trying to use motion detection to trigger lighting. It works great for about an hour, after that, it seems that most of the motion events are missed by HA and the lights do not activate.

Any tips on how how i can fix this.

@Quaface probably need a bit more information. To start, open the developer tool and filter the entities down to the motion sensor in question. Then select the info icon to see the history of activities. If you need to focus on a shorter period select ‘Show more’ and change the start and end date/time to focus on whatever period you need. Using this you can see if the motion sensor if failing or no longer detecting motion or it’s something else.

Hello, I am now using the new unifi integration and have a question about it, I want to stream when my G4 camera when it rang. What cheap ways would I have to display it to me on my dashboard? It is a mini pc with a monitor. Thanks a lot

I’m unaware of ability of PC operating systems to act as media players. There was software called ‘Google Cast for Educators’ that allowed MS Windows to present the Google Cast functionality to a network, but this is no longer available.

Usually if you want an automation to stream a camera to a display you would use a Google Cast (Audio and video) capable device. e.g. Google Nest Hub Max, even a Chromecast on a TV screen.

You might be able to use DLNA client software to turn your PC into a DLNA client. Best Windows 10 DLNA Client Download Free
DLNA Digital Media Renderer - Home Assistant

Have a look at browser_mod, you can have a pop up in your lovelace dashboard when the button is pressed

@brot123 rot
There you go. GitHub - thomasloven/hass-browser_mod: 🔹 A Home Assistant integration to turn your browser into a controllable entity - and also an audio player

A few months ago, the streams into HomeKit for my phone froze – it was a bug/issue on Apple’s part. Nothing has otherwise changed in my setup, HomeKit app on my phone no-longer streams and is frozen from 2 days ago. I’ve upgraded HA, rebooted, etc and no change. Anyone else having this issue? Thanks

Is the camera G3? If so, have you updated to the latest Protect Application?
My G3 instant froze up a few times and I had to power cycle to resolve it each time. Once I updated my Protect App the issues was resolved.

See release notes/bug fixes below:
https://community.ui.com/releases/UniFi-Protect-Application-1-21-4/b0c494ef-a768-4aae-8ac1-e70851de4290

No, unfortunately that’s not it. Updated to the latest Protect version. The cameras all are able to stream in Home Assistant no problem, seems related to HomeKit. Thanks though.