home-assistant/core · error · UpdateFailed

Error communicating with API: {e}

Error message

Error communicating with API: {e}

What it means

Raised as UpdateFailed by AdaxCloudCoordinator._async_update_data when the aiohttp call to the Adax cloud API raises an OSError (connection reset, DNS failure, timeout at the socket level). UpdateFailed tells the DataUpdateCoordinator framework that this poll failed but is transient; the coordinator keeps the previous data, marks entities unavailable per coordinator policy, and schedules a retry at the next update interval.

Source

Thrown at homeassistant/components/adax/coordinator.py:64

            if hasattr(self.adax_data_handler, "fetch_rooms_info"):
                rooms = await self.adax_data_handler.fetch_rooms_info() or []
                _LOGGER.debug("fetch_rooms_info returned: %s", rooms)
            else:
                _LOGGER.debug("fetch_rooms_info method not available, using get_rooms")
                rooms = []

            if not rooms:
                _LOGGER.debug(
                    "No rooms from fetch_rooms_info, trying get_rooms as fallback"
                )
                rooms = await self.adax_data_handler.get_rooms() or []
                _LOGGER.debug("get_rooms fallback returned: %s", rooms)

            if not rooms:
                raise UpdateFailed("No rooms available from Adax API")

        except OSError as e:
            raise UpdateFailed(f"Error communicating with API: {e}") from e

        for room in rooms:
            room["energyWh"] = int(room.get("energyWh", 0))

        return {r["id"]: r for r in rooms}


class AdaxLocalCoordinator(DataUpdateCoordinator[dict[str, Any] | None]):
    """Coordinator for updating data to and from Adax (local)."""

    def __init__(self, hass: HomeAssistant, entry: AdaxConfigEntry) -> None:
        """Initialize the Adax coordinator used for Local mode."""
        super().__init__(
            hass,
            config_entry=entry,
            logger=_LOGGER,
            name="AdaxLocal",
            update_interval=SCAN_INTERVAL,

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Verify outbound connectivity to the Adax cloud API (curl the endpoint from the same host) and check DNS resolution.
  2. Wait for the next coordinator poll; transient OSErrors self-heal because UpdateFailed schedules a retry.
  3. Check the Adax account credentials in the config entry; re-authenticate via the UI if tokens expired (though that usually raises a different error).
  4. If persistent, enable debug logging for the adax integration (logger: homeassistant.components.adax: debug) to see the underlying OSError text embedded in the message.
  5. Inspect the adax library version for known connection-handling bugs and bump it if a fix exists.
Defensive patterns

Strategy: retry

Type guard

def is_adax_cloud_reachable() -> bool:
    """Cheap pre-flight is not possible from caller code; rely on coordinator state."""
    return coordinator.last_update_success

Try / catch

try:
    data = await coordinator.async_config_entry_first_refresh()  # or async_refresh()
except UpdateFailed as err:
    _LOGGER.warning("Adax cloud poll failed, will retry: %s", err)

Prevention

When it happens

Trigger: Any OSError escaping self.adax_data_handler.get_rooms_info() (and the get_rooms() fallback) during a coordinator poll: no route to the Adax cloud endpoint, TLS handshake failure, or the server closing the connection mid-response.

Common situations: Adax cloud outage or rate limiting, local internet drop, DNS problems, or a corporate proxy blocking aiohttp traffic. Also seen after Adax API changes if the client library builds malformed requests that cause connection resets.

Related errors


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