Unifi Protect (failed to connect)

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.

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.

There is no need for name calling. It’s clear you’re frustrated this week – both with people complaining that the integration isn’t working, as well as with the HA Core maintainers who didn’t see the need to push the change out more quickly.

Perhaps you’re just doing things in a way that isn’t congruent with the way Ubiquiti does things – as you’ve just detailed. Your desire to use enums when that doesn’t align with the source API could be part of the problem. While it is the best practice, it doesn’t lend itself to working with a vendor who makes changes willy-nilly.

Aside from your hubris, is there any reason why you can’t use strings and solve this issue? Or, barring that, include error handling that doesn’t throw up its hands at the slightest issue?

Regardless, most of what you’ve just said doesn’t address why the HA UniFi Network integration doesn’t seem to break. Certainly not as badly as the Protect one does. So perhaps it is an issue in how you’re doing things.

Confirming that HA update resolving the issue.
To be honest I’m very grateful that there is a group of people who has a will to contribute and deliver the plugin. Even if sometimes is broken still gives a lot of value.
It’s open source so we take it as it is.
Many thanks.

Can i ask what versions of software you have for HA & Unifi Protect?

I have latest of both (offical not early access) and still get “Failed to connect”

+1 :
Protect 3.0.26

  • Core 2024.4.2
  • Supervisor 2024.04.0
  • Operating System 12.2

failed to connect error when setting up. Have previously had it working, using same credentials. Was initially hit by the dumb EA bug from unifi and thought I just needed to reinstall to get rid of the EA alert when the camera streams went down. Whoops

have read the recent threads. Am aware it’s a complex issue and will take time. Just posting for ?value of having more info & appreciate the work you do AngellusMortis.

1 Like