Zum Inhalt springen

BME680 Environmental Sensor

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

WiFi Fan Controller with an Adafruit BME680 environmental sensor connected over Qwiic / STEMMA QT

The BME680 adds temperature, humidity, pressure, and a gas resistance reading over the solderless Qwiic connector. This example uses the Adafruit BME680 breakout (I2C address 0x77 by default, 0x76 with a solder jumper, Qwiic connector on board). Its 0x77 address does not clash with the onboard HDC1080 at 0x40.

This page covers the open ESPHome bme680 driver. It gives you the four raw measurements and runs on any framework. If you also want the Bosch air-quality outputs (IAQ, CO2 equivalent, VOC), see BME680 with BSEC2 instead. The two modules are mutually exclusive, so never import both.

The controller already has an onboard HDC1080. It measures the air right at the board. The BME680 hangs on the Qwiic cable and measures wherever you put it: the intake, the exhaust, or the room. That is the point of adding it.

So the module takes a role name, not a sensor name. Set bme680_name: "Intake" and the entities become “Intake Temperature”, “Intake Humidity”, and so on. You will end up with two temperature entities in Home Assistant, one from each sensor. That is expected, not a fault.

Plug the sensor into the Qwiic connector, then include the module as a package and give it a role name:

packages:
hardware: ... # your hardware-rev-*.yaml
bme680:
url: https://github.com/zeroflow/wifi-fancontroller
ref: main
files:
- path: modules/bme680.yaml
vars:
bme680_name: "Intake"

Leave vars: out and everything is simply named “BME680 …”. Nothing else is required.

The module exposes four entities:

EntityUnitNotes
Temperature°CRuns the gas heater, so it reads 1 to 2 °C high. Correct it with temperature_offset (see below).
Humidity%Relative humidity.
PressurehPaBarometric pressure.
Gas ResistanceΩRaw sensor resistance. Higher means cleaner air. Use it as a trend only, it is not an absolute air-quality value.

Set these under the package’s files: entry with vars: (see the full example below), or as top-level substitutions: in your config.

VariableDefaultPurpose
bme680_nameBME680Role name and entity prefix, for example Intake or Exhaust
bme680_idbme680Component id prefix. Only a-z 0-9 _. Change it only if you run two instances
bme680_address0x77I2C address. Set 0x76 if you moved the solder jumper
bme680_interval60sHow often the sensor is read

These are the component ids the module defines. They are the surface you can reach with !extend and !remove from your own config. The prefix follows bme680_id.

IDTypeNotes
bme680_sensorsensor (bme680)The sensor block itself
bme680_temperaturesensorTemperature reading
bme680_humiditysensorHumidity reading
bme680_pressuresensorPressure reading
bme680_gas_resistancesensorRaw gas resistance

The heater raises the temperature reading by 1 to 2 °C. To subtract that offset, extend the sensor block in your own config:

sensor:
- id: !extend bme680_sensor
temperature:
filters:
- offset: -1.5

You can put a second sensor on the same bus, for example one at the intake and one at the exhaust. Include the module twice and give each instance its own bme680_id, bme680_name, and bme680_address. The bme680_id prefix is what keeps the two apart: it renames every component id, so nothing collides. ESPHome scopes vars: per include, so this works with the normal remote package syntax:

packages:
hardware: ... # your hardware-rev-*.yaml
bme680_intake:
url: https://github.com/zeroflow/wifi-fancontroller
ref: main
files:
- path: modules/bme680.yaml
vars:
bme680_name: "Intake"
bme680_id: "intake"
bme680_address: "0x77"
bme680_exhaust:
url: https://github.com/zeroflow/wifi-fancontroller
ref: main
files:
- path: modules/bme680.yaml
vars:
bme680_name: "Exhaust"
bme680_id: "exhaust"
bme680_address: "0x76"

The second sensor must have its solder jumper set to 0x76, otherwise both sit at 0x77 and the bus hangs. Give each a distinct bme680_id too, otherwise their component ids clash.

  • Requires the hardware package (it provides the shared I2C bus bus_a). This module is not standalone.
  • I2C address: 0x77 by default, 0x76 with the solder jumper. Neither collides with the onboard HDC1080 at 0x40.
  • Bus speed: this module does not change the shared bus speed. The BME680 works fine at the default. If you combine several modules, mind the shared clock speed and the added pull-up load. See Combining Expansion Modules.

A complete, compilable config: the hardware package and one BME680 named “Intake”.

substitutions:
wifi_ssid: "YourNetwork"
wifi_password: "YourPassword"
packages:
hardware:
url: https://github.com/zeroflow/wifi-fancontroller
ref: main
files: [hardware-rev-3.1.yaml]
bme680:
url: https://github.com/zeroflow/wifi-fancontroller
ref: main
files:
- path: modules/bme680.yaml
vars:
bme680_name: "Intake"
bme680_interval: "60s"
esphome:
name: my-fancontroller
friendly_name: My Fan Controller
esp32:
board: esp32-s2-saola-1
framework:
type: arduino
logger:
api:
ota:
- platform: esphome
wifi:
ssid: ${wifi_ssid}
password: ${wifi_password}
ap:
ssid: "Fancontroller Fallback"
captive_portal:
SymptomLikely cause
Sensor missing from the I2C scan logCable not seated, or the jumper is on 0x76 while bme680_address still says 0x77
Bus hangs with two sensorsBoth sensors are at 0x77. Move the second to 0x76
Temperature reads 1 to 2 °C highSelf-heating from the gas heater. Correct it with a temperature_offset filter
Compile error mentioning BSECYou are on the BSEC2 module, not this one, and the config runs on esp-idf. See BME680 with BSEC2