home-assistant/core · error · ConfigEntryNotReady

Could not connect to Autoskope API

Error message

Could not connect to Autoskope API

What it means

Raised as ConfigEntryNotReady from the Autoskope integration when api.connect() raises CannotConnect, indicating a network-level failure reaching the Autoskope API (timeout, DNS failure, connection refused). Home Assistant will retry setup with exponential backoff rather than treating it as a permanent failure.

Source

Thrown at homeassistant/components/autoskope/__init__.py:36

async def async_setup_entry(hass: HomeAssistant, entry: AutoskopeConfigEntry) -> bool:
    """Set up Autoskope from a config entry."""
    session = async_create_clientsession(hass, cookie_jar=aiohttp.CookieJar())

    api = AutoskopeApi(
        host=entry.data.get(CONF_HOST, DEFAULT_HOST),
        username=entry.data[CONF_USERNAME],
        password=entry.data[CONF_PASSWORD],
        session=session,
    )

    try:
        await api.connect()
    except InvalidAuth as err:
        raise ConfigEntryAuthFailed(
            "Authentication failed, please check credentials"
        ) from err
    except CannotConnect as err:
        raise ConfigEntryNotReady("Could not connect to Autoskope API") from err

    coordinator = AutoskopeDataUpdateCoordinator(hass, api, entry)
    await coordinator.async_config_entry_first_refresh()

    entry.runtime_data = coordinator

    await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)

    return True


async def async_unload_entry(hass: HomeAssistant, entry: AutoskopeConfigEntry) -> bool:
    """Unload a config entry."""
    return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Check general internet connectivity and DNS from the Home Assistant host (e.g. curl the Autoskope API host).
  2. Verify the Autoskope service status / try the mobile app from the same network.
  3. If a firewall or proxy filters outbound traffic, allow the Autoskope API host.
  4. Wait — ConfigEntryNotReady retries automatically; if it recovers, no action is needed.
Defensive patterns

Strategy: retry

Validate before calling

import socket

def endpoint_reachable(host: str, port: int = 443, timeout: float = 3.0) -> bool:
    try:
        socket.create_connection((host, port), timeout=timeout).close()
        return True
    except OSError:
        return False

Try / catch

from homeassistant.exceptions import ConfigEntryNotReady

try:
    await api.connect()
except ConfigEntryNotReady:
    # HA retries setup with backoff; safe to propagate
    raise

Prevention

When it happens

Trigger: AutoskopeApi.connect() cannot open its HTTP session: the Autoskope cloud endpoint is unreachable, DNS fails, TLS handshake times out, or a proxy/firewall blocks the outbound request.

Common situations: Internet outage; local DNS problems; Autoskope service downtime; firewall or ad-blocker blocking the API host; slow network causing the connect call to exceed its timeout.

Related errors


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