Custom Component: Unifi Protect

got it, it works. hard refresh did the trick. should have read the next line in the guide.

thanks!

1 Like

Hi not sure you got any responses but I figured out you can use this to launch the app in iOS:
unifi-protect://

It launches the app ā€œas isā€. So either the Home or the last camera you were on if youā€™ve enabled that in the app.

Iā€™ve experimented with some made up URI schemes to try and see whether itā€™s possible to link directly to a specific camera but no luck so far. Even had a play by investigating the motion alert emails but they all link to the url of the controller in the browser and not the app so didnā€™t get anything useful from there either.

Iā€™m not sure whether the app even supports a URI scheme to make deep linking to a view possible but I would assume so now that they remember the camera you were on when you last closed the app. Knowing the URI scheme would be super useful.

Does anyone here have the skills to look at the app files to try and extract this?

3 Likes

@briis: Strangly enough, since yesterday, on all iPads I can not view the live view from my protect cameras. Only a still image appears. Anyone see this too? It happens only on iPads, not iPhones or Windows PCs.
Any idea what to do about that?

I cannot replicate that on any of my iPads with IOS 14.2. I will try and upgrade to 14.3, and see if the problem then occurs.

EDIT: Updated to IOS 14.3, and still no issues. Tried both with a G4 Pro Camera and a G3 Flex

Nope, no live view on iPad Pros. anymore. Tried on 4 iPad Pros. No live views. On iPad Mini with iOS 12.4 it works like a charm.

iPad OS 12.5 works fine, too, on iPad mini. Perhaps a resolution problem?

Try and change the rtsp stream in the app, so you only have 1 enabled. Reload the Integration and see if it then works.

Edit: you might need to restart ha after the stream change

No change, still does not play. On iPhones it works fine, also on iPad Minis. Tried several.
And: Direct RTSP stream from cameras does not play in lovelace either.

Sounds like you need to log a bug with Home Assistant.

Release 0.7.0

Released: December 20th, 2020

For many people Privacy is very important. UniFi Protect does unfortunately not have an easy way to turn off a Camera, so that it neither records audio and video and disables the live stream. It has an option to set a Privacy Mask on each camera, that effectively blocks an area on the Camera to be visible, but making the whole screen go black requires creating and deleting that mask in the App, which is not very user-friendly.

This release now introduces a way to do this from Home Assistant with very little effort. As you can see below it introduces a new service that can enable and disable blacking out the whole camera view, which effectively ensures that no-one can watch the stream. If you combine that with disabling the microphone and turning off recording, then you have full privacy on your cameras. All this can be done in ONE go from this new Service. Thank you to @holman for suggesting this.

  • ADDED: New service unifiprotect.set_privacy_mode to enable or disable a Privacy Zone, that blacks-out the camera. The effect is that you cannot view anything on screen. If recording is enabled, the camera will still record, but the only thing you will get is a black screen. You can enable/disable the microphone and set recording mode from this service, by specifying the values you see below.
    If the camera already has one or more Privacy Zones set up, they will not be overwritten, and will still be there when you turn of this.
    Use this instead of physically turning the camera off or on.

    The services takes four parameters: entity_id of the camera, privacy_mode which can be true or false, mic_level which can be between 0 and 100 and recording_mode which can be never, motion, always or smart.

    Also a new attribute called privacy_mode is added to each camera, that shows if this mode is enabled or not. (Issue #159)

  • CHANGED: Some users are getting a warning that verify_sll is deprecated and should be replaced with ssl. We changed the pyunifiportect module to use ssl instead of verify_sll (Issue #160)

  • ADDED: Dutch translation to Config Flow is now added. Thank you to @copperek for doing it.

  • FIXED: KeyError: ā€˜server_idā€™ during startup of Unifi Protect. This error poped up occasionally during startup of Home Assistant. Thank you to @bdraco for fixing this. (Issue #147)

  • FIXED: From V1.17.x of UniFi Protect, Non Adopted Cameras would be created as camera.none and creating all kinds of errors. Now these cameras will be ignored, until they are properly adopted by the NVR. Thank you to @bdraco for helping fixing this.

This release is tested on:

Tested means that either new features work on the below versions or they donā€™t introduce breaking changes.

  • CloudKey+ G2: FW Version 1.1.13 with Unifi Protect V1.13.37
  • UDMP: FW Version 1.18.4-3 with Unifi Protect V1.17.0-beta.6
1 Like

I just spotted that these were available on Early Access Store here in Europe, so I ordered one. Makes it a bit easier to integrate :slight_smile: But from the specs it is basically just a very bright LED light, that is powered by POE and can be controlled from UniFi Protect.

1 Like

Awesomeā€¦ for $99 US for the size, not too bad of a price. Sizing is remarkable as well. Looking forward to seeing the results.

I disagree - You can buy many floodlights with a built-in motion sensor for way below that price. Yes, then it does not integrate in UniFi Protect, butā€¦ And in Denmark the price is $132 incl. VAT

You could very well be correct on the price for other sensors. I havenā€™t looked, not as of yet, to determine other floodlights have POE capabilities.

supported_features attribute for cameras in HAā€¦

I use echo/fireTV devices to do ā€˜Alexa show whichever unifi cameraā€™ā€¦ (so cool, it even turns the tv on!). I set some new devices up, but then alexa kept saying ā€œcamera doesnā€™t support thatā€.

I notcied support_features in home assistant for the working ones was 2, but 0 for problematic onesā€¦

Solution is to make sure you have an RTSP feed enabled for each camera - took me a while to figure out and didnā€™t get any results from searching here

Hopefully this might help someone in the future!

1 Like

For those of us with Cloud Keys, looks like v2.0.24 firmware is now available as an update through the UI. I updated my Gen2+ CK this afternoon - this brings UnifiOS, Protect 1.16 and smart detection.

1 Like

And you get Push instead of Poll for Events - Lowering the strain on your system :slight_smile: as you now move to UnifiOS on the CloudKey+

1 Like

@briis: I did file a bug with Home Assistant: Camera streaming in lovelace not working anymore Ā· Issue #44436 Ā· home-assistant/core (github.com)
But: I have replicated the problem with a fresh Hassio install, and three friends of mine see the exact same problem, too.
It does work fine with desktop browsers, iOS devices like iPhones, and iPadOS devices like iPad mini, Android devices.
However, it does NOT live play anymore with larger iPads like iPad Pros and 10-inch iPads. This is reproducible, with fresh setups, and with several different people. (only get a static image, not live, moving stream anymore)
Setup: UNVR and DreamMachines. Problem with both. Could it be an encoding issue with Unifi cams/server?

Hi Chris,
I have an iPad Pro 12.9" 2. Generation with IOS 14.3, where streaming is working fine.

No, at least not by this Integration. The Integration has no encoding built in. The only thing we do, is send the link to the RTSP stream you have setup in UniFi Protect, and then the stream component of Home Assistant works with that.

What backend do you have? Cloudkey or UNVR? That might make a difference.