{"record":{"id":"2f2c00b35e02b3c3","repo":"home-assistant/core","slug":"blink-authorization-failed-2f2c00","errorCode":null,"errorMessage":"Blink authorization failed","messagePattern":"Blink authorization failed","errorType":"exception","errorClass":"ConfigEntryAuthFailed","httpStatus":null,"severity":"error","filePath":"homeassistant/components/blink/switch.py","lineNumber":83,"sourceCode":"            name=camera,\n            manufacturer=DEFAULT_BRAND,\n            model=self._camera.camera_type,\n        )\n\n    @override\n    async def async_turn_on(self, **kwargs: Any) -> None:\n        \"\"\"Turn the switch on.\"\"\"\n        try:\n            await self._camera.async_arm(True)\n\n        except TimeoutError as er:\n            raise HomeAssistantError(\n                translation_domain=DOMAIN,\n                translation_key=\"failed_arm_motion\",\n            ) from er\n        except UnauthorizedError as er:\n            self.coordinator.config_entry.async_start_reauth(self.hass)\n            raise ConfigEntryAuthFailed(\"Blink authorization failed\") from er\n\n        await self.coordinator.async_refresh()\n\n    @override\n    async def async_turn_off(self, **kwargs: Any) -> None:\n        \"\"\"Turn the switch off.\"\"\"\n        try:\n            await self._camera.async_arm(False)\n\n        except TimeoutError as er:\n            raise HomeAssistantError(\n                translation_domain=DOMAIN,\n                translation_key=\"failed_disarm_motion\",\n            ) from er\n        except UnauthorizedError as er:\n            self.coordinator.config_entry.async_start_reauth(self.hass)\n            raise ConfigEntryAuthFailed(\"Blink authorization failed\") from er\n","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/blink/switch.py#L65-L101","documentation":"ConfigEntryAuthFailed raised when turning ON the blink motion switch receives UnauthorizedError: the arm request was rejected because the Blink token is invalid. The handler calls async_start_reauth() then raises, flipping the entry into reauth state; the toggle operation is aborted.","triggerScenarios":"async_arm(True) gets a 401 from Blink because the stored auth token expired between the last successful refresh and this switch command.","commonSituations":"Switch automation fires hours after the token silently expired; Blink session rotation; account changes on the Blink side.","solutions":["Complete the reauth flow in the UI, then re-run the automation/scene","Verify steady-state polling is working (no repeated 401s in logs) after reauth"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    await switch.async_turn_on()\nexcept ConfigEntryAuthFailed:\n    _LOGGER.warning(\"Blink reauth required before arm commands will work\")","preventionTips":["Automate an alert when the Blink entry enters reauth so arm automations can be paused","Complete reauth before re-running motion automations"],"tags":["blink","auth","switch","reauth"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}