D1 mini with two different temp sensors

I have a D1 mini that is working with a bme20 sensor and I’m hoping to add a DS18B20 as well. So I can see the air temp and my pool temp and use one board.

The code I’m using for the BME20 is

 captive_portal:

i2c:
  sda: GPIO4
  scl: GPIO5
  scan: true
  
sensor:
  - platform: bme280
    temperature:
      name: "BME280 Temperature"
      id: bme280_temperature
    pressure:
      name: "BME280 Pressure"
      id: bme280_pressure
    humidity:
      name: "BME280 Humidity"
      id: bme280_humidity
    address: 0x77
    update_interval: 60s

I’m not sure how to correctly code in the DS18B20 and if that’s possible.

captive_portal:

i2c:
  sda: GPIO4
  scl: GPIO5
  scan: true

dallas:
  - pin: GPIO14 # or 12 or 13

sensor:

  - platform: dallas
    address: 0x1c0000031edd2a28 # change this
    name: "Air Temperature"
    unit_of_measurement: "°C"
    device_class: "temperature"
    state_class: "measurement"

  - platform: bme280
    temperature:
      name: "BME280 Temperature"
      id: bme280_temperature
    pressure:
      name: "BME280 Pressure"
      id: bme280_pressure
    humidity:
      name: "BME280 Humidity"
      id: bme280_humidity
    address: 0x77
    update_interval: 60s

How to find the sensor address: Dallas Temperature Sensor — ESPHome

1 Like

Thank you. I’ll give that a try.

That worked perfectly thanks again.