🌡️ Temperature Sensor
Add a DHT22 and measure temperature/humidity.
ESP32 is a microcontroller - a small computer that can measure things, control things, and talk to your WiFi. Together with ESPHome, it becomes easy to build your own smart home devices.
Before you start, you need:
ESPHome is software that runs on your ESP32. You describe what it should do in a simple YAML file, and ESPHome handles the rest.
Benefits:
| Board | Price | Recommended for |
|---|---|---|
| ESP32-WROOM-32 DevKit | $5-10 | ⭐ Beginners (start here) |
| ESP32-C3 Super Mini | $3-5 | Small projects |
| ESP32-S3 | $8-12 | Displays, more RAM |
Open Home Assistant and go to Settings → Add-ons
Click Add-on Store (bottom right)
Search for “ESPHome” and click on it
Click Install and wait (1-2 minutes)
Enable “Start on boot” and “Show in sidebar”
Click Start
Open ESPHome from the sidebar
Click + NEW DEVICE
Click Continue (ignore browser-flash for now)
Name the device - e.g., test-sensor
Select ESP32 as device type
Click Skip (we’ll flash manually afterwards)
Click EDIT on your new device and replace the content with:
esphome: name: test-sensor friendly_name: Test Sensor
esp32: board: esp32dev
# Logging for debugginglogger:
# Home Assistant APIapi: encryption: key: "YOUR-AUTO-GENERATED-KEY"
# Wireless updatesota: platform: esphome
# WiFi connectionwifi: ssid: "YOUR-WIFI-NAME" password: "YOUR-WIFI-PASSWORD"
# Fallback hotspot if WiFi failscaptive_portal:
# Simple test sensor - WiFi signal strengthsensor: - platform: wifi_signal name: "WiFi Signal" update_interval: 60sConnect ESP32 to computer with USB cable
Click INSTALL → Plug into this computer
Select “Serial” in the popup window
Select the correct COM port (typically the only one shown)
Wait for upload (~2 minutes)
You’ll see “INFO Successfully uploaded” when done
If web-flash doesn’t work:
# Install ESPHome CLIpip install esphome
# Flash via USBesphome run test-sensor.yamlGo to Settings → Devices & Services
Home Assistant automatically finds your ESP32 under “Discovered”
Click Configure
Enter your encryption key (from the YAML file)
Click Submit → Finish
Your ESP32 is now connected! 🎉
Go to Developer Tools → States
Search for sensor.test_sensor_wifi_signal
You should see a value like -45 dBm
🌡️ Temperature Sensor
Add a DHT22 and measure temperature/humidity.
🚶 Motion Sensor
Add a PIR sensor for motion detection.