esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
291 stars 36 forks source link

Combined AHT20+ENS160 Board - Temperature/Humidity Sensor not delivering values in version 2024.3.0 #5621

Closed nilsmau closed 7 months ago

nilsmau commented 7 months ago

The problem

With esp home 2024.3.0, the i2c connected ENS160+AHT20 sensors fail - no temperature or humidity sensor values are being read.

Device reports (in the logs): initially Communication with AHT10 failed! later (regularly): Invalid external temperature - compensation values not updated

no change in configuration.yml of the device.

Which version of ESPHome has the issue?

2024.03.0

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2024.3.1

What platform are you using?

ESP8266

Board

esp01_1m

Component causing the issue

No response

Example YAML snippet

i2c:
  sda: GPIO12 #D05
  scl: GPIO14 #D06
  scan: true
  id: bus_a
sensor:
  - platform: ens160
    eco2:
      name: co2
    tvoc:
      name: voc
    aqi:
      name: aqi
      id: aqi
    update_interval: 10s
    address: 0x53
    compensation:
      temperature: id_zero_1_temperatura
      humidity: id_zero_1_umidita

  # AHT21 
  - platform: aht10
    variant: AHT20
    temperature:
      name: zero-1-temperatura
      id: id_zero_1_temperatura
    humidity:
      name: zero-1-umidita
      id: id_zero_1_umidita
    update_interval: 30s  
    address: 0x38

Anything in the logs that might be useful for us?

[11:22:27][C][i2c.arduino:059]: I2C Bus:
[11:22:27][C][i2c.arduino:060]:   SDA Pin: GPIO12
[11:22:27][C][i2c.arduino:061]:   SCL Pin: GPIO14
[11:22:27][C][i2c.arduino:062]:   Frequency: 50000 Hz
[11:22:27][C][i2c.arduino:065]:   Recovery: bus successfully recovered
[11:22:27][I][i2c.arduino:075]: Results from i2c bus scan:
[11:22:27][I][i2c.arduino:081]: Found i2c device at address 0x38
[11:22:27][I][i2c.arduino:081]: Found i2c device at address 0x53
[11:22:27][C][esp8266_pwm:022]: ESP8266 PWM:
[11:22:27][C][esp8266_pwm:023]:   Pin: GPIO15
[11:22:27][C][esp8266_pwm:024]:   Frequency: 50.0 Hz
[11:22:27][C][template.number:050]: Template Number 'Servo Control'
[11:22:27][C][template.number:051]:   Optimistic: YES
[11:22:27][C][template.number:052]:   Update Interval: 60.0s
[11:22:27][C][restart.button:017]: Restart Button 'Restart'
[11:22:27][C][servo:014]: Servo:
[11:22:27][C][servo:015]:   Idle Level: 7.5%
[11:22:27][C][servo:016]:   Min Level: 3.0%
[11:22:27][C][servo:017]:   Max Level: 12.0%
[11:22:27][C][servo:018]:   auto detach time: 0 ms
[11:22:27][C][servo:019]:   run duration: 0 ms
[11:22:27][C][ens160:278]: ENS160:
[11:22:27][D][ens160:300]: Setup successful
[11:22:27][I][ens160:303]: Firmware Version: 5.4.6
[11:22:27][C][ens160:306]:   Address: 0x53
[11:22:27][C][ens160:307]:   Update Interval: 10.0s
[11:22:27][C][ens160:308]:   CO2 Sensor: 'co2'
[11:22:27][C][ens160:308]:     Device Class: 'carbon_dioxide'
[11:22:27][C][ens160:308]:     State Class: 'measurement'
[11:22:27][C][ens160:308]:     Unit of Measurement: 'ppm'
[11:22:27][C][ens160:308]:     Accuracy Decimals: 0
[11:22:27][C][ens160:308]:     Icon: 'mdi:molecule-co2'
[11:22:27][C][ens160:309]:   TVOC Sensor: 'voc'
[11:22:27][C][ens160:309]:     Device Class: 'volatile_organic_compounds_parts'
[11:22:27][C][ens160:309]:     State Class: 'measurement'
[11:22:27][C][ens160:309]:     Unit of Measurement: 'ppb'
[11:22:27][C][ens160:309]:     Accuracy Decimals: 0
[11:22:27][C][ens160:309]:     Icon: 'mdi:radiator'
[11:22:27][C][ens160:310]:   AQI Sensor: 'aqi'
[11:22:27][C][ens160:310]:     Device Class: 'aqi'
[11:22:27][C][ens160:310]:     State Class: 'measurement'
[11:22:27][C][ens160:310]:     Unit of Measurement: ''
[11:22:27][C][ens160:310]:     Accuracy Decimals: 0
[11:22:27][C][ens160:310]:     Icon: 'mdi:chemical-weapon'
[11:22:27][C][ens160:313]:     Temperature Compensation: 'zero-1-temperatura'
[11:22:27][C][ens160:313]:     Device Class: 'temperature'
[11:22:27][C][ens160:313]:     State Class: 'measurement'
[11:22:27][C][ens160:313]:     Unit of Measurement: '°C'
[11:22:27][C][ens160:313]:     Accuracy Decimals: 2
[11:22:28][C][ens160:314]:     Humidity Compensation: 'zero-1-umidita'
[11:22:28][C][ens160:314]:     Device Class: 'humidity'
[11:22:28][C][ens160:314]:     State Class: 'measurement'
[11:22:28][C][ens160:314]:     Unit of Measurement: '%'
[11:22:28][C][ens160:314]:     Accuracy Decimals: 2
[11:22:28][C][aht10:164]: AHT10:
[11:22:28][C][aht10:165]:   Address: 0x38
[11:22:28][E][aht10:167]: Communication with AHT10 failed!
[11:22:28][C][aht10:169]:   Temperature 'zero-1-temperatura'
[11:22:28][C][aht10:169]:     Device Class: 'temperature'
[11:22:28][C][aht10:169]:     State Class: 'measurement'
[11:22:28][C][aht10:169]:     Unit of Measurement: '°C'
[11:22:28][C][aht10:169]:     Accuracy Decimals: 2
[11:22:28][C][aht10:170]:   Humidity 'zero-1-umidita'
[11:22:28][C][aht10:170]:     Device Class: 'humidity'
[11:22:28][C][aht10:170]:     State Class: 'measurement'
[11:22:28][C][aht10:170]:     Unit of Measurement: '%'
[11:22:28][C][aht10:170]:     Accuracy Decimals: 2

