Unifi Protect (failed to connect)

Hello

It looks like the Unifi Protect plugin is broken after an update and no longer functions? All the entities report as “recovered” or “unavailable”. This was previously working before I updated Home Assistant.

I’ve attempted to bin the integration and set it up again but it won’t accept my login details anymore with “Unknown Error” or “Failed to connect” despite this all working flawlessly before. I have setup a new user in Unifi OS with Super Admin rights and still no joy.

Unifi OS: v3.2.12
Unifi Protect: v3.0.10

Home Assistant:
Core: 2024.3.0
Supervisor: 2024.02.1
Operating System: 12.0
Frontend: 20240306.0
HACS: 1.34.0

Edit:

I was a bit silly and forgot I sat my UDMP on Early Access and so Unifi Protect updated from 2.11.21 (official) to 3.0.10 (early access) breaking the integration in the process.

For anyone who finds they’ve done the same you can SSH into your UDMP and issue the following commands to force a downgrade.

  • SSH into UDM-PRO
  • apt-get update
  • apt-get install --reinstall --allow-downgrades unifi-protect=2.11.21 -y

Replace ‘2.11.21’ to whatever version suits.

You installed early access (v. 3.x)? 2024.3: Drag 'n Drop it like it's hot! 🎉 - #61 by Holdestmade

Yeah spot on, I’ve updated my post. I somehow forgot to change it back. Fixed by force installing the official 2.11.21 over the EA access.

1 Like

Done the same, however downgrading still having no effect.
HA still saying Unknown error occurred

same here. downgraded to 2.11.21, unkonow error occurred

Same here, the read only user is left over though when downgrading, I assume that’s what the readlive error is. We’ll just have to wait patiently for it to be fixed

EDIT: Looking at github, it looks like its been fixed and merged, hopefully it’ll make it in 2024.3.2

Just updated to Unifi Protect 3.0.22 (official release channel) and home assistant no longer connecting to cameras etc. Suggest not to update protect until the integration is updated.

1 Like
1 Like

With how fickle the integration is, I ended up just adding Generic Cameras pointing at the RTSP and snapshot links. Yes, I lose the person / motion detection, but I don’t end up with random crashes of the integration and it seems to load the snapshots more quickly (and more often).

Once the integration is operational again, I’ll probably keep the Generic Camera one as the primary for images and just use the motion / person detection from the integration.

1 Like

Do you mind sharing an example of your configuration using Generic Cameras ?
Teste the following combinations and both fail to render:

  - platform: generic
    name: kitchenunifi
    still_image_url: http://unifiprotectIP/snap.jpeg
    stream_source: rtsps://unifiprotectIP:7441/streamingID?enableSrtp
    verify_ssl: false

or simply:

- platform: generic
    name: kitchenunifi
    still_image_url: http://CAMERA_IP/snap.jpeg
    stream_source: rtsp://USERNAME:PASSWORD@CAMERA_IP:7447/STREAM_ID

There is any specific user I need to create in order to make it working ?

Your second one is closest – but the RTSP link needs to be pulled from the Camera Settings page in Protect, with changes to the port and protocol.

the snap.jpeg only comes from the camera, and the rtsp only comes from the protect appliance (and seems to be anonymous). I’ve attached what I configured in the UI.

1 Like

Appreciate. How do u get this options UI ?And I see you have Basic Authentication defined, username\pwd is for a specific user within the UnifiProtect ? or your kept without anything ?

BTW, I managed to fix my integration and udpate to the last Unifi fwm using the following Unifi Protect Integration does not yet support Protect 3.0.10 · Issue #112487 · home-assistant/core (github.com)

If you update to 2024.3.2 it solves the Protect v3.x issue

I can’t, because of other dependencies. The change I did this morning on types.py is the fix included on 2024.3.2

There’s quite a few more changes/fixes but if what you’ve done works for you that’s great

1 Like

I added the “Generic Camera” integration through Settings → Devices & Services → Integrations. Then, after selecting the integration, I clicked “Add Entry” at the bottom.

It says “Basic Authentication” but the u/p info is blank. Those were defaults that I tried first and they worked.

I think it’s only fair to say it solves the Protect v.3.0.x issue. I’ve watched this integration get broken with other releases within the same major release, too.

Nope. 10 charrrr

Dude… if it breaks because Ubiquiti sneezes, it’s pretty hard to support. I’m not a python programmer, so I won’t be contributing code – it would just cause you more work.

To be clear, I’m not bitching in a way that expects you to do anything – I’ve found a workaround by using Generic Camera for the image / video stream (which works better even when this integration is working since it grabs the snapshots directly from the camera, and more often). If I need to use the sensors for automations, I just use the Node-RED integration that doesn’t break with every minor change.

I don’t understand how it is that other integrations (Scrypted, Node-RED, probably others) don’t go kaboom at the slightest change, but this one seems to need everything perfect in order to not blow up. In any other API work I’ve done, everything is backwards compatible (unless otherwise stated), and a tool programmed against an older API will work, just without the new features.

Nope. 10 charrrr