WAQI Air Quality Attributes (getting air quality data and building a separate entity for each attribute)

Hi there,

I’m new to Home assistant and have a simple question regarding the attributes of a sensor. Someone already thoughtfully put together a platform sensor to pull down AQI, however, all the key pollutants are an “attribute” to the main AQI sensor value. The problem statement is that I want to run controls based on those key attributes (ie., when PM2.5> X, announce for kids to close the windows.)

For example, when you download and use the waqi sensor integration, it yields these attributes of the Main AQI variable:

state_class: measurement
attribution: >- the org supplying the measurement
time: ‘2022-10-09 11:00:00’
dominentpol: pm25
co: 0.1
humidity: 78
nitrogen_dioxide: 8.7
ozone: 9.1
pressure: 1024.2
pm_10: 28
pm_2_5: 60
sulfur_dioxide: 1.3
temperature: 18
w: 0.5
wg: 1
unit_of_measurement: AQI
device_class: aqi
icon: mdi:cloud
friendly_name: your city Air Quality

Can anyone help me with how within home assistant I can make a separate sensor for each of the pollutants? I’ve have done similar brute force work in Node Red to pull out JSON data and push it back into home assistant. However, that’s been a band-aid for learning how to parse information in home assistant (And learn how to do things right).

Can any of you help me with one example? Here is the link to the waqi integration.

This is super useful and I don’t think people are using it because the really good attributes are hidden and people think they are just getting the generic AQI value on the highest level.

I appreciate all of you who volunteer to help us get better!

@Foosman I just saw a pull request in the HA Core to implement the WAQI attributes as entities :slight_smile: