Custom Component: Unifi Protect

If you look at the sensor does it show up like my does with the new presence or is it on or off like the old way? As in is the doorbell sensor in cleared mode or detected vs off and on.

Exactly the same. Occupancy for the Ring Sensor and Motion for the motion sensor.

Release 0.6.4

  • Hotfix for those who experience that motion sensors no longer work after upgrading to 0.6.3. Users affected will be those who are running a version of Unifi Protect that does not support SmartDetection.

This release is tested on:

  • CloudKey+ G2: FW Version 1.1.13 with Unifi Protect V1.13.37
  • UDMP: FW Version 1.18.3-4 with Unifi Protect V1.16.7
  • UDMP FW Version 1.18.0 with Unifi Protect V1.14.11
1 Like

Keep up the great work, @briis

1 Like

Hi @briis,

Sadly it looks as though 0.6.4 has lost the event_score and event_length binary_sensor attributes that my automations depend on.

  • CloudKey+ G2 Firmware 1.1.13 Unifi Protect 1.13.7
  • HA 0.118.4 (Python 3.8 venv, core install)
  • UnifiProtect 0.6.4

I skipped 0.6.3 after your warning and upgraded to 0.6.4 last night.

Iā€™ve been testing this morning after receiving no protect notifications since upgrading and have established that the binary_sensor attribute event_length and event_score are no longer received when the sensor reverts to ā€œoffā€ (as with 0.6.2 and previous versions) - this stops all my automations from firing based on their conditions. The attributes are also not available when the sensor is ā€œonā€.

Tested with:

  • G3 Flex
  • UVC-G3-AF
  • UVC-G4 bullet

Iā€™m going to have to figure out how to revert to 0.6.2 for the time being - do you need an issue raised in the repo for this?

Hi,
Sorry to hear that. Fortunately I have a CloudKey+ with the same versions as yours available, so I can play with your setup. Please raise an issue, and also include one of the Automations that is not working, if possible. Then I will look at it.

Will do.

In the meantime can you confirm whether to revert I just need to copy over the 0.6.2 source code into my custom_components/unifiprotect folder and restart HA? will this reset the version in HACs?

I am not a HACS expert, but in order to keep the right version in HACS, I think what you need to do, is click on the 3 dots in the bottom right of the Unifi Protect Integration in HACS, and the select Reinstall. Here you will have the option of selecting 0.6.2.
I have not tested this, but I guess it should work.

Confirmed - this worked beautifully.

1 Like

Quick question: Are using Motion or Always recording mode?

Motion on one camera only, Always recording on the other two.
Behaviour observed on three different cameras.

Iā€™ve raised the issue on github and can confirm that reverting to 0.6.2 reinstates the expected behaviour.

Fixed with 0.6.5 thanks to speedy devs.

Iā€™ve come across a separate streaming issue that I was blissfully unaware of today with a G4 bullet stream at High (2688x1512) RTSP casting to a Google Nest Home Hub Max.
Stream is rotated 90 degrees on the Hub, but displayed correctly on other Gen2+ Chromecasts.

This is apparently a known issue, raised on GitHub as #36290 and the workaround is simply to switch to the medium stream (1280x720) in the controller.
Note I reloaded the integration and re-synced to Google before rechecking the cast which then displays in correct orientation.

Posting this here purely for info and to save anyone else going down a rabbit hole.

1 Like

Morningā€¦ Like to provide an update around LG WebosTV. Iā€™ve opened a Github ticket and appears after some discussion the ā€˜iconā€™ support is no longer supported. You are able to display a message but are not able to display an image. Appears this has been an ongoing discussion since March/April of his year. Whilst the project is not dead, it merely is unlikely it will have its work continued.

Quick question for those that use Chromecast to display an image. Does the TV need to be on the HDMI port for Chromecast to display an image?

@briis
Unifi Protect 1.17.0 released

Updates for which you may find relevant.

  • Add support for Vehicle detection
  • Add ā€œSmart Detection onlyā€ recording mode

Possible new future support: ā€œSmart Flood Lightā€

## Overview

To upgrade to this version of UniFi Protect, you will need one of the following firmware versions ( or newer ):

