Some hardware links on this page are affiliate links. As an Amazon Associate I earn from qualifying purchases. We may earn a commission if you buy through them, at no extra cost to you. See the affiliate disclosure.
A handful of cheap climate sensors beats one expensive hub sensor in the wrong corner of the house. This pack is a single-board recipe: ESP32-C6 Super Mini, AHT20 on I²C, ESPHome native API, Home Assistant discovery.
Wi-Fi credentials stay in your ESPHome secrets file. Never paste SSIDs, PSKs, API keys, or OTA passwords into a published YAML.
What problem it solves
You want a temperature and humidity number in a closet, a crawl space, a garage, or a studio, without buying another brand-name sensor or hub. Copy the YAML once per room, change a few substitutions, and each board shows up in Home Assistant with the room’s name on it.
What you get working
- Temperature and humidity entities named after the room you set (for example “Office Temperature”), updated every 60 seconds by default.
- Calibration offsets for temperature and humidity, so you can match a reference thermometer without editing filters by hand.
- Diagnostics: Wi-Fi signal and uptime sensors, plus a restart button, so a board in a crawl space is easy to check.
- Fallback hotspot: if Wi-Fi fails, the board starts its own access point with a captive portal so you can fix the credentials.
Hardware notes
- Board. ESP32-C6 Super Mini. Leave these pins alone: GPIO8 (onboard LED and boot strap), GPIO9 (BOOT button and strap), GPIO12 and GPIO13 (USB D− and D+), and GPIO15 (strap). The pack uses GPIO0 and GPIO1 for I²C.
- Sensor. AHT20 module. Some listings sold as “AHT20” are AHT10-compatible; ESPHome’s
aht10platform withvariant: AHT20covers both if the address is right (usually0x38). - Power. Power the board from USB-C, or from an external 5 V supply on the 5V pin — not both at once. The AHT20 always takes 3.3 V from the board’s 3V3 pin, never 5 V.
- Placement. The board and a USB charger both make heat. Keep the sensor at the vent end of the case, away from the board, and out of direct sun.
Wiring
Use 3.3 V, not 5 V, on the AHT20.
| AHT20 | ESP32-C6 Super Mini |
|---|---|
| VIN | 3V3 |
| GND | GND |
| SDA | GPIO0 |
| SCL | GPIO1 |
Snippet
Trimmed from the pack YAML. Room names, pins, and offsets are substitutions:
substitutions:
device_name: climate-office
friendly_name: Office climate
room: Office
sda_pin: GPIO0
scl_pin: GPIO1
update_every: 60s
temp_offset: "0.0"
humidity_offset: "0.0"
esp32:
board: esp32-c6-devkitc-1
framework:
type: esp-idf
i2c:
sda: ${sda_pin}
scl: ${scl_pin}
scan: true
sensor:
- platform: aht10
variant: AHT20
address: 0x38
update_interval: ${update_every}
temperature:
name: "${room} Temperature"
filters:
- offset: ${temp_offset}
humidity:
name: "${room} Humidity"
filters:
- offset: ${humidity_offset}
# Wi-Fi, API, fallback hotspot, diagnostics, and restart button: full YAML in the pack
The pack YAML uses !secret for Wi-Fi, API encryption, and OTA. Substitute your own secrets locally.
Setup outline
- Wire the AHT20 to the board as in the table. Double-check 3V3, not 5V.
- Copy
secrets.example.yamltosecrets.yamlin your ESPHome folder (or merge the keys into the one you have) and fill in your own values. - Create a new device in ESPHome, paste the pack YAML, and change
device_name,friendly_name, androom. Every board needs its owndevice_name. - Flash over USB the first time. In the logs, the I²C scan should find a device at
0x38. Later updates go over Wi-Fi. - Accept the device in Home Assistant (Settings → Devices & services). Rename entities to a generic room name you will not mind publishing later.
- Calibrate: leave the board next to a thermometer you trust for an hour, then set
temp_offsetandhumidity_offsetand flash again. - Print the case, put the sensor near the vent slots, and mount it where you want the reading.
Troubleshooting
0x38 not found. Swap SDA/SCL, check 3.3 V, try 4.7 kΩ pull-ups if the module does not include them.- Reads a degree or two high. The sensor is picking up heat from the board, a USB charger, or sun. Move it to the vent end of the case, relocate the board, then fine-tune with
temp_offset. - Board not joining Wi-Fi. 2.4 GHz only; the C6 will not see a 5 GHz SSID. Keep the SSID out of git —
wifi_ssid/wifi_passwordinsecrets.yaml. If it still fails, join the fallback hotspot and fix the credentials there. - Two boards fight over one device. Both use the same
device_name. Give each board its own name and flash again. - API encryption mismatch. Delete the stale device in HA and re-adopt after you rotate the key.
Enclosure
The pack includes a two-part case (base and lid) with vent slots. Print in PETG or PLA, 0.2 mm layers, no supports; the lid presses onto the base. Use PETG if the sensor lives in a garage or porch; PLA is fine indoors.