Custom Component: Unifi Protect

Nope. 10 charrrr

1 Like

Yea I tried to use that recently and got a nice zoomed in image of the event but if I checked it after the person detection took place it was just my flag blowing in the wind. :yum:

Ah ok, Iā€™ve not used it as I use the UNIFI Protect motion detection sensor to trigger snapshots and plate recognition in HA automation. This keeps one image as the latest and keeps all the others with datestamp

- alias: Drive Camera Vehicle Motion
  max_exceeded: silent
  trigger:
    - platform: state
      entity_id: binary_sensor.motion_drive_camera
      attribute: event_object
      to: 'vehicle'
  action:
    - service: camera.snapshot
      data:
        filename: /config/www/snapshots/drive_camera_latest.png
      target:
        entity_id: camera.drive_camera
    - service: camera.snapshot
      data:
        filename: /media/motion/drive_camera_snapshot_{{ now().strftime("%d%m%Y - %H-%M-%S") }}.png
      target:
        entity_id: camera.drive_camera
    - delay: '00:00:03'
    - service: image_processing.scan
      target:
        entity_id: image_processing.platerecognizer_drive_last_motion
1 Like

Version 0.10.0 Beta 4 released

REMINDER This version is only valid for V1.20.0-beta.2 or higher of UniFi Protect. If you are not on that version, stick with V0.9.1.

Upgrade Instructions

Due to the many changes and entities that have been removed and replaced, we recommend the following process to upgrade from an earlier Beta or from an earlier release:

  • Upgrade the Integration files, either through HACS (Recommended) or by copying the files manually to your custom_components/unifiprotect directory.
  • Restart Home Assistant
  • Remove the UniFi Protect Integration by going to the Integrations page, click the 3 dots in the lower right corner of the UniFi Protect Integration and select Delete
  • While still on this page, click the + ADD INTEGRATION button in the lower right corner, search for UnFi Protect, and start the installation, supplying your credentials.

Changes in this release

This will be the last beta with functional changes, so after this release it will only be bug fixes. The final release will come out when 1.20 of UniFi Protect is officially launched. Everything from Beta 1, 2 and 3 is included here, plus the following:

  • NEW: Device Configuration URLā€™s are introduced in Home Assistant 2021.11. In this release we add URL Link to allow the user to visit the device for configuration or diagnostics from the Devices page. If you are not on HA 2021.11+ then this will not have any effect on your installation.

  • NEW: BREAKING CHANGE Also as part of Home Assistant 2021.11 a new Entity Category is introduced. This makes it possible to classify an entity as either config or diagnostic. A config entity is used for entities that can change the configuration of a device and a diagnostic entity is used for devices that report status, but does not allow changes. These two entity categories have been applied to selected entities in this Integration. If you are not on HA 2021.11+ then this will not have any effect on your installation.

    We would like to have feedback from people on this choice. Have we categorized too many entities, should we not use this at all. Please come with the feedback.

    Entities which have the entity_category set:

    • Are not included in a service call targetting a whole device or area.
    • Are, by default, not exposed to Google Assistant or Alexa. If entities are already exposed, there will be no change.
    • Are shown on a separate card on the device configuration page.
    • Do not show up on the automatically generated Lovelace Dashboards.
  • NEW: A switch is being created to turn on and off the Privacy Mode for each Camera. This makes it possible to set the Privacy mode for a Camera directly from the UI. This is a supplement to the already existing service unifiprotect.set_privacy_mode

  • NEW: Restarted the work on implementing the UFP Sense device. We donā€™t have physical access to this device, but @Madbeefer is kindly enough to do all the testing.

    • The following new sensors will be created for each UFP Sense device: Battery %, Ambient Light, Humidity, Temperature and BLE Signal Strength.
    • The following binary sensors will be created for each UFP Sense device: Motion, Open/Close and Battery Low. Note as of this beta, these sensors are not working correctly, this is still work in progress.
1 Like

Is it possible to use TTS with the UniFi Doorbell? Ie that HA can speak via the doorbell instead of just displaying a message?

Iā€™m not sure how many people actually take note of that little screenā€¦

Nope. 10 charrrr

4 Likes

Iā€™m planning on making the move across to Protect v1.20.0 and v0.10.x of the Protect component this weekend.
In the meantime Iā€™ve been reading up on the new LL-HLS option for Stream and wondered whether anyone here has given it a whirl with Protect. Any hints / tips?

Nope. 10 charrrr

Thanks for responding (and so quickly).

Iā€™m running with HA Container in docker on Ubuntu, Nabu Casa for external access and have 4 Unifi cameras.

Based on a quick read of the linked discussion my current setup may not be suitable but I might have a play once Iā€™ve completed the move to the latest Protect and the reworked Integration.

What happens if you have more than 3. I have 6 cameras and all are working fine but I havenā€™t yet setup my ā€œcamera dashboardā€ with all the cams at once. Curious to know what to expect when I do. Iā€™m using Nabucasa so no reverse proxy.

Nope. 10 charrrr

1 Like

Thanks for the details. Iā€™m familiar with NPM. I use it for other purposes outside of Home Assistant.

I use the custom frigate-card on the front-end for my Unifi cameras, since upgrading to Protect v1.20.0 and v0.10.x I receive an error when trying to view live video:

Error: Support only RTSP-Stream

Iā€™m wondering if this is being caused by the switch to RTSPS. Is there any way to force RTSP?

From the Protect changelog:

  • Web UI: Generate only RTSPS links for better security. (RTSP streams are still available by removing S from RTSPS and by changing port 7441 to 7447)

Thx @stephack , I canā€™t see that part in the release notes. Does the document you see tell you where to make that change? :confused:

Nope. 10 charrrr

1 Like

Just in case anyone else runs into the issue with the frigate-card looks like the issue is not with frigate or indeed that card, rather the WebRTC custom component. Iā€™ll open a request there for it to support RTSPS.

This Unifi Protect upgrade from 1.19.x to 1.20 complete messed up all of my camera feeds.

Further more having WebRTC installed messed it up even further. So I had to uninstall it for now.

Iā€™m unable to start the unifi protect integration I get the follow error:

Error setting up entry UDMPRO for unifiprotect
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 304, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/unifiprotect/__init__.py", line 108, in async_setup_entry
    await _async_get_or_create_nvr_device_in_registry(hass, entry, nvr_info)
  File "/config/custom_components/unifiprotect/__init__.py", line 124, in _async_get_or_create_nvr_device_in_registry
    device_registry.async_get_or_create(
TypeError: async_get_or_create() got an unexpected keyword argument 'configuration_url'

Is anybody having the same issue?

My current work around for this is to use RTSP streams for my cameras.

  1. Copy the RTSPS link from unifi protect. Example: rtsps://192.168.25.1:7441/labcdefgh?enableSrtp

  2. Remove the s in rtsps and change the port from 7441 to 7447

  3. Add to configuration.yaml

 - platform: ffmpeg
    input: rtsp://192.168.25.1:7447/abcdefgh?enableSrtp
    name: Garage

Nope. 10 charrrr

Nope. 10 charrrr

1 Like