I tried defining the pins on config. Also without defining it uses some pins for default, which is what I used.
Well without any more info on your setup it’s tough to diagnose. I’ve been running BMEs on many different devices and have always defined the pins. I recommend making sure you got the format correct. ESPHOME and the different services are a bit wonky sometimes with how it wants the definition. I’ve seen GPIO4 and 4, depending on the service. i2C just wants sda: 4
Did you manage to make it work @ricreis394? I have the exact same issue (Wemos D1 mini Pro with BMP and SHT3x sensor) via I2C. When running Tasmota and ESPEasy everything worked fine.
I didn’t manage to make it work. And I quit the idea also, maybe later some day will try again
Hi
I have also a bme280 sensor on a Wemos D1 mini that does not work when I am using ESPHome.
The sensor work fine if I write my code in arduino IDE to the Wemos D1 mini.
Here is my config and startup log:
i2c:
sda: 4
scl: 5
scan: True
sensor:
- platform: bme280
temperature:
name: "BME280 Temperature"
oversampling: 16x
pressure:
name: "BME280 Pressure"
humidity:
name: "BME280 Humidity"
address: 0x76
update_interval: 60s
- platform: bh1750
name: "BH1750 Illuminance"
address: 0x23
update_interval: 60s
- platform: dht
pin: 2
temperature:
name: "Stue Temperature"
humidity:
name: "Stue Humidity"
model: DHT22
update_interval: 60s
Startup log show this:
[21:20:31][C][i2c:028]: I2C Bus:
[21:20:31][C][i2c:029]: SDA Pin: GPIO4
[21:20:31][C][i2c:030]: SCL Pin: GPIO5
[21:20:31][C][i2c:031]: Frequency: 50000 Hz
[21:20:31][I][i2c:033]: Scanning i2c bus for active devices…
[21:20:31][I][i2c:040]: Found i2c device at address 0x23
[21:20:31][I][i2c:040]: Found i2c device at address 0x76
[21:20:31][C][logger:137]: Logger:
[21:20:31][C][logger:138]: Level: DEBUG
[21:20:31][C][logger:139]: Log Baud Rate: 115200
[21:20:31][C][logger:140]: Hardware UART: UART0
[21:20:31][C][bme280.sensor:142]: BME280:
[21:20:31][C][bme280.sensor:143]: Address: 0x76
[21:20:31][E][bme280.sensor:149]: BMP280 has wrong chip ID! Is it a BMP280?
[21:20:31][C][bme280.sensor:155]: IIR Filter: OFF
[21:20:31][C][bme280.sensor:156]: Update Interval: 60.0s
[21:20:31][C][bme280.sensor:158]: Temperature ‘BME280 Temperature’
[21:20:31][C][bme280.sensor:158]: Unit of Measurement: ‘°C’
[21:20:31][C][bme280.sensor:158]: Accuracy Decimals: 1
[21:20:31][C][bme280.sensor:158]: Icon: ‘mdi:thermometer’
[21:20:31][C][bme280.sensor:159]: Oversampling: 16x
[21:20:31][C][bme280.sensor:160]: Pressure ‘BME280 Pressure’
[21:20:31][C][bme280.sensor:160]: Unit of Measurement: ‘hPa’
[21:20:31][C][bme280.sensor:160]: Accuracy Decimals: 1
[21:20:31][C][bme280.sensor:160]: Icon: ‘mdi:gauge’
[21:20:31][C][bme280.sensor:161]: Oversampling: 16x
[21:20:31][C][bme280.sensor:162]: Humidity ‘BME280 Humidity’
[21:20:31](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[21:20:31][C][bme280.sensor:162]: Icon: ‘mdi:water-percent’
[21:20:31][C][bme280.sensor:163]: Oversampling: 16x
I think there is some diferent version of the bme280, some works well and other does not work in ESPHome.
I hope ther can be an solution to this soon.
Hi
I found solution on my problem.
I did use BME280 config on a BMP280 sensor. After I removed the Humidity settings its worked as it should.
Here is my working config on a BMP280 sensor it was not en BME280
i2c:
sda: 4
scl: 5
scan: True
sensor:
- platform: bmp280
temperature:
name: "BMP280 Temperature"
oversampling: 16x
pressure:
name: "BMP280 Pressure"
address: 0x76
update_interval: 60s
I have a sonoff sv with bmp280, and I can’t get it working
# Node definition (Sonoff SV)
esphome:
name: sonoff_sv_hall
platform: ESP8266
board: esp01_1m
board_flash_mode: dout
# Wifi details
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Directly connects to WiFi network without doing a full scan first
fast_connect: True
manual_ip:
static_ip: 192.168.1.159
gateway: 192.168.1.1
subnet: 255.255.255.0
# Activate web server (may cause memory issues in ESP8266)
#web_server:
# port: 80
# Enable logging
logger:
# Enable Home Assistant API
api:
password: !secret api_password
ota:
password: !secret api_password
i2c:
sda: 4
scl: 5
scan: True
sensor:
- platform: bmp280
temperature:
name: "BMP280 Temperature"
oversampling: 16x
pressure:
name: "BMP280 Pressure"
address: 0x76
update_interval: 60s
Sonoff SV Pins - https://www.itead.cc/wiki/images/e/e4/Sonoff_SV_hardware.png
BME280 - https://pt.aliexpress.com/item/32659765502.html
Esphome Version: 1.13.6
Debug logs:
[16:13:29][C][switch.gpio:043]: Pin: GPIO12 (Mode: OUTPUT)
[16:13:29][C][switch.gpio:059]: Restore Mode: Restore (Defaults to OFF)
[16:13:29][C][template.switch:058]: Template Switch 'Building door (PulseTime)'
[16:13:29][C][template.switch:059]: Restore State: NO
[16:13:29][C][template.switch:060]: Optimistic: NO
[16:13:29][C][esp8266_pwm:022]: ESP8266 PWM:
[16:13:29][C][esp8266_pwm:023]: Pin: GPIO13 (Mode: OUTPUT, INVERTED)
[16:13:29][C][esp8266_pwm:024]: Frequency: 1000.0 Hz
[16:13:29][C][logger:137]: Logger:
[16:13:29][C][logger:138]: Level: DEBUG
[16:13:29][C][logger:139]: Log Baud Rate: 115200
[16:13:29][C][logger:140]: Hardware UART: UART0
[16:13:29][C][light:174]: Light 'led'
[16:13:29][C][light:176]: Default Transition Length: 1.0s
[16:13:29][C][light:177]: Gamma Correct: 2.80
[16:13:29][C][bme280.sensor:142]: BME280:
[16:13:29][C][bme280.sensor:143]: Address: 0x76
[16:13:29][E][bme280.sensor:146]: Communication with BME280 failed!
[16:13:29][C][bme280.sensor:155]: IIR Filter: OFF
[16:13:29][C][bme280.sensor:156]: Update Interval: 60.0s
[16:13:29][C][bme280.sensor:158]: Temperature 'Living Room Temperature'
[16:13:29][C][bme280.sensor:158]: Unit of Measurement: '°C'
[16:13:29][C][bme280.sensor:158]: Accuracy Decimals: 1
[16:13:29][C][bme280.sensor:158]: Icon: 'mdi:thermometer'
[16:13:29][C][bme280.sensor:159]: Oversampling: 1x
[16:13:29][C][bme280.sensor:160]: Pressure 'Living Room Pressure'
[16:13:29][C][bme280.sensor:160]: Unit of Measurement: 'hPa'
[16:13:29][C][bme280.sensor:160]: Accuracy Decimals: 1
[16:13:29][C][bme280.sensor:160]: Icon: 'mdi:gauge'
[16:13:29][C][bme280.sensor:161]: Oversampling: 1x
[16:13:29][C][bme280.sensor:162]: Humidity 'Living Room Humidity'
[16:13:29][C][bme280.sensor:162]: Unit of Measurement: '%'
[16:13:29][C][bme280.sensor:162]: Accuracy Decimals: 1
[16:13:29][C][bme280.sensor:162]: Icon: 'mdi:water-percent'
[16:13:29][C][bme280.sensor:163]: Oversampling: 1x
[16:13:29][C][ota:029]: Over-The-Air Updates:
[16:13:29][C][ota:030]: Address: 192.168.1.159:8266
[16:13:29][C][ota:032]: Using Password.
[16:13:29][C][api:103]: API Server:
[16:13:29][C][api:104]: Address: 192.168.1.159:6053
[16:13:29][C][wifi_signal.sensor:009]: WiFi Signal 'Living Room BME280 WiFi Signal'
[16:13:29][C][wifi_signal.sensor:009]: Unit of Measurement: 'dB'
[16:13:29][C][wifi_signal.sensor:009]: Accuracy Decimals: 0
[16:13:29][C][wifi_signal.sensor:009]: Icon: 'mdi:wifi'
Error: Communication with BME280 failed!
Should I, open an issue at esphome project, or can you give some help
Thanks
I am experiencing something similar with multiple BME280’s. Sometimes it works, after a reboot got the same ‘Communication with BME280 failed!’’ error. Pretty confusing.
If someone is struggling to connect the BME280 to wemos D1 mini via ESPHome, here is my config file which works:
esphome:
name: outdoor_sensor
platform: ESP8266
board: d1_mini
wifi:
ssid: "ssid_name"
password: "password"
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
i2c:
sda: 0
scl: 2
sensor:
- platform: bme280
temperature:
name: "temperature"
oversampling: 16x
pressure:
name: "pressure"
oversampling: 16x
humidity:
name: "humidity"
oversampling: 16x
address: 0x76
update_interval: 60s
The wemos I have i smiliar to this one. I bought if on aliexpress.
Hi, I have notice that under i2c you have use 0 and 2 instead of GPIO4 and GPIO5 , D1 D2.
Is this the change that is making the sensor work?
In my case, that’s the solution.
I have connected the BME280 to D3 and D4.
Here is more: https://github.com/arendst/Sonoff-Tasmota/wiki/Wemos-D1-Mini-and-BME280-Temperature,-Humidity-and-Pressure-Sensor
Thanks, will try this and report.
While you are helping, please also advise, how are you connecting Vcc of BME280 - is it to 3.3v or 5v?
I have connected it to 3.3v
Bme280 is different to bmp280, the BME one is often what you’ll pay for but they send you a bmp280.
Try using the bmp280 and bmp180/085 components.
@CountParadox Yes, I had already tried all the permutations combinations of bme, bmp variants. For me the sensor worked briefly as bme280 but never after that. So, I will try with the SDA SCL as D3 D4 instead of D0 D1. Maybe that works for me.
Tried today the BME280 and I’m having the same problem =/ Had the BMP280 and works fine… hope the solution is find, tried SDA and SCL on D3 and D4 and didn’t work…
For those who looking for solution: set oversampling: 1x for all values
I’ve finally managed to get it working. The key thing was GPIO nomenclature - as it is noted here:
“The NodeMCU’s pin numbering as seen on the board (the D0
etc pins) is different from the internal pin numbering.”
I’ve connected to “D1” & “D2”, but stated “1” and “2” in the config which are internal numbering scheme. As soon I’ve changed config to D1 & D2 the whole thing started to work. Also, the system recognized I’m not using BME280 but BMP280 and warned me about it. Still it worked. After I’ve changed the config to BMP280 and commented out the humidity, everything passed without warnings.
Here is the sensor part:
##############################################
# i2c
i2c:
sda: D1
scl: D2
scan: False
id: bus_a
##############################################
# Sensors
sensor:
- platform: bmp280
i2c_id: bus_a
temperature:
name: "BMP280 Temperature"
id: bmp280_temperature
oversampling: 16x
filters:
- offset: -1.6
pressure:
name: "BMP280 Pressure"
id: bmp280_pressure
oversampling: 16x
filters:
- offset: 14.3
address: 0x76
update_interval: 60s