Temperature of AHT20 sensor keeps rising on Wemos S2 mini

Good enough.

Remove the component from your code.

I would suggest normally to have that kind of wiring, but your case is so weird, you could try with longer one. I remember some case with another brand ht sensor suffering from close contact to Esp (not thermally).

Anyway, like you can see there’s not a lot to offer at this point…
Esphome could have bug with sensor internal heater control, but just for Esp32, not so probable.
And I expect you have tried other pins already.

Hello I had the same problem as you. I think I managed to solve it. I did it by lowering l2c frequency to low value - 1000 Hz (default is 50khz) I also read the value every only every 3 minutes. I think the issue is that with high polling frequency the sensor itself heats up.

Now from early testing it looks to be good.

This was helpful! Reducing the frequency caused an immediate temperature drop. Before, it was 3-5 °C above a thermometer right next to it