{"record":{"id":"3c338647b9e39b79","repo":"home-assistant/core","slug":"error-message","errorCode":null,"errorMessage":"{error_message}","messagePattern":"\\{error_message\\}","errorType":"exception","errorClass":"ConfigEntryNotReady","httpStatus":null,"severity":"error","filePath":"homeassistant/components/androidtv/__init__.py","lineNumber":218,"sourceCode":"\nasync def async_setup_entry(hass: HomeAssistant, entry: AndroidTVConfigEntry) -> bool:\n    \"\"\"Set up Android Debug Bridge platform.\"\"\"\n\n    state_det_rules = entry.options.get(CONF_STATE_DETECTION_RULES)\n    if CONF_ADB_SERVER_IP not in entry.data:\n        exceptions = ADB_PYTHON_EXCEPTIONS\n    else:\n        exceptions = ADB_TCP_EXCEPTIONS\n\n    try:\n        aftv, error_message = await async_connect_androidtv(\n            hass, entry.data, state_detection_rules=state_det_rules\n        )\n    except exceptions as exc:\n        raise ConfigEntryNotReady(exc) from exc\n\n    if not aftv:\n        raise ConfigEntryNotReady(error_message)\n\n    async def async_close_connection(event: Event) -> None:\n        \"\"\"Close Android Debug Bridge connection on HA Stop.\"\"\"\n        await aftv.adb_close()\n\n    entry.async_on_unload(\n        hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, async_close_connection)\n    )\n    entry.async_on_unload(entry.add_update_listener(update_listener))\n\n    entry.runtime_data = AndroidTVRuntimeData(aftv, entry.options.copy())\n\n    await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)\n\n    return True\n\n\nasync def async_unload_entry(hass: HomeAssistant, entry: AndroidTVConfigEntry) -> bool:","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/androidtv/__init__.py#L200-L236","documentation":"Raised as ConfigEntryNotReady(error_message) when async_connect_androidtv does NOT raise but returns (None, error_message) — the underlying androidtv/adb library reported a connect failure by return value instead of exception. The message comes from the library (e.g. 'Failed to connect to any of ...' or an ADB key/auth notice). Setup retries with backoff.","triggerScenarios":"The connect helper exhausts its connection attempts and returns a falsy device plus an explanatory string — typical when the ADB TCP endpoint is unreachable, the adb key is not yet authorized on the TV, or the adb server refused the device.","commonSituations":"First-time pairing where the TV shows an 'Allow USB debugging?' dialog that was dismissed, TV in standby with network ADB disabled, wrong port (5555 closed), or adb server version mismatch.","solutions":["Accept/enable the debugging authorization dialog on the TV if shown.","Verify port 5555 is open to the HA host and the TV's IP is current.","Restart ADB debugging on the device (toggle Developer Options) and reload the integration.","Check the exact error_message in logs — it names which connect strategy failed."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"ConfigEntryNotReady is not an exception to catch in user code — inspect entry.state/reason; the message names the failed connect path.","preventionTips":["Accept the 'Allow debugging' dialog on the TV when it appears.","Wake the TV before setup/reload; deep standby often closes port 5555."],"tags":["adb","network","androidtv","retry","config-entry-not-ready"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}