UniFi - 401 Unauthorized

Receiving the following error when using the following - Unauthorized - Connecting to Unifi network I’m using an admin user

      - type: custom:slider-button-card
        entity: switch.haileys_fire_tv
          direction: left-right
          background: solid
          use_state_color: false
          use_percentage_bg_opacity: false
          show_track: false
          toggle_on_click: true
          force_square: false
          show_attribute: false
        show_name: true
        show_state: true
        compact: true
          show: true
          use_state_color: true
            action: more-info
          icon: ''
          mode: toggle
          icon: mdi:power
          show: true
          show_spinner: true
            action: toggle


I’m running in the the same exact error.

I’m using a Unifi Local Super Admin for credentials on Home Assistant.

I rolled back several versions of Home Assistant and still have this issue so it must be the Unifi 4.0.6 (OS) firmware that might be causing this problem.

It could be related to their enforcement of MFA . They should have started enforcing it in 10 days’ time according to the emails I’ve been getting. I wouldn’t be surprised they rolled it out slightly earlier:

EDIT: This only affects UI cloud accounts. See @fleskefjes clarification below.

MFA does not affect local users, which is what you need to use with the integration. The mandatory MFA is only for the UI accounts (cloud accounts). https://community.ui.com/questions/Upcoming-Multi-Factor-Authentication-MFA-Requirement-for-All-UI-Accounts-in-July-2024/e0d06d3c-c0ae-4af6-aa67-53c159d486a8

1 Like

Oh, missed that, thanks!

1 Like

I was already using a local user but I’m still receiving this 401 and am unable to reconfigure (even after deletion and readding of the local user) the Integration

You create the user on the OS settings, right? not the SSH settings? I did the same error once.

I did create the admin user locally, yes
Even given the user a pre-defined with only read-rights (also tried it with full admin rights)

Same problem, local users, tons of 401 unauthorized when trying to re-add integration… Must be a Unifi OS update as mine auto-updates.

Same issue with 401 authentication error when trying switch clients or portforwarding rules off and on. No issue adding integration.

Need some help getting this fixed.