Skip to content

zenguru84/ha-openaq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌍 OpenAQ Integration for Home Assistant

OpenAQ Logo

This is a custom Home Assistant integration that connects to the OpenAQ API to provide real-time air quality data from thousands of monitoring stations worldwide.


✨ Features

  • 🌫️ Fetches live air quality data (PM1, PM2.5, PM10, CO, NO₂, SO₂, O₃, CO₂, etc.)
  • 🧭 Calculates US AQI (Air Quality Index) automatically
  • 📊 Exposes AQI value, level, and main pollutant as sensors
  • 🕒 Updates automatically every 5 minutes
  • ⚙️ Multi-station support (up to 3 stations)
  • 🧹 Cleanly handles station removal from UI
  • 🪶 Lightweight and fully async (no YAML required)
  • 🌍 Available in English and Romanian

🧩 Installation

Option 1 — One-click installation from HACS (recommended)

Open in HACS

Option 2 — manual installation

  1. Copy the folder custom_components/openaq into your Home Assistant config directory:
    /config/custom_components/openaq/
    
  2. Restart Home Assistant

⚙️ Configuration

  1. Go to Settings → Devices & Services → Add Integration → OpenAQ
  2. Enter your OpenAQ API Key (get one free from OpenAQ)
  3. Enter the Station ID (for example: 2163078)
  4. Done — your sensors will appear automatically.

To add more stations later:

Go to the gear icon (Options) in the integration → Add another Station ID.


📈 Exposed Entities

Each station will appear as a device under the OpenAQ integration and expose multiple sensor entities, including:

Sensor Description Unit
PM1 Particulate Matter ≤1 μm µg/m³
PM2.5 Particulate Matter ≤2.5 μm µg/m³
PM10 Particulate Matter ≤10 μm µg/m³
CO₂ Carbon Dioxide ppm
CO Carbon Monoxide ppm
NO₂ Nitrogen Dioxide µg/m³
O₃ Ozone µg/m³
SO₂ Sulfur Dioxide µg/m³
AQI U.S. Air Quality Index 0–500
AQI Level Text description (Good / Moderate / Unhealthy, etc.)
AQI Main Pollutant Parameter that defines AQI

🧮 Update Frequency

  • Latest measurements: every 5 minutes
  • Station metadata: every 12 hours

🧰 Troubleshooting

If Home Assistant fails to start after deleting a station:

  • Make sure your internet connection allows outbound HTTPS to api.openaq.org.

If no data appears:

  • Check your API key validity.
  • Verify that the Station ID exists in OpenAQ Explorer.

🤝 Contributing

Contributions, issues, and feature requests are welcome!
Feel free to open an issue or submit a Pull Request.


📜 License

This project is distributed under the MIT License.


💙 Acknowledgements


🏷️ Example Screenshots

(screenshots incoming)


🍺 If you find my work helpful, consider supporting it:

Buy Me a Beer


© 2025 zenguru84 — OpenAQ Home Assistant Integration