Unifi Protect fails to configure when adding integration
The problem
steps: attempt to add unifi protect integration to core 2025-05-01 Fill in UI form for creds: unsure local unifi account and all that according to integration docs result: "unknown error" expected: success.
What version of Home Assistant Core has the issue?
core-2025.5.1
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
unifi protect
Link to integration documentation on our website
https://www.home-assistant.io/integrations/unifiprotect
Diagnostics information
home-assistant_2025-05-11T22-57-22.877Z.log
Example YAML snippet
Anything in the logs that might be useful for us?
looks like a null ref in the auth pathway:
File "/usr/local/lib/python3.13/site-packages/uiprotect/api.py", line 516, in ensure_authenticated
await self._load_session()
File "/usr/local/lib/python3.13/site-packages/uiprotect/api.py", line 605, in _load_session
session_cookie = await self._read_auth_config()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/uiprotect/api.py", line 627, in _read_auth_config
session = config.get("sessions", {}).get(session_hash)
^^^^^^
UnboundLocalError: cannot access local variable 'config' where it is not associated with a value
Additional information
No response
Hey there @rahehl, mind taking a look at this issue as it has been labeled with an integration (unifiprotect) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of unifiprotect can trigger bot actions by commenting:
@home-assistant closeCloses the issue.@home-assistant rename Awesome new titleRenames the issue.@home-assistant reopenReopen the issue.@home-assistant unassign unifiprotectRemoves the current integration label and assignees on the issue, add the integration domain after the command.@home-assistant add-label needs-more-informationAdd a label (needs-more-information, problem in dependency, problem in custom component) to the issue.@home-assistant remove-label needs-more-informationRemove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.
(message by CodeOwnersMention)
unifiprotect documentation unifiprotect source (message by IssueLinks)
@Steven-Burns I was facing this issue myself as well since updating to 2025.5.1. I restarted my HASS box after removal and resetup didnt fix it then walked away to get lunch. When I came back 15 minutes later it was fixed so assuming a restart fixed it if you havent tried that yet (despite the "failure" message during setup!)
Maybe some config in .storage/unifiprotect/ is broken