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

Airthings #54

Merged
merged 19 commits into from Nov 13, 2022
Merged

Airthings #54

merged 19 commits into from Nov 13, 2022

Conversation

mboisson
Copy link
Contributor

@mboisson mboisson commented Nov 4, 2022

This PR adds support for Airthings Radon, Volatile Organic Compounds and Carbon Dioxide sensors as exported from HomeAssistant as supported by the newly released version:
https://www.home-assistant.io/integrations/airthings_ble

@ymerj ymerj requested a review from tomwpublic November 8, 2022 12:35
@tomwpublic
Copy link
Collaborator

@mboisson -- There is a built-in Generic Component Carbon Dioxide Detector. Can you try using that?

It does look like the VOC and Radon sensors will need to be custom. The Radon one seems very specific (short term average reading?). Is there any way to generalize that at all, in case other sensors show up that may want to utilize it? I am not familiar with the typical behaviors or measurements related to radon sensing.

@mboisson
Copy link
Contributor Author

mboisson commented Nov 8, 2022

I'll have a look at the built-in CO2 sensor.

As for Radon, as far as I know, Radon readings are never instantaneous (or if they are, they are unreliable), it varies too much and is always averaged. Typical (approved by health authorities) radon testing is done over at least 3 months and sent to a lab for analysis. The AirThings device reports both short term (1 day average) and long term average (duration undocumented), but no instantaneous reading.

@mboisson

This comment was marked as outdated.

@mboisson
Copy link
Contributor Author

mboisson commented Nov 8, 2022

Nevermind, as I wrote this answer, I figured it out.

Switched to use built-in Generic Carbon Dioxide Detector driver
No need for this sensor anymore with c3782fd
@mboisson
Copy link
Contributor Author

mboisson commented Nov 8, 2022

I have an idea to make the Radon sensor more generic

@mboisson
Copy link
Contributor Author

mboisson commented Nov 8, 2022

Oh, shoot. The Generic Carbon Dioxide Detector does not work for automation. The "carbonDioxide" attribute does not seem to support numbers. According to the Rule 5.1 engine, "carbonDioxide" attribute takes values "detected", "tested" or "clear", so that won't work. I guess that's why it is a "Detector" and not a "Sensor".

I will revert my two previous commits.

Capture d’écran, le 2022-11-08 à 14 30 05
.

…enericComponentRadonSensor.groovy

Making the radon sensor more generic
Using the more generic radon sensor component from 159e2f1
@mboisson
Copy link
Contributor Author

mboisson commented Nov 8, 2022

Ok, I made the radon sensor more generic. There is no need to be as specific in the name of the attribute or the name of the sensor. The fact that it is a 1 day average or a long term average is carried through in the label of the sensor exported by HA and is in practice device specific

@ymerj ymerj merged commit 47854a3 into ymerj:main Nov 13, 2022
@mboisson mboisson deleted the airthings branch November 14, 2022 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants