# Intégration du "sensirion VOC index"

**URL:** <https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558>\
**Category:** Demandes livrées\
**Created:** [Novembre 29, 2023, 9:15 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558 "2023-11-29T21:15:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![wtuxii](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/w/ce73a5/32.png) [@wtuxii](https://community.gladysassistant.com/u/wtuxii)\
**Post date:** [Novembre 29, 2023, 9:15 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/1 "2023-11-29T21:15:13Z")

</div>

Bonjour,

Le capteur IKEA Vindstyrka permet de mesurer l’humidité, température, PM2.5 ainsi qu’un indice VOC.

Cette dernière mesure est reportée par le «&nbsp;Sensirion VOC index&nbsp;» dans zigbee2mqtt :  
L’indice a une échelle de 0 à 500 avec pour valeur de référence 100 qui représente la qualité moyenne de l’air au cours des 24h dernières heures.  
Une mesure inférieure à 100 indique une amélioration de la qualité de l’air, et au-dessus une dégradation.

Cette mesure n’est pas prise en charge par Gladys. Est-il possible de l’intégrer dans gladys ?

Merci

---

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [Novembre 30, 2023, 8:04 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/2 "2023-11-30T08:04:40Z")

</div>

Bonjour @wtuxii,

Je pense plutôt qu’il faudrait travailler sur l’intégration de ce capteur, mais le «&nbsp;VOC&nbsp;» (ou COV en Français) est déjà supporté.  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/5/5c86699bb61f4ce46ed9abc75d74b7cb9155ea63.png)

Je ne sais plus qui avait travaillé là dessus, @pierre-gilles ou @cicoub13 ?

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Novembre 30, 2023, 8:29 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/3 "2023-11-30T08:29:58Z")

</div>

Est-ce que les VOC = voc\_index ?

On gère déjà les VOC dans Zigbee2mqtt, mais je trouve ça étonnant qu’IKEA ait créé une variable différente, est-ce que c’est vraiment la même unité ?

Cf :

