BME680 temp/humid/pressure/gas mqtt-attached sensor

Got BME680, attached to Tasmota. HASS noticed all 4 sensors via MQTT and shows them nicely except the gas sensor which readings come in kOhm and apparently there is some Bosch library to translate those to air quality index. And there is even support for this sensor in HASS but only if it is attached directly to gpio on a machine where HASS runs.

Is there an easy way to reuse those calculations for remote sensor?

It is fully supported using ESPHome instead of Tasmota. Use both at my house but there are times when ESPHome is a lot more convenient.

Edit - sorry that’s the dev version which I am running. Link for the current version:

Well, I flashed esphome to find that it does not “fully support” BME680 either - it reports the gas sensor resistance, just like tasmota.

Hmm, you’re right. And reading from the Bosch website they have their own (pre-compiled) software to calculate the value. It must be complex, from their forums:

Due to the complex nature of the IAQ algorithm, it requires a significant amount of RAM and ROM, and uses floating point calculation. 8-bit and 16-bit platforms are not recommended.

Actually - looks like someone has done it before using lambda under ESPHome. From what I gather this does an estimate of IAQ based on current readings, Bosch uses previous readings to calculate the value:

This is better :slight_smile: Thanks for the pointer. Now I wonder if the same can be done in HA itself - it is the same yaml after all.

In HA you will need to define a template sensor that takes the raw value and applies a value_template to it.

I’m not sure if the math capability of value_templates is equivalent to ESPHome lambda…