home-assistant/core · error · ConfigEntryNotReady

{error_message}

Error message

{error_message}

What it means

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.

Source

Thrown at homeassistant/components/androidtv/__init__.py:218

async def async_setup_entry(hass: HomeAssistant, entry: AndroidTVConfigEntry) -> bool:
    """Set up Android Debug Bridge platform."""

    state_det_rules = entry.options.get(CONF_STATE_DETECTION_RULES)
    if CONF_ADB_SERVER_IP not in entry.data:
        exceptions = ADB_PYTHON_EXCEPTIONS
    else:
        exceptions = ADB_TCP_EXCEPTIONS

    try:
        aftv, error_message = await async_connect_androidtv(
            hass, entry.data, state_detection_rules=state_det_rules
        )
    except exceptions as exc:
        raise ConfigEntryNotReady(exc) from exc

    if not aftv:
        raise ConfigEntryNotReady(error_message)

    async def async_close_connection(event: Event) -> None:
        """Close Android Debug Bridge connection on HA Stop."""
        await aftv.adb_close()

    entry.async_on_unload(
        hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, async_close_connection)
    )
    entry.async_on_unload(entry.add_update_listener(update_listener))

    entry.runtime_data = AndroidTVRuntimeData(aftv, entry.options.copy())

    await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)

    return True


async def async_unload_entry(hass: HomeAssistant, entry: AndroidTVConfigEntry) -> bool:

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Accept/enable the debugging authorization dialog on the TV if shown.
  2. Verify port 5555 is open to the HA host and the TV's IP is current.
  3. Restart ADB debugging on the device (toggle Developer Options) and reload the integration.
  4. Check the exact error_message in logs — it names which connect strategy failed.
Defensive patterns

Strategy: retry

Try / catch

ConfigEntryNotReady is not an exception to catch in user code — inspect entry.state/reason; the message names the failed connect path.

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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