AHT20 + BMP280 combined sensor

Hello,

Just a heads up, as I haven’t seen this mentioned before. On Aliexpress, there is a combined AHT20 + BMP280 sensor available.

Seems to be working, for now with basic settings with ESPHome.

Here are the readouts I could get out of these in HA:

aht20

Nice. What “platform” did you use for the AHT20 in your yaml? Mind just sharing this portion of your yaml?

Just following up: I have since received my AHT20 in the mail and hooked it up. aht10 for “-platform:” in ESPHome seems to work fine for the AHT20. My AHT20 is a stand alone one from adafruit. Works great!

Yes, that is correct, I was also using aht10 as platform. It is not written, but looks like it is working with the aht20 sensor as well. Here is the yaml what I was using:

  - platform: aht10
    update_interval: 60s
    temperature:
      name: "AHT20 temp. (test)"
      id: test_aht10_temp
      accuracy_decimals: 1
      filters:
      - filter_out: 0.0
      - median:
          window_size: 3
          send_every: 3
          send_first_at: 1
    humidity:
      name: "AHT20 humidity (test)"
      id: test_aht10_humidity
      accuracy_decimals: 1
      filters:
      - filter_out: 0.0
      - median:
          window_size: 3
          send_every: 3
          send_first_at: 1

Hi,

i got my sensors today, Temp and Humidity are working perfect with the yaml from eisengrau, but cant get the BMP280 working

here is my yaml:

  • platform: bmp280
    pressure:
    name: “Test Pressure”
    address: 0x38
    update_interval: 60s

an here the log ouput:
[22:40:42][C][bmp280.sensor:098]: BMP280:
[22:40:42][C][bmp280.sensor:099]: Address: 0x38
[22:40:42][E][bmp280.sensor:105]: BMP280 has wrong chip ID! Is it a BME280?
[22:40:42][C][bmp280.sensor:111]: IIR Filter: OFF
[22:40:42][C][bmp280.sensor:112]: Update Interval: 60.0s
[22:40:42][C][bmp280.sensor:115]: Oversampling: 16x
[22:40:42][C][bmp280.sensor:116]: Pressure ‘Test Pressure’
[22:40:42][C][bmp280.sensor:116]: Device Class: ‘pressure’
[22:40:42][C][bmp280.sensor:116]: State Class: ‘measurement’
[22:40:42][C][bmp280.sensor:116]: Unit of Measurement: ‘hPa’
[22:40:42][C][bmp280.sensor:116]: Accuracy Decimals: 1
[22:40:42][C][bmp280.sensor:117]: Oversampling: 16x

What i am doing wrong?

i2c adress is correct

Did you (or anybody else) get the BMP280 working? I also bought this board and I’m having the same problem. I created another community.home-assistant post about this issue, but do the forum rules prevent me from posting a link to it here?

Hi,
Your chip is a BME not a BMP :
[22:40:42][E][bmp280.sensor:105]: BMP280 has wrong chip ID! Is it a BME280?

This code is fully functional (D1 mini board) :

# SDA=GPIO4=D2 SCL=GPIO5=D1 sur D1mini 
i2c:
  sda: 4
  scl: 5
  scan: true
  id: bus_a

sensor:
  - platform: bmp280
    address: 0x77
    update_interval: 60s
    temperature:
      name: "BMP temp"
      oversampling: 2x
    pressure:
      name: "BMP Pressure"

  - platform: aht10
    address: 0x38
    update_interval: 60s
    temperature:
      name: "AHT20 temp"
      id: aht20_temp
      accuracy_decimals: 1
      filters:
      - filter_out: 0.0
      - median:
          window_size: 3
          send_every: 3
          send_first_at: 1
    humidity:
      name: "AHT20 humidity"
      id: aht20_humidity
      accuracy_decimals: 1
      filters:
      - filter_out: 0.0
      - median:
          window_size: 3
          send_every: 3
          send_first_at: 1

Many thanks to the previous contributors !

4 Likes

Thank you for sharing your code. I have an interesting behaviour where the AHT is only reporting values every third measurement and reporting that it takes too long. is this intended ?

[15:09:23][W][component:214]: Component aht10.sensor took a long time for an operation (0.07 s).
[15:09:23][W][component:215]: Components should block for at most 20-30ms.
[15:10:05][D][bmp280.sensor:175]: Got temperature=25.2°C pressure=935.4hPa
[15:10:05][D][sensor:093]: 'BMP temp': Sending state 25.19000 °C with 1 decimals of accuracy
[15:10:05][D][sensor:093]: 'BMP Pressure': Sending state 935.41656 hPa with 1 decimals of accuracy
[15:10:23][D][aht10:084]: AHT10 is busy, waiting...
[15:10:23][D][sensor:093]: 'AHT20 temp': Sending state 24.44916 °C with 1 decimals of accuracy
[15:10:23][D][sensor:093]: 'AHT20 humidity': Sending state 49.01505 % with 1 decimals of accuracy
[15:10:23][W][component:214]: Component aht10.sensor took a long time for an operation (0.08 s).
[15:10:23][W][component:215]: Components should block for at most 20-30ms.
[15:11:05][D][bmp280.sensor:175]: Got temperature=25.2°C pressure=935.4hPa
[15:11:05][D][sensor:093]: 'BMP temp': Sending state 25.18000 °C with 1 decimals of accuracy
[15:11:05][D][sensor:093]: 'BMP Pressure': Sending state 935.42114 hPa with 1 decimals of accuracy
[15:11:23][D][aht10:084]: AHT10 is busy, waiting...
[15:11:23][W][component:214]: Component aht10.sensor took a long time for an operation (0.07 s).
[15:11:23][W][component:215]: Components should block for at most 20-30ms.

May it help someone. I could not find the readings of my AHT20 sensor. It was not available in the logs. I had to add a line with “variant”!
I found it here: https://community.home-assistant.io/t/communication-with-aht10-failed/399150/22

  - platform: aht10
    variant: aht20
    update_interval: 30s
    address: 0x38
    temperature:
      name: "Schuppentemperatur_A"
      id: aht20_temperatur
      accuracy_decimals: 1
      filters:
      - filter_out: 0.0
      - median:
          window_size: 3
          send_every: 3
          send_first_at: 1
    humidity:
      name: "Schuppenfeuchtigkeit"
      id: aht20_feuchte
      accuracy_decimals: 1
      filters:
      - filter_out: 0.0
      - median:
          window_size: 3
          send_every: 3
          send_first_at: 1