home-assistant/core · error · UpdateFailed

Error communicating with API: {err}

Error message

Error communicating with API: {err}

What it means

An UpdateFailed raised with message 'Error communicating with API: {err}' when the A. O. Smith coordinator's get_devices() call raises AOSmithUnknownException. Credentials problems are separately mapped to ConfigEntryAuthFailed; this error covers every other failure talking to the service, so the coordinator retries with backoff.

Source

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

        """Initialize the coordinator."""
        super().__init__(
            hass,
            _LOGGER,
            config_entry=config_entry,
            name=DOMAIN,
            update_interval=REGULAR_INTERVAL,
        )
        self.client = client

    @override
    async def _async_update_data(self) -> dict[str, AOSmithDevice]:
        """Fetch latest data from the device status endpoint."""
        try:
            devices = await self.client.get_devices()
        except AOSmithInvalidCredentialsException as err:
            raise ConfigEntryAuthFailed from err
        except AOSmithUnknownException as err:
            raise UpdateFailed(f"Error communicating with API: {err}") from err

        mode_pending = any(device.status.mode_change_pending for device in devices)
        setpoint_pending = any(
            device.status.temperature_setpoint_pending for device in devices
        )

        if mode_pending or setpoint_pending:
            self.update_interval = FAST_INTERVAL
        else:
            self.update_interval = REGULAR_INTERVAL

        return {device.junction_id: device for device in devices}


class AOSmithEnergyCoordinator(DataUpdateCoordinator[dict[str, float]]):
    """Coordinator for energy usage data, updating with a slower interval."""

    config_entry: AOSmithConfigEntry

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Check the {err} detail in logs to identify HTTP status vs parsing failure
  2. Verify connectivity and wait out transient cloud errors — the coordinator retries automatically
  3. Update Home Assistant to pick up a current py-aosmith if the API response format changed
Defensive patterns

Strategy: retry

Try / catch

try:
    devices = await self.client.get_devices()
except AOSmithInvalidCredentialsException as err:
    raise ConfigEntryAuthFailed from err
except AOSmithUnknownException as err:
    raise UpdateFailed(f"Error communicating with API: {err}") from err

Prevention

When it happens

Trigger: await self.client.get_devices() failing for non-auth reasons: aiohttp connection errors, 5xx from the API, unexpected response payloads parsed by py-aosmith, or rate limiting.

Common situations: A. O. Smith cloud outage or maintenance, local network problems, or a py-aosmith version lagging an API schema change (device status fields renamed).

Related errors


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