* UDM-Pro [1.8.3-5](https://community.ui.com/releases/UniFi-Dream-Machine-Firmware-1-8-3-5/3fa358b4-7512-4a64-bf50-faa3c2f67205)
* UNVR 1.3.32 (upcoming release)
* UCKG2/UCKP 2.0.21 (upcoming release)

## Improvements

*** Add support for Vehicle detection.**
* Improved email notification sending.
* Show uptime for unadopted devices.
*** Add ā€œSmart Detection onlyā€ recording mode.**
* Web UI: Add Unifi Video migration wizard (Automatically detects Unifi Video install and offers to migrate camera settings).
* Web UI: Improved support for Unifi Video backup import.
* Web UI: Show ā€œManaged by otherā€ devices in ā€œAdd Devicesā€ page and offer to adopt them using device password.
* Web UI: Add support for multiple smart detection boxes.
* Web UI: New design for motion & privacy zone editors.
* Web UI: New Smart Detection zone editor.
* Web UI: Add digital zoom support in timelapse.
* Web UI: Add Smart detection type filter in dashboard.
* Web UI: Add G4 PTZ Controls in timelapse, when viewing live.
* Web UI: Add video playback speed controls to the event player.
* Web UI: Add microphone sensitivity slider.
* Web UI: Increase precision to G4 Doorbell chime duration setting.
* Web UI: Add option to report feedback about device performance.
* Web UI: Update "No timelapse" screen, when there are no cameras available.
* Web UI: Show "Live stream loading" status in timelapse.
* Web UI: Update download clip icon.
* Web UI: Show ā€œOfflineā€ state if Remote connection lost.
* Web UI: Added option to highlight motion in Motion zone editor.
* Rename G3 mini camera to G3 instant.

## Bugfixes

* Fix bug where Auto-backups on UCK where not written to SD card
* Web UI: Improved Timelapse buffering logic
* Web UI: Show "connection lost" status message when remote connection is lost
* Web UI: Disable G4 Doorbell screen settings when device is offline
* Web UI: Open live player if smart detections event is not complete
* Web UI: Fix issue in timelapse where sometimes part of event was not clickable
* Web UI: Fix issue where sometimes Device details section would flicker
* Web UI: Fix issue when popups can be dragged under header

Thanks Jason,
My UDMP is already upgraded to the new version, and I can see that Vehicle detection is automatically enabled. I have not tested it yet, but there is a good chance that that piece already works with v0.6.5 of the Integration.
I will look at the adding a new Switch for Smart Detection only, for all G4 Cameras, and also update the Service so it will accept that.

EDIT: Just tested it and if you are on a UnifiOS device with the latest Unifi Protect, Vehicle detection is working already with 0.6.5. Just check for vehicle in the event_object attribute.

EDIT EDIT: There is now a Beta release available on HACS (0.6.6-beta-1) with support for the new features in Protect 1.1.7.0-beta-1. For those who have upgraded, let me know if it works.

1 Like

Although Iā€™m waiting for the GA for my Cloud Key Gen2, this justifies the back-breaking (literally) effort I put in on a freezing Sunday replacing a dodgy cable run to my driveway so I could swap out my G3 for a G4.
(We have a lot of bad drivers in the area who like to turnaround at our drive and reverse into fences / over posts / into cars.)
Iā€™ll be interested to see how effective the vehicle detection is.

1 Like

First of all, a huge thank you to all the contributors of this project. Ever since I saw that project for HomeBridge I was hoping someone could implement the communication via the built-in websocket.

That being said, Iā€™m having issues with a camera flooding with motion detection events. I have so many the frontend freezes when I try to load them. Is there a way to throttle them a bit? Iā€™m more interested in saving events whenever my alarm is armed.

So if anyone knows what I can do about this, please let me know.

as someone who just finished putting LGs in every room - this is terrible news! :sob: :sob: :sob:

Release 0.6.6

With the release of Unifi Protect V1.7.0-Beta 1, there is now the option of detecting Vehicles on top of the Person detection that is allready there. This is what Ubiquiti calls Smart Detection. Also you can now set recording mode to only look for Smart Detection events, meaning that motion is only activated if a person or a vehicle is detected on the cameras. Smart Detection requires a G4-Series camera and a UnifiOS device.

NOTE: If you are not running Unifi Protect V1.17.x then the new features introduced here will not apply to your system. It has been tested on older versions of Unifi Protect, and should not break any existing installations.

  • New For all G4 Cameras, a new Switch will be created called Record Smart, where you can activate or de-active Smart Recording on the camera

  • New The service unifiprotect.set_recording_mode now has a new option for recording_mode called smart. This will turn on Smart Recording for the selected Camera. Please note this will only work on G4-Series cameras.

  • Fix When the G4 Doorbell disconnected or restarted, the ring sensor was triggered. This fix now ensures that this does not happen.

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.3-5 with Unifi Protect V1.17.0-beta.1
  • UNVR: FW Version 1.3.15 with Unifi Protect V1.15.0

Have you tried adjusting motion sensitivity and motion area in UI APP?
Beside from that I am surprised that your system freezes just because a binary sensor changes state. What HW are you running your HA installation on? And how many cameras do you have? Give us a bit more info on how you use the Integration.