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: AOSmithConfigEntryView on GitHub (pinned to 58a3fdb3ea)
Solutions
- Check the {err} detail in logs to identify HTTP status vs parsing failure
- Verify connectivity and wait out transient cloud errors — the coordinator retries automatically
- 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
- Distinguish auth failures from generic API failures so reauth is not spuriously triggered
- Rely on coordinator backoff for transient cloud errors
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
- Unable find multi-factor auth module: {mfa_module_id}
- api_error
- Error communicating with API: {err}
- err
- update_error_not_found
AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14).
Data as JSON: /api/errors/f2e55140af4a3a39.
Report an issue: GitHub.