home-assistant/core · error · UpdateFailed

{error}

Error message

{error}

What it means

Raised by the AirNow DataUpdateCoordinator when pyairnow observations.latLong() fails with AirNowError (library/API error, e.g. invalid key or bad request), ClientConnectorError (cannot reach the API host), or InvalidJsonError (malformed response). The raw error string is passed straight into UpdateFailed, so the log/UI shows the library's message verbatim.

Source

Thrown at homeassistant/components/airnow/coordinator.py:81

            hass,
            _LOGGER,
            config_entry=config_entry,
            name=DOMAIN,
            update_interval=update_interval,
        )

    @override
    async def _async_update_data(self) -> dict[str, Any]:
        """Update data via library."""
        data: dict[str, Any] = {}
        try:
            obs = await self.airnow.observations.latLong(
                self.latitude,
                self.longitude,
            )

        except (AirNowError, ClientConnectorError, InvalidJsonError) as error:
            raise UpdateFailed(error) from error

        if not obs:
            raise UpdateFailed("No data was returned from AirNow")

        max_aqi = 0
        max_aqi_level = 0
        max_aqi_desc = ""
        max_aqi_poll = ""
        for obv in obs:
            # Convert AQIs to Concentration
            pollutant = obv[ATTR_API_AQI_PARAM]
            concentration = aqi_to_concentration(obv[ATTR_API_AQI], pollutant)
            data[obv[ATTR_API_AQI_PARAM]] = concentration

            # Overall AQI is the max of all pollutant AQIs
            if obv[ATTR_API_AQI] > max_aqi:
                max_aqi = obv[ATTR_API_AQI]
                max_aqi_level = obv[ATTR_API_CATEGORY][ATTR_API_CAT_LEVEL]

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Read the wrapped error text: 'Invalid API key' means regenerate the key at airnowapi.org and update the entry
  2. Verify the configured latitude/longitude are within the United States
  3. Confirm outbound HTTPS to airnowapi.org works from the HA host
  4. Stay under the 500 requests/hour key limit (check if multiple integrations/scripts share the key)
Defensive patterns

Strategy: retry

Prevention

When it happens

Trigger: Calling the coordinator update with an expired/invalid AirNow API key, coordinates outside the US where AirNow has no data returning an API error, network failure to airnowapi.org, or the API returning non-JSON (proxy/error page).

Common situations: AirNow API keys are rate-limited (500/hour) and expire; US-only service used with non-US coordinates; corporate proxy intercepting HTTPS.

Related errors


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