Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix IKEA VINDSTYRKA: Translate VOC index to tVOC level. #7297

Merged
merged 7 commits into from
Dec 14, 2023
Merged

Bug fix IKEA VINDSTYRKA: Translate VOC index to tVOC level. #7297

merged 7 commits into from
Dec 14, 2023

Conversation

ebaauw
Copy link
Collaborator

@ebaauw ebaauw commented Oct 13, 2023

The IKEA VINDSTYRKA doesn't report tVOC level, but some VOC index instead, see #7246.

This PR translates the VOC index to tVOC level, using the translation table from:
https://learn.kaiterra.com/hs-fs/hubfs/Email%20Series/IAQ%20Series/AQI%20tvoc.png?width=1932&name=AQI%20tvoc.png:

https://learn.kaiterra.com/hs-fs/hubfs/Email%20Series/IAQ%20Series/AQI%20tvoc.png?width=1932&name=AQI%20tvoc.png

@ebaauw ebaauw requested a review from manup October 13, 2023 13:51
@ebaauw ebaauw added Fix Device Improvement Additional tag to attach to a existing issue. labels Oct 13, 2023
@ebaauw ebaauw added this to the v2.24.2-beta milestone Oct 13, 2023
@ebaauw ebaauw mentioned this pull request Oct 13, 2023
@SwoopX
Copy link
Collaborator

SwoopX commented Oct 13, 2023

@ebaauw Maybe I can convince you on the Develco approach, as it is a bit leaner?

{
          "name": "state/airqualityppb",
          "awake": true,
          "parse": {
            "at": "0x0000",
            "cl": "0xfc03",
            "ep": 38,
            "fn": "zcl:attr",
            "mf": "0x1015",
            "eval": "if (Attr.val != 65535) { Item.val = Attr.val; }"
          }
        },
        {
          "name": "state/airquality",
          "awake": true,
          "parse": {
            "fn": "numtostr",
            "srcitem": "state/airqualityppb",
            "op": "le", "to": [65, "excellent", 220, "good", 660, "moderate", 5000, "unhealthy", 65535, "out of scale"]
          }
        },

Use static tVOC density values for `max` (5500) and `min` (0).
@ebaauw
Copy link
Collaborator Author

ebaauw commented Oct 14, 2023

Maybe I can convince you on the Develco approach, as it is a bit leaner?

Sorry, I don't understand what you mean?

  • The VINDSTYRKA doesn't report tVOC density in ppb, but some index value instead, which needs to be translated to the tVOC density, following the listed table.
  • I thought we decided we wanted to move towards measured_value and corresponding capabilities?

@LeoeLeoeL
Copy link

Please check this:
image
The "excellent/good/moderate etc." seems to be updated non correctly.

@ebaauw
Copy link
Collaborator Author

ebaauw commented Oct 15, 2023

Please check this:

I have no idea what "this" is. Note that "this" uses six colours, where the deCONZ API only reports five values, so my guess would be the graphs attach their own labels, based on airqualityppb, instead of using airquality.

Please list the ZHAAirQuality API resource, after reading the VINDSTYRKA's 0xFC7E cluster attributes in the GUI. And please double-check that you're using the DDF from this PR, having installed both the DDF and the JS script file to /usr/share/deCONZ/devices/ikea.

Note that measured_value, airqualityppb and airquality are updated when reading or receiving a report from 0xFC7E/0x0000. Also note that PM2.5 has a different scale, which is used for airquality in the ZHAParticulateMatter resource.

The ZHAAiqQuality should report the same airquality values as the other ZHAAirQuality sensors, since I simply copied the numtostr logic from those:

From To AirQuality
0 65 excellent
66 220 good
221 660 moderate
661 5000 unhealthy
5001 65535 out of scale

I don't know the source of this mapping; in particular, I don't know where the 65 threshold comes from, nor why unhealthy doesn't go up to 5500. Last time I checked, this is a jungle, with different organisations / government bodies from different countries recommending/prescribing different thresholds, labels or even number of labels used.

@LeoeLeoeL
Copy link

LeoeLeoeL commented Oct 15, 2023

Don't look at the colours. This colour code is for PM 2.5. I only used that for TVOC.

But look those values:
Column 1: 83 - Excellent
Column 2: 150 - Good
Column 3: 206 - Excellent
How can Column 3 be excellent with a value higher than in column 2 that is good?
I verified; The "excellent/good/moderate etc." seems to not be updated when they need.
I came back to 2.23.2 and everything works ok again.

P.S.:
The mapping of PM25 in the DDF (2.32.2) is:
10 excellent,
20 good,
25 moderate,
50 poor,
75 unhealthy,
65535 out of scale
but shoul be:
0 Good
13 Moderate
36 Unhealthy for sensitive groups
56 Unhealthy
151 Very unhealthy
251 Hazardous

@ebaauw
Copy link
Collaborator Author

ebaauw commented Nov 28, 2023

@LeoeLeoeL, please open new issues for the PM2.5 mapping, including the source for this mapping, and the airquality not being updated issue. This PR is about the tVOC index for the Vindstyrka.

@manup manup merged commit d8d602f into dresden-elektronik:master Dec 14, 2023
1 check passed
@ebaauw ebaauw deleted the vindstyrka branch December 14, 2023 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Device Improvement Additional tag to attach to a existing issue. Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants