{"record":{"id":"8cb464f7ae3b09a8","repo":"home-assistant/core","slug":"brunt-could-not-connect-with-username-self-confi","errorCode":null,"errorMessage":"Brunt could not connect with username: {self.config_entry.data[CONF_USERNAME]}.","messagePattern":"Brunt could not connect with username: (.+?)\\.","errorType":"exception","errorClass":"ConfigEntryAuthFailed","httpStatus":null,"severity":"error","filePath":"homeassistant/components/brunt/coordinator.py","lineNumber":58,"sourceCode":"            name=\"brunt\",\n            update_interval=REGULAR_INTERVAL,\n        )\n\n    @override\n    async def _async_setup(self) -> None:\n        session = async_get_clientsession(self.hass)\n\n        self.bapi = BruntClientAsync(\n            username=self.config_entry.data[CONF_USERNAME],\n            password=self.config_entry.data[CONF_PASSWORD],\n            session=session,\n        )\n        try:\n            await self.bapi.async_login()\n        except ServerDisconnectedError as exc:\n            raise ConfigEntryNotReady(\"Brunt not ready to connect.\") from exc\n        except ClientResponseError as exc:\n            raise ConfigEntryAuthFailed(\n                \"Brunt could not connect with username:\"\n                f\" {self.config_entry.data[CONF_USERNAME]}.\"\n            ) from exc\n\n    @override\n    async def _async_update_data(self) -> dict[str | None, Thing]:\n        \"\"\"Fetch data from the Brunt endpoint for all Things.\n\n        Error 403 is the API response for any kind of\n        authentication error (failed password or email)\n        Error 401 is the API response for things that are not\n        part of the account, could happen when a device is\n        deleted from the account.\n        \"\"\"\n        try:\n            async with timeout(10):\n                things = await self.bapi.async_get_things(force=True)\n                return {thing.serial: thing for thing in things}","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/brunt/coordinator.py#L40-L76","documentation":"ConfigEntryAuthFailed raised when the Brunt login call fails with ClientResponseError during _async_setup. This is a terminal setup failure: HA marks the entry as failed auth (requires reauthentication) instead of retrying. The message includes the configured username.","triggerScenarios":"Wrong username or password in the config entry (Brunt returns an HTTP error on login); password changed on the account; account locked; API responding with an HTTP error status (e.g. 4xx) to the login request.","commonSituations":"User changed their Brunt password and HA still stores old credentials; typo in username during initial setup; account deleted or suspended.","solutions":["Open the entry's reauthentication prompt in HA (Settings > Devices & Services > Brunt) and re-enter correct credentials","Verify the same username/password works in the Brunt app","If the account was deleted, remove the integration entry"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"# Framework-level: ConfigEntryAuthFailed moves the entry to SETUP_ERROR and\n# triggers a reauth flow. Users fix it via the reauthentication prompt, not code.\nif entry.state is ConfigEntryState.SETUP_ERROR:\n    # start reauth flow with correct Brunt credentials","preventionTips":["Keep HA credentials in sync when the Brunt account password changes","Verify login in the Brunt app before filing bugs when this error appears"],"tags":["brunt","auth-failed","credentials","reauthentication","home-assistant"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}