Problem with AHT21 sensor

Hi, I need help with the AHT21 sensor on my ESP32 please. after plugging in, its status becomes unknown. If you replace it on the same cables with an AHT10, it works. this is my yaml:

i2c:
   - id: bus_a
     sda: GPIO22
     scl: GPIO19
     scan: true
   - id: bus_b
     sda: GPIO18
     scl: GPIO23
     scan: true

sensor:
  - platform: aht10
    i2c_id: bus_a
    temperature:
      name: "Kupelna teplota vana"
    humidity:
      name: "Kupelna vlhkost vana"
    update_interval: 1s

simply AHT10 works AHT21 does not. On Esphome.io it is stated that aAHTľ ľ should work:

The aht10 Temperature+Humidity sensor allows you to use your AHT10, AHT20, AHT21.

(post deleted by author)

Can you share your esp32 model and the debug log? It will help recognize the possible bug

Привет, нужно установить значение variant: AHT20 для датчиков 2х

Example configuration entry

sensor:

  • platform: aht10
    variant: AHT20
    temperature:
    name: “Living Room Temperature”
    humidity:
    name: “Living Room Humidity”
    update_interval: 60s
1 Like

hi noidkn,

You are right. It works!
Thank you.

Worked for me also