home-assistant/core · error · UpdateFailed

Error communicating with API: {err}

Error message

Error communicating with API: {err}

What it means

UpdateFailed raised by the Aquacell coordinator when fetching softener data raises AquacellApiException or TimeoutError (after a successful token refresh). It signals a transport/server-level failure talking to the Aquacell cloud API; the DataUpdateCoordinator will retry on its schedule and entities keep their last values.

Source

Thrown at homeassistant/components/aquacell/coordinator.py:86

        async with asyncio.timeout(30):
            # Check if the refresh token is expired
            expiry_time = (
                self.refresh_token_creation_time
                + REFRESH_TOKEN_EXPIRY_TIME.total_seconds()
            )
            try:
                if time.time() >= expiry_time:
                    await self._reauthenticate()
                else:
                    await self.aquacell_api.authenticate_refresh(self.refresh_token)
                _LOGGER.debug("Logged in using: %s", self.refresh_token)

                softeners = await self.aquacell_api.get_all_softeners()
            except AuthenticationFailed as err:
                raise ConfigEntryAuthFailed from err
            except (AquacellApiException, TimeoutError) as err:
                raise UpdateFailed(f"Error communicating with API: {err}") from err

        return {softener.dsn: softener for softener in softeners}

    async def _reauthenticate(self) -> None:
        _LOGGER.debug("Attempting to renew refresh token")
        refresh_token = await self.aquacell_api.authenticate(self.email, self.password)
        self.refresh_token = refresh_token
        data = {
            **self.config_entry.data,
            CONF_REFRESH_TOKEN: self.refresh_token,
            CONF_REFRESH_TOKEN_CREATION_TIME: time.time(),
        }

        self.hass.config_entries.async_update_entry(self.config_entry, data=data)

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Check HA's outbound network (DNS, proxy, firewall) and the Aquacell cloud status; retrying usually resolves transient faults.
  2. If errors repeat every poll, re-authenticate: delete and re-create the Aquacell config entry to force a fresh login (password change/expire is a common cause).
  3. Confirm the refresh token timestamp stored in entry data is current; a clock skew on the host can force the reauthenticate path repeatedly.
  4. Reduce sensor scan interval if the API appears rate-limited.
Defensive patterns

Strategy: retry

Try / catch

try:
    softeners = await aquacell_api.get_all_softeners()
except TimeoutError:
    raise UpdateFailed("Error communicating with API: timeout") from None

Prevention

When it happens

Trigger: In _async_update_data: refresh-token auth succeeds but aquacell_api.get_all_softeners() raises AquacellApiException (HTTP/cloud error) or TimeoutError; also re-raised when the outer softeners fetch is stale and the re-fetch path fails the same way.

Common situations: Aquacell cloud outage or rate limiting; flaky internet/DNS at the HA host; token partially expired causing degraded API behavior; softener offline so the backend errors per-device.

Related errors


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