home-assistant/core · error · ConfigEntryAuthFailed

authentication_failed

authentication_failed

Error message

authentication_failed

What it means

Raised during bosch_alarm config entry setup: panel.connect() failed with PermissionError or ValueError, which the bosch_alarm library uses for rejected credentials (bad/locked-out automation code, installer or user code). The integration disconnects the panel and raises ConfigEntryAuthFailed with translation_key 'authentication_failed', pushing the user into re-authentication.

Source

Thrown at homeassistant/components/bosch_alarm/__init__.py:49

    return True


async def async_setup_entry(hass: HomeAssistant, entry: BoschAlarmConfigEntry) -> bool:
    """Set up Bosch Alarm from a config entry."""

    panel = Panel(
        host=entry.data[CONF_HOST],
        port=entry.data[CONF_PORT],
        automation_code=entry.data.get(CONF_PASSWORD),
        installer_or_user_code=entry.data.get(
            CONF_INSTALLER_CODE, entry.data.get(CONF_USER_CODE)
        ),
    )
    try:
        await panel.connect()
    except (PermissionError, ValueError) as err:
        await panel.disconnect()
        raise ConfigEntryAuthFailed(
            translation_domain=DOMAIN, translation_key="authentication_failed"
        ) from err
    except (TimeoutError, OSError, ConnectionRefusedError, SSLError) as err:
        await panel.disconnect()
        raise ConfigEntryNotReady(
            translation_domain=DOMAIN,
            translation_key="cannot_connect",
        ) from err

    entry.runtime_data = panel

    device_registry = dr.async_get(hass)

    mac = entry.data.get(CONF_MAC)

    device_registry.async_get_or_create(
        config_entry_id=entry.entry_id,
        connections={(CONNECTION_NETWORK_MAC, mac)} if mac else set(),

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Open the integration entry and re-authenticate with the correct automation/installer/user codes.
  2. If the panel locked the account after failed attempts, wait the lockout period or unlock it at the panel, then retry.
  3. Confirm which code each field expects (installer code vs user code) in the integration docs and re-enter.
Defensive patterns

Strategy: validation

Validate before calling

codes = {
    "password": entry.data.get("password"),
    "code": entry.data.get("installer_code", entry.data.get("user_code")),
}
if not all(isinstance(v, str) and v.isdigit() and 4 <= len(v) <= 8 for v in codes.values()):
    raise ValueError("codes must be numeric, 4-8 digits")  # check before connect()

Try / catch

try:
    await panel.connect()
except (PermissionError, ValueError) as err:
    await panel.disconnect()
    raise ConfigEntryAuthFailed(...) from err  # drives HA re-auth UI

Prevention

When it happens

Trigger: Connecting with a wrong CONF_PASSWORD (automation code), wrong installer/user code, panel account locked after repeated failures, or code entered in the wrong field (user code where installer code is configured).

Common situations: Typo in codes at config time, panel firmware locking the account after failed attempts, codes changed by the installer since setup.

Understand the failure class

Related errors


AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14). Data as JSON: /api/errors/3338458f3a335e27. Report an issue: GitHub.