A custom integration for Home Assistant to monitor air quality using Google’s Air Quality API. This integration fetches current air quality data and provides forecasts for up to 96 hours in the future.
- Real-time Air Quality Monitoring:
- Current air quality index (AQI)
- Pollutants: PM2.5, PM10, CO, NO₂, O₃, SO₂, and more
- Health recommendations based on AQI levels
- Forecasting:
- Up to 96 hours of hourly air quality forecasts
- Provides forecasted AQI and dominant pollutants
- Attributes:
- Includes pollutant sources, effects, and additional metadata (configurable)
- Open HACS in your Home Assistant instance.
- Go to Integrations and click + Explore & Download Repositories.
- Add this repository as a custom repository:
https://github.com/bairnhard/home-assistant-google-aqi
. - Search for Google AQI and install the integration.
- Download the latest release from the Releases page.
- Extract the contents into your Home Assistant
custom_components/google_aqi/
directory. - Restart Home Assistant.
-
Go to Settings > Devices & Services > + Add Integration.
-
Search for Google AQI and click to configure.
-
Enter the following details:
- API Key: Your Google Air Quality API key.
- Latitude and Longitude: The location for air quality monitoring. (your home location by default)
- Current Update Interval (hours): How often to fetch current air quality data (default: 1 hour, range: 1–24 hours).
- Forecast Update Interval (hours): How often to fetch forecast data (default: 6 hours, range: 1–24 hours).
- Forecast Length (hours): Number of hours to forecast (default: 24 hours, max: 96 hours).
- Get Additional Info?: Check to include pollutant sources and effects in attributes.
-
Save the configuration.
- Air Quality Index (AQI): Universal AQI based on pollutants.
- Pollutants:
pm25
,pm10
,co
,no2
,o3
,so2
- Attributes:
value
,unit
,sources
,effects
(optional)
- Indices:
index_uaqi
: AQI value, category, and dominant pollutantindex_deu_uba
(if applicable): Localized AQI index or any other local index.
- Metadata:
region
last_update
- Forecast: A list of dictionaries for up to 96 hours, each containing:
datetime
: Forecast hour (UTC)aqi
: Forecasted AQIdominant_pollutant
: Forecasted dominant pollutant
- Current API:
last_current_api_call
next_current_api_call
current_api_status
:successful
orerror
- Forecast API:
last_forecast_api_call
next_forecast_api_call
forecast_api_status
:successful
orerror
- Go to the Google Cloud Console.
- Create a project and enable the Air Quality API.
- Generate an API key and add it to the integration configuration.
If you encounter any issues or have feature requests, please open an issue on the GitHub repository.
This project is licensed under the MIT License.