-
Notifications
You must be signed in to change notification settings - Fork 4.8k
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
BME680 calculation of air quality percentage #5024
Comments
On which document (source?) is this calculation based? |
Should be possible to add a calibration command but I do not yet have this sensor so cannot yet experiment with it. Not sure if @arendst or @ascillato has one. |
Hello, the air-quality in percent is only possible with the propietary Bosch Library. Greetings, |
What about the above formula/calculations? Do you deem them worth implementing? |
The calculations are super easy. Adding the label enhancement to add this. Thanks for sharing 👍 |
Hello, the calculations are indeed super simple. Too simple? Also I don't like that the humidity is included in the AirQuality value. What humidity is the best humidity? Greetings, |
If you have a ready to use formula to implement this, please share it. |
Hello, unfortunately, I don't. Greetings, |
Ok. No problem, we will add the formula proposed by @andreas-bulling |
Actually two formulas to choose from potentially... |
@ascillato2 @Jason2866 @andrethomas Point2. Please read the document for software design which can you get from the chip designer. Point 3. I was busy with some test, but in the last 2 month there is so many work with different sensors about changings in libs or chip dsign. Yes chip design because some version are retired. So i got a lot of software desgin docs in PDF after i asked nicely and gave my company name for it. Nothing with esp but in the PLC world very well known. These special software designer docs are mostly not public. There are some but only with half of the information. Point 4. After the first read of code i would change things but all the work has to be done. When the TSl2561 issue is done, the issue with 30% messaure difference between the TSL and the BH1750 must be done. Then norrmally the VEML6075 UVa and UVb, but i could first look into the BME680. about the first comment:
|
@henfri |
Reimplementing the BOSCH algorithm would be even nicer, of course, but I think at the moment any calculation would be better than none. It would at least allow for relative comparison of values over time. And I am not into that business but I wonder if there is a single, widely agreed on definition of air quality anyway. That is, there might not be a right or wrong in terms of how an air quality metric is calculated. |
@andreas-bulling |
@mike2nl Thanks a lot - will be great to see this implemented (Dutch calculation is fine, I honestly think few people will care where the formula comes from). I might be wrong but from skimming the code in the two links at the top they might also use the 100% calculation. |
@andreas-bulling
Greetings, |
I dont want to see a bling bling value which has nothing to do with reality |
I agree if the formula is not derived from manufacturer data then there is no point in implementing it... it will just be another random number generator like the SHT11 sensors. This is a non-starter for me because even if you could derive a valid "air quality" value from what the data provided by the BME680 sensors the question is what does 48% air quality mean from one person to another, or from one organism to another - If you thought it would mean different things then you are right - so the conclusion is that it would depend on use case. Temperature and humidity for me is only about comfort level. Co2 measurement I view from a health perspective insofar that the scientific standard is well defined for various use cases My definition is limited to the qualia of a room based on what I can measure at the moment but to try and derive a percentage from this would be irrelevant.
But the above is not the only way to decide how you would represent it as a % so the best that can be done is to try and define it as qualia (quality of human experience) which will differ from person to person with specific reference to temperature and humidity. If air quality can be defined as a fixed desired outcome things would be different. |
After all this discussion It is shown that this value will be just a gross interpretation. So, I think would be better that anyone that wants that, make the calculation he/she thinks fits better for their use case in their home automation software and let Tasmota just send the actual readings of the sensor. Adding the label hold over for future reference. Thanks everyone for sharing theirs ideas. Very interesting discussion. |
My approach:
But, I am not very happy with this sensor. For 15 minutes after start, it is useless (you have to ignore measured resistance). But you have to measure. And resistance is affected by number and speed of measurements... grrrr. Crap bosh sensor with bad docs and closed source. |
@523p Thanks for the information - this is valuable. I just got this sensor and I am now wondering if you have any suggestion for a better one that addresses the limitations you mentioned? |
The MICS-4514 looks interesting, but I am not sure what to make of the information in its datasheet yet. You would still have to add temperature, humidity and Co2 sensors to the mix to make it useful I guess, but interesting nevertheless. |
@andrethomas @Jason2866 @henfri @andreas-bulling @ascillato2
I picked it all up again because all postings here, include mine, missing important things. First the ambient tempoerature is set to 25 deg.C. That's not the best way to do so because the ambient goes into calculation. So but there are a lot of registers with many information i found to handle that. Next is the calulation of the IAQ. The humidty is needed because some gasses lay down on the thin film which is used to messaure the gas resistior (BOSCH application documentation). So therefore are registers too which give us some more information from the factory calibration. Done a lot of research again for all that. The gas resistor value is depending on heating the gas sensor, the time of heating and current values from temperature, ambient, humi and some regsiters. The heating process push up the temperture messaured values. Around 0.7 deg.C. The humidity too, around up to 2%. Tested the heating time down to 40ms in a range of 30..150ms in steps of 10ms. How shorter the heating time is how better the values for temp and humi. But the gas resistor values goes down too. Default it is a max of 500K (500.000 ohm). All in the BOSCH BME680 has moved values around ~7% at all but that can be compensated. Next is the value for sea-level. No one has seen that or read the driver code we have? Yesterday i talked about all that to @Jason2866 and showed him some of my findings. And he is righjt better do nothing then bling bling things. I'm on it but it needs time to solve certain things. And i have to write code away from tasmota first....to test things to get it 100% clear. So there are some points where i working on right now. The sensor works correct only with the BOSCH library but it is possible to get some of the functions out of the original. E.g. the IAQ calculation. It looks easy yes, but it really complex. Ask the books of physics and chemical things so i have done the last few weeks. BOSCH's libray is working based on these things i had read to understand it really, really good. |
@mike2nl as this could easily be fixed I scanned the library as currently used by Tasmota but failed to find any relation to sea-level, offset or 500. Can you provide more info where you found the 500 meter pressure offset information? |
@arendst Is there any issue adding this proprietary Bosch Library? Looks like it's available for ESP8266. I know it has a different license model, so it might be possible to add this as additional option for custom build so user will be responsible for license impact.
|
@illusdolphin the bme680 driver does use the Bosch library |
Maybe I'm wrong, but here https://www.bosch-sensortec.com/software-tools/software/bsec/ we can download this magic software BSEC ( https://www.bosch-sensortec.com/media/boschsensortec/downloads/bsec/bsec_1-4-7-4_generic_release.zip is a direct link, this software is mentioned inside datasheet). Inside zip:
|
Also found #2969 with issues and memo about linker https://github.com/BoschSensortec/BSEC-Arduino-library#esp8266---modify-the-linker-script-header . Solution will take min 17k of ROM + 1Kb of RAM that is acceptable for custom build (like define #bme680_bosch_bsec ). |
To many changes in build chain. This will make a lot of troubles. |
Me and @mcspr have been working together during the last month to add support for BME680 using BSEC on espurna. The experience is completely seamless, requiring zero modifications on the user side - it just works. I am an early Tasmota user as well and use it in many of my ESP8266 projects (and getting even more excited about the Zigbee bridge support for Sonoff) so sometime in the future I'd like to bring the same level of support here, time permitting. I hope it serves as inspiration in case others want to jumpstart that work. Our approach to licensing was:
This is truly a fantastic sensor which deserved a special attention to detail. |
Great Work. Thanks for it! |
Since most Tasmota users are using pre built binaries (a great benefit from Tasmota) |
My first reaction would be if Bosch wants to sell these sensors AND have users using it then they shouldn't use such a restricting license. As said before many users use pre-compiled binaries and I won't add any interface to satisfy any license. In short, they have the wrong license for Tasmota. Pity Bosch. |
Maybe it would be a option to add support for the GY-MCU680V1 Board, which contains the BME680 and an onboard processor doing the Bosch BSEC stuff. It outputs IAQ and other values via serial interface. Check this project for an example on how to use it: |
@derFrickler not directly related to the issue which is closed anyway. |
I know this is closed, just for reference for others who find this thread. Here is a PDF from a UK indoor air quality group which appears to provide basic guidance with information on which standards the guidance came from. https://www.betterindoors.com/wp-content/uploads/2019/09/IAQ_Rating_Index.pdf |
Hi,
would it be possible to directly integrate the calculation of air quality into Tasmota so that it can be published over MQTT?
It seems the HA bme680 sensor platform supports basic air quality calculation using gas resistance and humidity measurements to calculate a percentage based air quality measurement:
https://www.home-assistant.io/components/sensor.bme680/
But it seems it requires a sensor directly connected through I2C.
A similar calculation I found here:
https://github.com/robmarkcole/bme680-mqtt/blob/master/bme680-air-quality-RC.py
The text was updated successfully, but these errors were encountered: