Open
Conversation
The next commit will add new level names for CO2 and VOC, so make clear that these ranges are specific to radon levels.
This is similar to the Radon level strings, but for VOC. The levels and descriptions were taken from [1]. I merely copied the ranges provided by Airthings and do not claim that they are reasonable, accurate or otherwise. This is convenient as an end-user has no idea what are acceptable measurements, giving them a text sensor makes it easier to spot problems. [1]: https://www.airthings.com/en-ca/contaminants/what-is-voc
This is similar to the Radon level strings, but for CO2. The levels and descriptions were taken from [1]. I merely copied the ranges provided by Airthings and do not claim that they are reasonable, accurate or otherwise. This is convenient as an end-user has no idea what are acceptable measurements, giving them a text sensor makes it easier to spot problems. [1]: https://www.airthings.com/en-ca/contaminants/what-is-carbon-dioxide
|
I vote for this. This is the first thing I did after adding the airthings devices. I had to use template sensors, having them from source would be great. |
|
There's a typo in the PR, "extremelly" should be 'extremely'. I'm also not sure how translations might be handled. I should clarify, I've no involvement in any of these products, just bought a few AirThings BLE devices and looking to capture data. |
mkaatman
reviewed
Jun 23, 2025
| CO2_INDOOR_NORMAL = (400, 999, "indoor normal") | ||
| CO2_HIGH = (1000, 1999, "high") | ||
| CO2_VERY_HIGH = (2000, 4999, "very high") | ||
| CO2_EXTREMELLY_HIGH = (5000, 39999, "extremelly high") |
There was a problem hiding this comment.
Suggested change
| CO2_EXTREMELLY_HIGH = (5000, 39999, "extremelly high") | |
| CO2_EXTREMELY_HIGH = (5000, 39999, "extremely high") |
mkaatman
reviewed
Jun 23, 2025
| CHAR_UUID_WAVE_PLUS_DATA, | ||
| CHAR_UUID_WAVEMINI_DATA, | ||
| CO2_CRITICAL, | ||
| CO2_EXTREMELLY_HIGH, |
There was a problem hiding this comment.
Suggested change
| CO2_EXTREMELLY_HIGH, | |
| CO2_EXTREMELY_HIGH, |
mkaatman
suggested changes
Jun 23, 2025
| co2_level = CO2_HIGH[2] | ||
| elif data <= CO2_VERY_HIGH[1]: | ||
| co2_level = CO2_VERY_HIGH[2] | ||
| elif data <= CO2_EXTREMELLY_HIGH[1]: |
There was a problem hiding this comment.
Suggested change
| elif data <= CO2_EXTREMELLY_HIGH[1]: | |
| elif data <= CO2_EXTREMELY_HIGH[1]: |
| elif data <= CO2_VERY_HIGH[1]: | ||
| co2_level = CO2_VERY_HIGH[2] | ||
| elif data <= CO2_EXTREMELLY_HIGH[1]: | ||
| co2_level = CO2_EXTREMELLY_HIGH[2] |
There was a problem hiding this comment.
Suggested change
| co2_level = CO2_EXTREMELLY_HIGH[2] | |
| co2_level = CO2_EXTREMELY_HIGH[2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It is very convenient to have the radon sensors that translate the numeric value into a string ("very low", "low", etc.). As an user, I not necessarily know what are reasonable ranges for the measurements and having these strings makes it easy to know at a glance if I should take action or not.
This is true for VOC and CO2 as well, but the library (and HA) do not have string states for them, only the numeric values. So this PR adds two new sensors (for devices that support it), which are string states for VOC and CO2. The ranges were obtained directly from the Airthings website (CO2, VOC). I copied them almost verbatim, except for the CO2 ranges 0-249 and 5000-39999, which are missing from the Airthings website (I just extrapolate to names that seemed reasonable). I want to make clear that this PR is not my personal endorsement for these ranges, I know nothing about what constitutes good and bad VOC and CO2 levels.
Also, I did not test the part that goes through
_get_service_characteristics(), as the pytests do not go through that function, I just followed what is done for the radon levels. If the maintainers can easily check that this is correct, that would be great.If this gets approved and merged, then I will work in the HA part to expose these them as new entities.