Custom Component: Unifi Protect

This may have something to do with 2021.4
I could see it, updated to 2021.4.3, and immediately after updating it is now gone.

I just installed 2021.4.4 and I can’t find it.

You do need HACS, that is clear right? #just_checking

As @sj3fk3 mentions, this is not part of the core Home Assistant, so you need to either install it via HACS first or copy the files manually. See this section for more info.

Hi, I just started using the integration, and already have a live stream on my phone. But I am pretty new to Home Assistant, and I don’t understand how to get access to the snapshot and how to make it available to my phone. Sorry for what is probably a noob question, but I’ve searched a lot of videos and forums and sometime someone will put a value in the image, with no discussion of where they got it.

Thanks in advance for the help. This really seems to be a great integration

This blueprint might be a good jumping off point for you.

1 Like

Thanks so much, i’ll give it a try

That was enough for me to figure it out, I now have a working automation that sends the snapshot and brings up the stream. The only thing I couldn’t figure out was the right data format to get it into node red, but that will just have to wait. Thanks again.

1 Like

One more quick question. I read thru most of this topic and not found information on 2 way audio. Does it only work in the protect app?

No you can use it via the homekit integration as well

Thanks, I’ll give it a try

And does this work on an Apple Watch as well? What about the audio latency when you use it through apple homekit?

Am i the only one that don’t have any audio from the G3 instant cam?

I think you are the only one lucky enough to own a G3 instant?

I received mine last week after a mere four month wait.
I do have audio in HA via the integration.

Same, I get audio on the G3 and G4.

Thanks for the nudge! I saw they are available again and snagged me one :slight_smile:

I also have audio on my G3 Instants.

I have a CloudKey Gen2+ and lately I’ve been getting a few error messages in my log repeatedly. I’ve not noticed it affecting functionality (i.e. my automation seems to always work when my doorbell is pressed), but I’m trying to figure out what’s going on. I’ve had some other weird network issues and some issues that seem specific to my CloudKey, so I’m wondering if this is completely on my end. Thoughts? Here’s the 3 errors I’m seeing:

Logger: custom_components.unifiprotect.data
Source: custom_components/unifiprotect/data.py:48
Integration: Unifi Protect
First occurred: May 3, 2021, 7:53:23 PM (2 occurrences)
Last logged: 4:36:43 AM

Error while updating

Traceback (most recent call last): File “/config/custom_components/unifiprotect/data.py”, line 48, in async_refresh await self._protectserver.update( File “/usr/local/lib/python3.8/site-packages/pyunifiprotect/unifi_protect_server.py”, line 144, in update updates = await self._get_events(lookback=10) File “/usr/local/lib/python3.8/site-packages/pyunifiprotect/unifi_protect_server.py”, line 419, in _get_events raise NvrError( pyunifiprotect.unifi_protect_server.NvrError: Fetching Eventlog failed: 500 - Reason: Internal Server Error

Logger: homeassistant
Source: custom_components/unifiprotect/data.py:48
First occurred: May 3, 2021, 2:24:30 PM (14 occurrences)
Last logged: 8:57:46 AM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/config/custom_components/unifiprotect/data.py”, line 48, in async_refresh
await self._protectserver.update(
File “/usr/local/lib/python3.8/site-packages/pyunifiprotect/unifi_protect_server.py”, line 144, in update
updates = await self._get_events(lookback=10)
File “/usr/local/lib/python3.8/site-packages/pyunifiprotect/unifi_protect_server.py”, line 412, in _get_events
response = await self.req.get(
File “/usr/local/lib/python3.8/site-packages/aiohttp/client.py”, line 544, in _request
await resp.start(conn)
File “/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py”, line 890, in start
message, payload = await self._protocol.read() # type: ignore
File “/usr/local/lib/python3.8/site-packages/aiohttp/streams.py”, line 604, in read
await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected

Logger: homeassistant
Source: custom_components/unifiprotect/data.py:48
First occurred: May 3, 2021, 1:18:59 PM (151 occurrences)
Last logged: 10:03:23 AM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/local/lib/python3.8/site-packages/aiohttp/connector.py”, line 969, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa
File “/usr/local/lib/python3.8/asyncio/base_events.py”, line 1050, in create_connection
transport, protocol = await self._create_connection_transport(
File “/usr/local/lib/python3.8/asyncio/base_events.py”, line 1080, in _create_connection_transport
await waiter
File “/usr/local/lib/python3.8/asyncio/selector_events.py”, line 848, in _read_ready__data_received
data = self._sock.recv(self.max_size)
ConnectionResetError: [Errno 104] Connection reset by peer

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/config/custom_components/unifiprotect/data.py”, line 48, in async_refresh
await self._protectserver.update(
File “/usr/local/lib/python3.8/site-packages/pyunifiprotect/unifi_protect_server.py”, line 144, in update
updates = await self._get_events(lookback=10)
File “/usr/local/lib/python3.8/site-packages/pyunifiprotect/unifi_protect_server.py”, line 412, in _get_events
response = await self.req.get(
File “/usr/local/lib/python3.8/site-packages/aiohttp/client.py”, line 520, in _request
conn = await self._connector.connect(
File “/usr/local/lib/python3.8/site-packages/aiohttp/connector.py”, line 535, in connect
proto = await self._create_connection(req, traces, timeout)
File “/usr/local/lib/python3.8/site-packages/aiohttp/connector.py”, line 892, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File “/usr/local/lib/python3.8/site-packages/aiohttp/connector.py”, line 1051, in _create_direct_connection
raise last_exc
File “/usr/local/lib/python3.8/site-packages/aiohttp/connector.py”, line 1020, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File “/usr/local/lib/python3.8/site-packages/aiohttp/connector.py”, line 975, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.1.2:443 ssl:False [Connection reset by peer]

What version of UniFi Protect are you running? From the log it seems to be 1.x