Custom Component: Unifi Protect

@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.

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.

Nope. 20 charrrr.

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

Nope. 20 charrrr.

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.

Nope. 20 charrrr.

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.