You thought about it, do IT !

ESPHome MultiSensor – Temperature and air pressure

ESPHome MultiSensor – Temperature and air pressure
project progress
30%

This time we will use a BMP280 for temperature and air pressure.

As usual, connect SDA / SCL / VCC and ground to the adequate pins of your D1 mini

Next program firmware in Home Assistant, using ESPHome. You need the following lines :

sensor:
  - platform: bmp280
    temperature:
      name: "BMP280 Temperature"
      id: bmp280_temperature
    pressure:
      name: "BMP280 Pressure"
      id: bmp280_pressure
    address: 0x76
    update_interval: 15s
  
  - platform: template
    name: "BMP280 Altitude"
    lambda: |-
      const float STANDARD_SEA_LEVEL_PRESSURE = 1013.25; //in hPa, see note
      return ((id(bmp280_temperature).state + 273.15) / 0.0065) *
        (powf((STANDARD_SEA_LEVEL_PRESSURE / id(bmp280_pressure).state), 0.190234) - 1); // in meter
    update_interval: 15s
    icon: 'mdi:signal'
    unit_of_measurement: 'm'
 

That’s all, you’re ready to use this values on your automations.

do-it.dev Avatar
if you liked it, please contribute !

Leave a Reply

Your email address will not be published. Required fields are marked *

Aurélien Bordinat

I am a french computer engineer, adept of DIY, home automation and new technologies. When i’m not busy trail running, i spend some time prototyping.