[11:25:17][D][sensor:093]: 'co2': Sending state 528.00000 ppm with 0 decimals of accuracy
[11:25:17][D][sensor:093]: 'voc': Sending state 87.00000 ppb with 0 decimals of accuracy
[11:25:17][D][sensor:093]: 'aqi': Sending state 2.00000  with 0 decimals of accuracy
[11:25:17][W][ens160:244]: Invalid external temperature - compensation values not updated

Additional information

esphome 2024.2.2 works possibly related to #6401?

ea3igt commented 7 months ago

I encountered precisely the same issue with my ESP32-LOLIN32 + AHT20. After reverting to version 2024.2.2, the device is working again.

unex commented 7 months ago

Same for me on Lolin S2 mini + AHT20, I2S scan fails to detect the sensor on 2024.3.0

mvzut commented 7 months ago

Same here, ENS160+AHT20 and no temp & humidity since update

danielholm commented 7 months ago

Same here, though using a combined aht20+bmp280. Address is found on scan, however I get no response from "aht10".

EngedjBe commented 7 months ago

Hi! I also use the AHT20 + BMP280 module bought on AliExpress. I tried every solution but nothing helped.

The question would be, how could this be brought to the attention of the developers? I'm sure they can fix it if they know there's a problem.

armin306 commented 7 months ago

Same here, AHT20 connected to esp8266 - d1_mini. "Communication with AHT10 failed!"

danielholm commented 7 months ago

I have no idea how to debug. I just downgraded, compiled an old version of esphome on the board and upgraded again.

danielholm commented 7 months ago

I wrote too fast. I checked the list of full changes for 2024.3 and there is one commit regarding changes to aht10 according datasheet. It could potentially be the culprit.

https://github.com/esphome/esphome/pull/6303

Code changes: https://github.com/esphome/esphome/pull/6303/files/ddf8893d32770d5b2ae7fc4d96eb11d396500d38

Alien1411 commented 7 months ago

Seems like 2 changes have been implemented at the same time resulting in a sensor not booting properly.

https://github.com/esphome/esphome/pull/6401

This workaround fixes the issue for me. https://github.com/esphome/esphome/pull/6401#issuecomment-2009197421

mvzut commented 7 months ago

I can confirm that this indeed solves the issue!

uudam2017 commented 7 months ago

I also use AHT20+BMP280, it works well in ESPHOME 2024.2, but AHT20 failed to communicate in the last update Please help me.

k7hpn commented 7 months ago

My AHT20 sensors connected to a featheresp32 board also do not seem to be working with the latest release.

Edit: It looks liek it might be fixed in ESPHome PR #6409

clydebarrow commented 7 months ago

Fixed with #6409