SGP40 Volatile Organic Compound Sensor

The sgp40 sensor platform allows you to use your Sensirion SGP40 VOC sensor (datasheet) with ESPHome. The I²C Bus is required to be set up in your configuration for this sensor to work.

Note

This sensor need to be driven at a rate of 1Hz. Because of this, the sensor will be read out on device once a second separately from the update_interval. The state will be reported to other components, or the front end at the update_interval, saving wifi power and network communication.

../../_images/sgp40.jpg
# Example configuration entry
sensor:
  - platform: sgp40
    name: "Workshop VOC"

Configuration variables:

  • name (Required, string): The name for the CO₂eq sensor.

  • id (Optional, ID): Set the ID of this sensor for use in lambdas.

  • update_interval (Optional, Time): The interval to check the sensor. Defaults to 60s

  • store_baseline (Optional, boolean ): Stores and retrieves the baseline information for quicker startups. Defaults to true

  • compensation (Optional): The block containing sensors used for compensation. If not set defaults will be used.

    • temperature_source (Optional, ID): Give an external temperature sensor ID here. This can improve the sensor’s internal calculations. Defaults to 25

    • humidity_source (Optional, ID): Give an external humidity sensor ID here. This can improve the sensor’s internal calculations. Defaults to 50

  • All other options from Sensor.

Example With Compensation

# Example configuration entry
sensor:
  - platform: sgp40
    name: "Workshop VOC"
    update_interval: 5s
    compensation:
      humidity_source: dht1_hum
      temperature_source: dht1_temp

See Also