[aqi] Add NowCast AQI sensor using PM2.5 and PM10#79
Conversation
Uses PM2.5 and PM10 from the SEN55 via the built-in esphome aqi platform. Returns the higher of the two sub-indices per 2024 EPA breakpoints. Named "NowCast AQI" rather than "AQI" because the device lacks ozone and SO2.
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughA new AQI (Air Quality Index) sensor configuration was added to the ESPHome Core.yaml file. The sensor platform monitors air quality using PM2.5 and PM10.0 particle measurements, applying the NowCast AQI calculation method. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Integrations/ESPHome/Core.yaml`:
- Around line 310-315: The AQI sensor block using platform: aqi (id:
nowcast_aqi, calculation_type: AQI) does not set a device_class, so add an
explicit device_class: aqi entry to that sensor definition to ensure Home
Assistant recognizes it correctly (i.e., update the sensor with id nowcast_aqi
to include device_class: aqi).
Version: 25.12.18.2
What does this implement/fix?
Adds a NowCast AQI sensor to the AIR-1 using the built-in ESPHome
aqiplatform. The sensor takes PM2.5 and PM10 readings from the SEN55, computes an AQI sub-index for each using 2024 EPA breakpoints, and publishes the worse of the two values. The entity exposesdevice_class: aqiso Home Assistant formats and colours it correctly.Why "NowCast AQI" and not "AQI"?
The sensor is callback-driven — it updates the moment either PM sensor publishes a new reading, so no additional poll interval is needed and it adds no overhead to the
reportAllValuesscript.Types of changes
Checklist / Checklijst:
If user-visible functionality or configuration variables are added/modified: