variant: AHT20 # Specify the model as AHT20
Silly thing to miss - Thanks mataksik - took me 5 AHT20 BMP20 cards to discover they were all good
variant: AHT20 # Specify the model as AHT20
Silly thing to miss - Thanks mataksik - took me 5 AHT20 BMP20 cards to discover they were all good
this one solved my problem. thank you very much
also double checked and it is an aht10 but only works when you set variant to aht20
Thank you for this post. This was my problem also!
Kept getting the “Communication with AHT10 failed!” and “Component aht10.sensor is marked FAILED” error messages, but it showed an address of 0x38 which meant it was communicating. As per your post, changing to “variant: AHT20” did the trick.
It seems like i see a lot of people have issues with this sensor. Its much more common than posts with dht or dallas type IMO. Quick little google search might sway decisions and choose one with less problems. I guess its just easier to be a follower than a leader?
Hi !!!The problem is the same, the sensor itself sees , but it does not show temperature and humidity
i2c:
sda: GPIO2
scl: GPIO0
scan: true
id: bus_a
sensor:
-------------------------------------
Text
NFO ESPHome 2024.11.1
INFO Reading configuration /config/esphome/thermo.yaml…
INFO Starting log output from 192.168.1.72 using esphome API
INFO Successfully connected to thermohome @ 192.168.1.72 in 0.007s
INFO Successful handshake with thermohome @ 192.168.1.72 in 2.472s
[17:52:02][I][app:100]: ESPHome version 2024.11.1 compiled on Nov 25 2024, 17:20:08
[17:52:02][C][wifi:600]: WiFi:
[17:52:02][C][wifi:428]: Local MAC: 48:55:19:70:3C:1F
[17:52:02][C][wifi:433]: SSID: [redacted]
[17:52:02][C][wifi:436]: IP Address: 192.168.1.72
[17:52:02][C][wifi:439]: BSSID: [redacted]
[17:52:02][C][wifi:441]: Hostname: ‘thermohome’
[17:52:02][C][wifi:443]: Signal strength: -28 dB ▂▄▆█
[17:52:02][C][wifi:447]: Channel: 3
[17:52:02][C][wifi:448]: Subnet: 255.255.255.0
[17:52:02][C][wifi:449]: Gateway: 192.168.1.1
[17:52:02][C][wifi:450]: DNS1: 0.0.0.0
[17:52:02][C][wifi:451]: DNS2: 0.0.0.0
[17:52:02][C][logger:185]: Logger:
[17:52:02][C][logger:186]: Level: DEBUG
[17:52:02][C][logger:188]: Log Baud Rate: 115200
[17:52:02][C][logger:189]: Hardware UART: UART0
[17:52:02][C][i2c.arduino:071]: I2C Bus:
[17:52:02][C][i2c.arduino:072]: SDA Pin: GPIO2
[17:52:02][C][i2c.arduino:073]: SCL Pin: GPIO0
[17:52:02][C][i2c.arduino:074]: Frequency: 50000 Hz
[17:52:02][C][i2c.arduino:086]: Recovery: bus successfully recovered
[17:52:02][I][i2c.arduino:096]: Results from i2c bus scan:
[17:52:02][I][i2c.arduino:098]: Found no i2c devices!
[17:52:02][C][aht10:162]: AHT10:
[17:52:02][C][aht10:163]: Address: 0x38
[17:52:02][E][aht10:165]: Communication with AHT10 failed!
[17:52:02][C][aht10:167]: Temperature ‘AHT10 Temperature’
[17:52:02][C][aht10:167]: Device Class: ‘temperature’
[17:52:02][C][aht10:167]: State Class: ‘measurement’
[17:52:02][C][aht10:167]: Unit of Measurement: ‘°C’
[17:52:02][C][aht10:167]: Accuracy Decimals: 2
[17:52:02][C][aht10:168]: Humidity ‘AHT10 Humidity’
[17:52:02][C][aht10:168]: Device Class: ‘humidity’
[17:52:02][C][aht10:168]: State Class: ‘measurement’
[17:52:02][C][aht10:168]: Unit of Measurement: ‘%’
[17:52:02][C][aht10:168]: Accuracy Decimals: 2
[17:52:02][E][component:082]: Component aht10.sensor is marked FAILED
[17:52:02][C][captive_portal:089]: Captive Portal:
[17:52:02][C][mdns:116]: mDNS:
[17:52:02][C][mdns:117]: Hostname: thermohome
[17:52:02][C][esphome.ota:073]: Over-The-Air updates:
[17:52:02][C][esphome.ota:074]: Address: 192.168.1.72:8266
[17:52:02][C][esphome.ota:075]: Version: 2
[17:52:02][C][esphome.ota:078]: Password configured
[17:52:02][C][safe_mode:018]: Safe Mode:
[17:52:02][C][safe_mode:019]: Boot considered successful after 60 seconds
[17:52:02][C][safe_mode:021]: Invoke after 10 boot attempts
[17:52:02][C][safe_mode:022]: Remain in safe mode for 300 seconds
[17:52:02][C][api:140]: API Server:
[17:52:02][C][api:141]: Address: 192.168.1.72:6053
[17:52:02][C][api:143]: Using noise encryption: YES
From your log it seems not:
[17:52:02][I][i2c.arduino:096]: Results from i2c bus scan:
[17:52:02][I][i2c.arduino:098]: Found no i2c devices!
either try different address, check pull-up resistors on i2c lines… or try to use original i2c gpio’s on esp (4 and 5 for 8266).
Everything worked fine before the system update.
Thank you! I was having this exact issue, AHT20 solved it, much appreciated.
captive_portal:
i2c:
sda: D2 #GPIO4
scl: D1 #GPIO5
sensor:
- platform: aht10 #dht12 #am2320 #
variant: AHT20 # make sure your sansor is AHT 10/20 otherwise not working -
#AHT10 - For AHT10 devices.
#AHT20 - For AHT20 and AHT30 devices.
temperature:
name: "Temperature"
humidity:
name: "Humidity"
update_interval: 60s
Just jumping on the bandwagon here. A while back I had the exact same issue. The chip clearly shows AHT10 but only works when I use AHT20 variant option.
To anybody who struggles with a similar issue as it was posted above. Obviously the sensor is detected, but did not start correctly. I saw this just after I flashed the ESP with ESPHome, and couldn’t figure out what is going wrong even after a few restart. So I moved the ESP to a different power supply, and everything started to work, then moved back to the PC and was still working. It worth a try. (And of course use variant: ATH20
, if it is an ATH20…)
Thank you for this thread, I went through wiring 3 AHT10’s before finding it, switched the variant to AHT20 and now they all work!
Thank you. This saved me another few hours of trying to figure out what the heck was going on.
Just ran into this issue. Chip is marked AHT10, but noting worked until I set variant to AHT20:
Before trying to figure out esphome i tested it with arduino ide code, which worked no problem.
Since Arduino code works with aht10 definition perhaps ESPhome has its wires crossed with libraries for these keywords?
In case anyone needs:
#include <Wire.h>
#include <Adafruit_AHTX0.h>
Adafruit_AHTX0 aht; // Create AHT10 object
void setup() {
Serial.begin(115200);
Wire.begin(21, 22); // SDA, SCL pins for ESP32
if (!aht.begin()) {
Serial.println("Could not find AHT10 sensor");
while (1);
}
}
void loop() {
sensors_event_t event;
aht.getEvent(&event); // Get temperature and humidity
Serial.print("Temperature: ");
Serial.print(event.temperature);
Serial.print(" °C");
Serial.print("\tHumidity: ");
Serial.print(event.relative_humidity);
Serial.println(" %");
delay(2000); // Update every 2 seconds
}