I have an ESP32 with both a SGP40 and a SCD40 hooked up to it via I2C. The SCD40 reports CO2, temperature, and humidity, and the SGP40 reports VOC and can optionally take in temperature and humidity to compensate those readings.
The docs give this example config, but I don’t know how to define the SCD40 as a source.
# Example configuration entry
sensor:
- platform: sgp4x
voc:
name: "VOC Index"
nox:
name: "NOx Index"
compensation:
humidity_source: dht1_hum
temperature_source: dht1_temp
Here’s an abridged version of my config:
esphome:
name: air
platform: ESP32
board: esp32doit-devkit-v1
i2c:
sda: 21
scl: 22
scan: True
sensor:
- platform: sgp4x
voc:
name: "VOC Index"
nox:
name: "NOx Index"
- platform: scd4x
co2:
name: "Dining Room CO2"
temperature:
name: "Dining Room Temperature"
humidity:
name: "Dining Room Humidity"