Unifi Protect needs to re-authenticate every few hours

I’m using the Unifi Protect integration. Several times a day, it stops working due to authentication issues. I simply type the same username and password (the ones I created for a Homeassistant account in my Unifi Protect console) in again and everything is fine.

This seems easily automatable as it’s just using the same password again and again and it could, you know, remember it… Is there any way to make this work?

Thanks!

What are you running the Protect app on? What version OS is it running?

Protect is running on a stacked pair of UNVRs. OS v4.0.3 / Protect v.4.0.7

Yes every few hours the Unifi Protect integration in Homeassistant gives me an error that “Authentication expired for ” and to “repair” it asks me to re-enter the same username and password. This effectively makes home automation impossible…

There was an authentication change with Unifi OS 4.X. The integration has not been updated since 4.X is still early access. For some folks, this was a breaking change (myself included) where the integration was completely unable to log in to the UNVR. What helped (for reasons unknown to me) was creating a brand new admin user and using that for the integration.

Thanks. Yes. I had to create a new admin account to unbreak the integration… now it “only” requires re-authentication several times a day… Which is frustrating because the integration has all of the information it needs to re-authenticate without my involvement :slight_smile:

(Sadly, I’m stuck on EA because one of my devices was having problems and UI support said the fix was only available in the EA version…)

I’m starting to wonder if something else changed. Ever since setting up the new account on Saturday, I haven’t had to re-auth from HA, but I am now having to log in multiple times each day from my pre-existing personal account.

Making a new admin account didnt help me. Not sure what they did, but its borked good with the EA version (4.0.3). Just gives “Invalid Authentication” from the settings page where I noticed the error at the top.

EDIT:
I deleted the protect admin, and changed the username and password, then went to the unifi integration and the new admin account was accepted. it took about a minute or two for it to stop complaining. I wont be doing EA again.

Yeah…after making my other post I realized that I was able to set the integration back up but everything was showing as unavailable. Tried deleting and setting it back up and saw an error message in the system logs:

ValueError: 'IMAGE' is not a valid DoorbellMessageType

And realized it was because I’d set a custom image on the doorbell camera. I switched back to the built in and was able to set everything back up. Hopefully they make 4.X GA soon to let the integration dev get a fix pushed out.

Version 4.0.21 is GA now - and it completely broke HA for me. I can no longer authenticate at all.

Not sure what the reason is - but something must have changed.

All this for a cool doorbell animation.

Do you have a custom animation set on the doorbell?

Also…the problem isn’t with the Protect application, it’s with the Unifi OS version.

Yes, I added a custom animation. I also saw the message about an incompatibility if you use it.

Wait, I stand corrected. Turning off the animation restores the integration.