Custom Component: Unifi Protect

HomeKit video randomly started working again w/ Unifi Protect a few days ago.

Hi,

I have the HA Unifi Protect integration working. I added HK integration and all was well. Weeks later, I notice the camera thumbnail shown when on the room in the Home app isnā€™t updating and shows No response. It shows 1w, etc. old. I tap on the camera and it streams fine and it updates the thumbnail, but not when I go to the room. The Arlo cam in the same room updates the thumbnail just fine.

This may be related to me putting the Unifi Protect cameras on their own VLAN. Anyone else experience this issue?

Hi. Is this still an issue? Iā€™m still running v0.9.1 and I have recording completely turned off but still use the cameras as motion sensors. So this directly affects my use case.

This is a long time ago, and was related to the UniFi Protect version you are running and not HA. If you are running the supported versions of UniFi Protect, motion sensors work without having recording enabled.
But I can only recommend that you update your Home Assistant entity as this Integration is now part of Core and the HACS version is no longer maintained nor supported.

I see. I made a mistake. I meant to say that Iā€™m running the latest version of the firmware supported by v0.9.1. If updating wonā€™t make my current usage break, Iā€™ll do it soon. Thanks!

It should not break that feature. Make sure you read the section about upgrading from the HACS version to the core Integration: GitHub - briis/unifiprotect: Control and monitor your Unifi Protect Cameras from Home Assistant

1 Like

Anyone know if thereā€™s a way to add a feature/product request for this integration on GitHub? The Smart Chime could be a game changer if it could be used as a Media Player.

Smart Chime support is already planned for 2022.6. But it cannot be used as a Media Player. There will be a button to trigger the chime, a number entity for the volume level and two services to add/remove paired doorbells.

2 Likes

Awesome, thank you!

Hello. I recently ran into an issue with Protect.

I am running Protect 2.0.0-beta.7
I have no updates in HA so I assume Iā€™m running the latest version.

I had Protect setup this morning. I upgraded Protect and everything was working fine for a few hours. I had an issue with a camera not showing in HA so I removed the integration and went to add it and was unable to complete the setup. I get ā€œFailed to Setupā€ and the error log below.

Any help would be appreciated. Thank you.

I receive the following error when I try to add the Protect integration.

Logger: homeassistant.config_entries
Source: components/unifiprotect/data.py:94
First occurred: 8:41:37 PM (1 occurrences)
Last logged: 8:41:37 PM

Error setting up entry NVR for unifiprotect
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/__init__.py", line 81, in async_setup_entry
    await data_service.async_setup()
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 74, in async_setup
    await self.async_refresh()
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 94, in async_refresh
    updates = await self.api.update(force=force)
  File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/api.py", line 507, in update
    self._bootstrap = await self.get_bootstrap()
  File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/api.py", line 676, in get_bootstrap
    return Bootstrap.from_unifi_dict(**data, api=self)
  File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 111, in from_unifi_dict
    data = cls.unifi_dict_to_dict(data)
  File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/bootstrap.py", line 152, in unifi_dict_to_dict
    return super().unifi_dict_to_dict(data)
  File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 343, in unifi_dict_to_dict
    data[key] = cls._clean_protect_obj_dict(data[key], unifi_dicts[key], api)
  File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 288, in _clean_protect_obj_dict
    items[key] = cls._clean_protect_obj(value, klass, api)
  File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 272, in _clean_protect_obj
    return klass.unifi_dict_to_dict(data=data)
  File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/devices.py", line 699, in unifi_dict_to_dict
    return super().unifi_dict_to_dict(data)
  File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 617, in unifi_dict_to_dict
    return super().unifi_dict_to_dict(data)
  File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 333, in unifi_dict_to_dict
    data[key] = cls._clean_protect_obj(data[key], unifi_objs[key], api)
  File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 272, in _clean_protect_obj
    return klass.unifi_dict_to_dict(data=data)
  File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 326, in unifi_dict_to_dict
    data[key] = convert_unifi_data(data[key], cls.__fields__[key])
  File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/utils.py", line 160, in convert_unifi_data
    value = [convert_unifi_data(v, field) for v in value]
  File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/utils.py", line 160, in <listcomp>
    value = [convert_unifi_data(v, field) for v in value]
  File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/utils.py", line 176, in convert_unifi_data
    value = field.type_(value)
  File "/usr/local/lib/python3.9/enum.py", line 384, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.9/enum.py", line 702, in __new__
    raise ve_exc
ValueError: 'package' is not a valid SmartDetectObjectType

Do not use Early Access or understand the risk of using it.

2 Likes

Understood. Thank you for linking how to downgrade. I couldnā€™t find it anywhere on the Ubiquiti forums.
Sorry Iā€™m new to HA and just trying for get everything figured out.

Just a short correction to the downgrade procedure: The version number you need to use is 2.0.0~beta.5 and not 2.0.0-beta.5. Note the ~ sign.

1 Like

Anyone on here managed to use Home Assistant to stream feeds to Alexa Echo Shows? Have been using Monocle Gateway, however Unifi seem to have broken that in the latest EA release and trying to find an alternative.

Off topic for the UniFi Protect integration, exporting a UniFi Protect camera entity to the Alexa Echo Show would be the same as exporting any camera entity.

For better responses, I recommend asking in the generic Configuration subforum or the #cameras channel on the Discord.

1 Like

Not sure if this was mentioned already but do we know what type of events can be seen with the new G4 Pro Doorbell?
It has a fingerprint sensor and card reader (NFC I hope). I would love to be able to see these types of events in HA to automate my zigbee locks, etc.

If you do not see the feature in the UniFi Protect Web app or the UniFi Protect mobile app, HA cannot do it. G4 Doorbell Pro does not support fingerprints or NFC (yet?).

Iā€™m surprised it came out of EA without these features already enabled. I guess theyā€™ll add it once the door lock comes out as well. Donā€™t have mine yet so this news, at the very least, makes me a little more patient since there is little improvement over the standard G4 (at least in its current state).

Would it possible to add a feature that allows the Integration to shutdown the UDMP or UNVR that protect is hosted on?

For some reasons the thumbnails generated always miss the person crossing my driveway. Thumbnail looks good in Unifi Protect but in Home Assistant I just get a thumbnail without the person visible. So something with the timing is wrong, how can I tweak this?

Is the thumbnail created when motion is detected, when motion has stopped or something else?

entity_id: sensor.g4_framsidan_detected_object
platform: state
from: none
1 Like