← Back to Blog

Fixing UniFi Protect Integration in Home Assistant

By Charles

The UniFi Protect integration in Home Assistant was showing setup_error for weeks. Here’s what was wrong and how I fixed it.

The Symptoms

  • Integration showed setup_error status
  • No cameras visible in Home Assistant
  • Logs showed authentication failures

The Root Cause

The integration was configured without proper credentials. The secrets.yaml file had:

# unifi_protect_password: ""  # Empty!

The Fix

Step 1: Create a Local User

UniFi Protect works best with a local account (not cloud SSO):

  1. Log into UniFi Console at your-udm-ip
  2. Go to Users → Add User
  3. Select “Local Access Only”
  4. Role: Limited Admin
  5. Application Access: Protect only (Network not required)

Step 2: Configure in Home Assistant

The integration is UI-configured, not YAML:

  1. Settings → Devices & Services
  2. Delete the broken UniFi Protect integration
  3. Add Integration → UniFi Protect
  4. Enter:
    • Host: your-udm-ip
    • Username: (the local user you created)
    • Password: (the password you set)
    • Uncheck “Verify SSL” if using self-signed cert

Step 3: Verify

After setup, you should see:

  • All cameras as entities
  • Motion detection sensors
  • Recording access
  • Live feeds available for dashboards

Bonus: Security Note

While troubleshooting, I discovered my UniFi cameras needed a firmware update to patch CVE-2025-23123 (RCE vulnerability). Always keep firmware current, especially on cameras.

Lessons Learned

  1. Check credentials first - Most integration errors are auth issues
  2. Use local accounts - More reliable than cloud SSO for API access
  3. View Only is enough - Full admin access isn’t needed for monitoring

Resources

  • UniFi Protect Cameras — The cameras we use with this integration. G4 Bullet and G4 Instant are solid choices for Home Assistant.
  • UniFi Dream Machine Pro — Runs UniFi Protect natively. The console that hosts the camera NVR.
  • Home Assistant — Free, open-source home automation platform with built-in UniFi Protect integration.