home-assistant/core · error · UpdateFailed

{error}

Error message

{error}

What it means

UpdateFailed raised by WeatherUpdateCoordinator._async_update_data when self.aemet.update() raises AemetError inside a timeout(API_TIMEOUT) window. This is the polling failure path for the AEMET weather integration: the previous forecast data is kept, entities stay available with stale data, and the coordinator retries on the next WEATHER_UPDATE_INTERVAL tick.

Source

Thrown at homeassistant/components/aemet/coordinator.py:70

        """Initialize coordinator."""
        self.aemet = aemet

        super().__init__(
            hass,
            _LOGGER,
            config_entry=entry,
            name=DOMAIN,
            update_interval=WEATHER_UPDATE_INTERVAL,
        )

    @override
    async def _async_update_data(self) -> dict[str, Any]:
        """Update coordinator data."""
        async with timeout(API_TIMEOUT):
            try:
                await self.aemet.update()
            except AemetError as error:
                raise UpdateFailed(error) from error

        data = self.aemet.data()

        return {
            "forecast": {
                AOD_FORECAST_DAILY: self.aemet_forecast(data, AOD_FORECAST_DAILY),
                AOD_FORECAST_HOURLY: self.aemet_forecast(data, AOD_FORECAST_HOURLY),
            },
            "lib": data,
        }

    def aemet_forecast(
        self,
        data: dict[str, Any],
        forecast_mode: str,
    ) -> list[Forecast]:
        """Return the forecast array."""
        forecasts = dict_nested_value(data, [AOD_TOWN, forecast_mode, AOD_FORECAST])

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Check the {error} placeholder text in the log for the underlying reason (status code vs parse error).
  2. Verify the API key still works with a direct request to opendata.aemet.es; renew if expired.
  3. If rate-limiting, reduce update frequency via the integration options (increase the update interval) or share the key less.
  4. Wait for the next interval — transient AemetErrors self-heal through coordinator retries.
  5. Persistent parse errors usually mean an AEMET API response change: update the aemet library via a Home Assistant core update.
Defensive patterns

Strategy: retry

Type guard

def aemet_coordinator_healthy(coordinator) -> bool:
    """Last weather refresh succeeded (stale data otherwise served)."""
    return coordinator.last_update_success

Try / catch

from homeassistant.exceptions import UpdateFailed

try:
    await coordinator.async_refresh()
except UpdateFailed as err:
    _LOGGER.warning("AEMET update failed, keeping previous forecast: %s", err)

Prevention

When it happens

Trigger: Scheduled weather refresh where the AEMET Open Data API request fails (HTTP error, rate limit, bad key) or returns data the library cannot parse — all surface as AemetError and are wrapped here. A TimeoutError from the surrounding timeout() is a different, uncaught path.

Common situations: AEMET Open Data throttling (their API is aggressively rate-limited per key), API key expiry, temporary outage of the Spanish weather service, or network problems on the HA host.

Related errors


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