> **[IKEA E2112 control via MQTT | Zigbee2MQTT](https://www.zigbee2mqtt.io/devices/E2112.html)**
>
> Integrate your IKEA E2112 via Zigbee2MQTT with whatever smart home infrastructure you are using without the vendor's bridge or gateway.

---

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [Novembre 30, 2023, 8:38 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/4 "2023-11-30T08:38:00Z")

</div>

Bonne question, je n’avais pas pensé que c’était peut être différent, _my bad_.

La marque explique :

> 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

> **[Info\_Note\_VOC\_Index.pdf](https://sensirion.com/media/documents/02232963/6294E043/Info_Note_VOC_Index.pdf)**
>
> 300.38 KB

---

<div class="post-metadata">

**Author:** ![wtuxii](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/w/ce73a5/32.png) [@wtuxii](https://community.gladysassistant.com/u/wtuxii)\
**Post date:** [Novembre 30, 2023, 8:50 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/5 "2023-11-30T08:50:29Z")

</div>

Effectivement, ce sont bien deux types différents.

Le VOC retourne une valeur absolue alors que le voc\_index est en fait plutôt une dérivée.

Pour l’intégration dans l’UI on pourrait interpréter sa valeur par des flèches comme le fait l’écran du capteur :  
↗ dégradation de la qualité de l’air  
➡ stable  
↘ amélioration de la qualité de l’air

Exposer la valeur numérique est aussi utile pour les scènes, par exemple régler la puissance d’un purificateur

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Novembre 30, 2023, 10:44 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/6 "2023-11-30T10:44:12Z")

</div>

> [@wtuxii](#):
>
> Pour l’intégration dans l’UI on pourrait interpréter sa valeur par des flèches comme le fait l’écran du capteur :

On peut le faire avec les couleurs dans Gladys (rouge =\> pas bien, etc…)

Quelle serait la règle pour ce capteur ? Si quelqu’un fait le développement ici, il faut pré-mâcher le travail 🙂

---

<div class="post-metadata">

**Author:** ![wtuxii](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/w/ce73a5/32.png) [@wtuxii](https://community.gladysassistant.com/u/wtuxii)\
**Post date:** [Novembre 30, 2023, 11:14 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/7 "2023-11-30T11:14:51Z")

</div>

On pourrait se baser sur la doc :

0 - 150 : vert  
150 - 250 : jaune  
250 - 400 : orange  
400 - 500 : rouge

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Novembre 30, 2023, 12:10 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/8 "2023-11-30T12:10:18Z")

</div>

Ok 🙂 Je laisse les gens voter pour ce développement alors, n’hésite pas à voter toi même @wtuxii, on priorise les développements en fonction des votes !

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [Décembre 2, 2023, 9:35 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/9 "2023-12-02T21:35:58Z")

</div>

@wtuxii,  
Est-ce que cela te conviens?

![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/f/fab1a4c59e022e19f1530ddf57a9151c02812fbb.png)

![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/e/e5e11255b9b56af04f47b818a0e178901c618c2e.png)

![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/0/0c79a847ff70fed5276be10683c74b3b5695c29d.png)

![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/e/ea08071c7d9b6c312c82cdbecedea511a75aa14a.png)

Es tu prêt pour installer une image de test et tester en réel?

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [Décembre 2, 2023, 11:38 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/10 "2023-12-02T23:38:23Z")

</div>

l’image pour test  
`willde71/gladys-test:voc_index`

@pierre-gilles, la PR

> <https://github.com/GladysAssistant/Gladys/pull/1963>
>
> \### Pull Request check-list
> 
> To ensure your Pull Request can be accepted as fa…st as possible, make sure to review and check all of these items:
> 
> \- \[\] If your changes affects code, did your write the tests?
> \- \[\] Are tests passing? (\`npm test\` on both front/server)
> \- \[\] Is the linter passing? (\`npm run eslint\` on both front/server)
> \- \[\] Did you run prettier? (\`npm run prettier\` on both front/server)
> \- \[\] If you are adding a new features/services, did you run integration comparator? (\`npm run compare-translations\` on front)
> \- \[\] Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to the community (\[french forum\](https://community.gladysassistant.com/)/\[english forum\](https://en-community.gladysassistant.com/)) for testing before merging.
> \- \[\] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
> \- \[\] If you are adding a new features/services which needs explanation, did you modify the user documentation? See \[the GitHub repo\](https://github.com/GladysAssistant/v4-website) and the \[website\](https://gladysassistant.com).
> \- \[\] Did you add fake requests data for the demo mode (\`front/src/config/demo.js\`) so that the demo website is working without a backend? (if needed) See \[https://demo.gladysassistant.com\](https://demo.gladysassistant.com).
> 
> NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
> 
> \### Description of change
> 
> add voc\_index expose in zigbee2mqtt integration
> 
> !\[image\](https://github.com/GladysAssistant/Gladys/assets/11477113/f027f68e-6eee-40f1-b09e-f0b45854dc1b)

---

<div class="post-metadata">

**Author:** ![wtuxii](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/w/ce73a5/32.png) [@wtuxii](https://community.gladysassistant.com/u/wtuxii)\
**Post date:** [Décembre 3, 2023, 10:32 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/11 "2023-12-03T10:32:49Z")

</div>

nickel 👌

Est-il possible de changer la couleur de la flèche dans le graphique ?  
↗ rouge ↘ vert

idem pour les PM2.5

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [Décembre 3, 2023, 10:59 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/12 "2023-12-03T10:59:28Z")

</div>

Dans les graphiques c’est un développement a part. Car il n’y a pas que ces données a inverser je crois.  
Le mieux c’est de faire une demande de développement

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Décembre 4, 2023, 5:56 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/13 "2023-12-04T17:56:01Z")

</div>

> [@Will\_71](#):
>
> Dans les graphiques c’est un développement a part. Car il n’y a pas que ces données a inverser je crois.

Il y a un paramètre dans le front Gladys dans les charts pour indiquer si une donnée est «&nbsp;positive&nbsp;» ou «&nbsp;négative&nbsp;» pour mettre la flèche en rouge ou vert 🙂 Tu peux regarder dans le component de Chart tu devrais le trouver facilement !

Si c’est pas le cas dis moi 🙂

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [Décembre 4, 2023, 8:33 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/14 "2023-12-04T20:33:11Z")

</div>

Ok je regarde et je te redit

Edit: J’ai trouvé!  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/3/3919633aeda0705a902f6d7e32274df9467cf5c8.png)  
Le seul hic c’est que la valeur de `voc_index` n’a pas d’unité! Pour les autres données pas de souci.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Décembre 5, 2023, 8:10 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/15 "2023-12-05T08:10:45Z")

</div>

> [@Will\_71](#):
>
> Le seul hic c’est que la valeur de `voc_index` n’a pas d’unité!

ah ! il va falloir modifier le code alors ^^

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [Décembre 5, 2023, 9:54 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/16 "2023-12-05T21:54:46Z")

</div>

> [@pierre-gilles](#):
>
> ah ! il va falloir modifier le code alors ^^

ou alors créer un type unit «&nbsp;sans unité&nbsp;» sans modifier le code dans les charts.  
Preneur du idée sinon.

On pourrais peut-être faire un sujet spécifique (et un PR) pour la modification des données dans les graphiques?  
Car pour l’instant il n’y a que `DEVICE_FEATURE_UNITS.WATT_HOUR` qui est inversé.

---

<div class="post-metadata">

**Author:** ![cce66](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/c/8797f3/32.png) [@cce66](https://community.gladysassistant.com/u/cce66)\
**Post date:** [Décembre 5, 2023, 10:06 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/17 "2023-12-05T22:06:48Z")

</div>

si cela peut aider

> **[Info\_Note\_VOC\_Index.pdf](https://sensirion.com/media/documents/02232963/6294E043/Info_Note_VOC_Index.pdf)**
>
> 300.38 KB

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Décembre 6, 2023, 5:12 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/18 "2023-12-06T17:12:30Z")

</div>

> [@Will\_71](#):
>
> ou alors créer un type unit « sans unité » sans modifier le code dans les charts.

Non je pense pas que ce soit une bonne idée, il faut modifier le code !

> [@Will\_71](#):
>
> On pourrais peut-être faire un sujet spécifique (et un PR) pour la modification des données dans les graphiques?

Oui carrément

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [Décembre 6, 2023, 8:51 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/19 "2023-12-06T20:51:18Z")

</div>

Ok dans ce cas tu pourras déjà faire une review de cette PR.

Je regarde pour faire une autre PR pour la modification dans les charts.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Décembre 7, 2023, 1:08 UTC](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558/20 "2023-12-07T13:08:01Z")

</div>

Merci pour la PR @Will_71 ! 🙂 Je t’ai fais un retour:

> <https://github.com/GladysAssistant/Gladys/pull/1963#pullrequestreview-1770129212>
>
> \### Pull Request check-list
> 
> To ensure your Pull Request can be accepted as fa…st as possible, make sure to review and check all of these items:
> 
> \- \[\] If your changes affects code, did your write the tests?
> \- \[\] Are tests passing? (\`npm test\` on both front/server)
> \- \[\] Is the linter passing? (\`npm run eslint\` on both front/server)
> \- \[\] Did you run prettier? (\`npm run prettier\` on both front/server)
> \- \[\] If you are adding a new features/services, did you run integration comparator? (\`npm run compare-translations\` on front)
> \- \[\] Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to the community (\[french forum\](https://community.gladysassistant.com/)/\[english forum\](https://en-community.gladysassistant.com/)) for testing before merging.
> \- \[\] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
> \- \[\] If you are adding a new features/services which needs explanation, did you modify the user documentation? See \[the GitHub repo\](https://github.com/GladysAssistant/v4-website) and the \[website\](https://gladysassistant.com).
> \- \[\] Did you add fake requests data for the demo mode (\`front/src/config/demo.js\`) so that the demo website is working without a backend? (if needed) See \[https://demo.gladysassistant.com\](https://demo.gladysassistant.com).
> 
> NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
> 
> \### Description of change
> 
> add voc\_index expose in zigbee2mqtt integration
> 
> !\[image\](https://github.com/GladysAssistant/Gladys/assets/11477113/f027f68e-6eee-40f1-b09e-f0b45854dc1b)

[Page suivante](https://community.gladysassistant.com/t/integration-du-sensirion-voc-index/8558.md?page=2)
