I have the BME680 from Adafruit running, and have the IAQ calculatet this way:
sensor:
- platform: bme680
temperature:
name: "BME680 Temperature"
oversampling: 16x
pressure:
name: "BME680 Pressure"
humidity:
name: "BME680 Humidity"
id: hum
gas_resistance:
name: "BME680 Gas Resistance"
id: g_res
address: 0x77
update_interval: 60s
# comp_gas = log(R_gas[ohm]) + 0.04 log(Ohm)/%rh * hum[%rh]
- platform: template
name: "BME680 IAQ"
id: IAQ
unit_of_measurement: IAQ
lambda: 'return log(id(g_res).state) + 0.04 * id(hum).state;'
Just use the lambda to do this simpel calculation.
Edit: I run this on a ESP32