Native air quality type with colors based on value

Hello

I retrieve IQAir data (https://www.iqair.com/) via a Python script, which gives the air quality near you.
The information arrives at Gladys with an MQTT publication

As you can see on the website, there is a threshold (here 46), and depending on the threshold, there is an associated color. As long as the threshold is below 50, the associated color is green, between 50 and 100, it’s yellow, etc…

My question is: « How do I display a color based on predefined thresholds? »

Thanks in advance
Olivier

Hello @bong101, currently this is not possible, however this would be a nice feature and not very complicated to code :slight_smile:

We would need to create an « air quality » type in Gladys, and enter the different value thresholds. We already do this with humidity!

I will convert this post into a feature request.

Edit: It’s done!

Super, Thanks!!

Hello @bong101, I’m happy to announce that @AlexTrovato has developed the feature for Co2 sensors!

It looks like this:

I just merged the PR on master, it will go out in the next version of Gladys :slight_smile:

It’s not yet a complete air quality management (AQI, fine particles, etc.), but it’s a first start :slight_smile:

Good, but I think there was some confusion about the values. I don’t find the same recommendations as what we put:

Indeed, I took the reference from the website mentioned at the beginning of the topic, the ratios may not be correct.
But it should be simple to change them.

It was AQI on the site (an air quality standard), here it was ppm (amount of CO2 in the air) :slight_smile:

I’ll change it!

Changed!

For your information, this change is available in Gladys Assistant v4.8.2!

@bong101 Does this answer your request (For now, we only manage CO2), or would you like to have an « AQI » type in Gladys?

Good, well, it’s great in terms of reactivity.
I just restarted watchover, I’m testing and I’ll reply tomorrow.

AQI?, what is that?

You’re the one who told us about it :smiley:

AQI = Air Quality Index

It’s a unit of measurement for air quality, which takes into account several measures (fine particles, etc…)

Here, @AlexTrovato has only worked on CO2, so I’m not sure if that’s your original request.

Oh yes, that’s true… :stuck_out_tongue_winking_eye:

Actually, my request was more generic… a sensor that returns values, levels, and depending on the level in which the value is located, a color display. This could be used for anything, the water tank, all kinds of sensors … well, I think.

In any case, I will test this as soon as watchover has made the update

thanks

We didn’t do that generically in Gladys, we try to code everything turnkey so that it’s easy to use and works by default :slight_smile: So the CO2 levels are in Gladys in the code (it’s not something that changes), if we want to add more (AQI for example), we will have to do the development too :slight_smile:

I’ve made a PR that adds AQI + color display

It’s merged into master, it will be included in the next Gladys release!

Thanks @VonOx for the PR :folded_hands:

I tested all 6 possible states, everything is fine for me :






I’m closing this thread to free up the votes.