Integration of the "sensirion VOC index"

Hello,

The IKEA Vindstyrka sensor can measure humidity, temperature, PM2.5 as well as a VOC index.

This last measurement is reported by the « Sensirion VOC index » in zigbee2mqtt:
The index has a scale of 0 to 500 with a reference value of 100, which represents the average air quality over the past 24 hours.
A measurement below 100 indicates an improvement in air quality, and above indicates a deterioration.

This measurement is not supported by Gladys. Is it possible to integrate it into Gladys?

Thanks

Hello @wtuxii,

I think we should focus on integrating this sensor, but the « VOC » (or « COV » in French) is already supported.

I can’t remember who had worked on that, @pierre-gilles or @cicoub13?

Are VOC and voc_index the same?

We already handle VOC in Zigbee2mqtt, but I find it surprising that IKEA created a different variable — is it really the same unit?

See:

Good question, I hadn’t thought it might be different, my bad.

The brand explains:

The VOC Index describes the current VOC status in a room relative to the sensor’s
recent history. In this way, the VOC Index behaves like a human nose

Indeed, they are two different types.

The VOC returns an absolute value while the voc_index is actually more of a rate of change.

For UI integration, we could represent its value with arrows like the sensor’s display:

:up_right_arrow: worsening air quality
:right_arrow: stable
:down_right_arrow: improving air quality

Exposing the numeric

1 Like

We can do it with colors in Gladys (red => not good, etc…)

What would be the rule for this sensor? If someone does the development here, we should do the legwork in advance :slight_smile:

We could base it on the documentation:

0 - 150 : green
150 - 250 : yellow
250 - 400 : orange
400 - 500 : red

1 Like

Ok :slight_smile: I’ll let people vote for this feature then, don’t hesitate to vote yourself @wtuxii, we prioritize features based on votes!

@wtuxii,
Does this work for you?

image

image

image

image

Are you ready to install a test image and test it live?

4 Likes

the image for testing
willde71/gladys-test:voc_index

@pierre-gilles, the PR

Perfect :ok_hand:

Is it possible to change the color of the arrow in the chart?
:up_right_arrow: red :down_right_arrow: green

same for PM2.5

1 Like

In the charts it’s a separate development. I don’t think these are the only data to invert.
The best thing is to make a development request.

2 Likes

There is a parameter in the Gladys front-end in the charts to indicate whether a data point is « positive » or « negative » to make the arrow red or green :slight_smile: You can look in the Chart component — you should find it easily!

If that’s not the case, tell me :slight_smile:

Ok, I’ll take a look and get back to you

Edit: I found it!
image
The only snag is that the value of voc_index has no unit! No problem for the other data.

Ah! We’ll have to modify the code then ^^

or else create a unit type « no unit » without modifying the code in the charts.
I’m open to that idea otherwise.

We could maybe open a dedicated thread (and a PR) for modifying the data in the charts?
Because for now only DEVICE_FEATURE_UNITS.WATT_HOUR is inverted.

if this can help

[quote="_Will_71, post:16,

Ok in that case you can already review this PR.

I’ll look into making another PR for the change in the charts.

1 Like

Thanks for the PR @_Will_71! :slight_smile: I’ve left you some feedback:

1 Like