← Projects
electronics beginner Jul 15, 2026 ◯ 2 min read

ESPHome and Home Assistant Beginner Guide: Build Your First WiFi Sensor

Build time: 2-3 hours
Tools needed: None required
Parts List
esphomehome assistantesp32smart homeiottemperature sensorwifiautomation

ESPHome turns an ESP32 into a smart home sensor or controller with almost no code. Combined with Home Assistant, it is the most powerful DIY home automation setup available.

What You Will Build

A WiFi temperature and humidity sensor that reports every 30 seconds to Home Assistant, appears automatically in your dashboard, and survives reboots. Total hardware cost: under $10.

Hardware Needed

Wire the BME280 (I2C)

BME280 PinESP32 Pin
VCC3.3V
GNDGND
SDAGPIO 21
SCLGPIO 22

Install ESPHome

In Home Assistant: Settings → Add-ons → Add-on Store → search ESPHome → Install → Start.

Create Your Device

ESPHome dashboard → New Device → name it → Edit. Paste this configuration:

esphome:
  name: workshop-sensor
  friendly_name: Workshop Sensor

esp32:
  board: esp32dev

logger:
api:
  encryption:
    key: !secret api_key
ota:
  password: !secret ota_password
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: "Fallback Hotspot"
    password: "fallback123"

i2c:
  sda: GPIO21
  scl: GPIO22

sensor:
  - platform: bme280_i2c
    temperature:
      name: "Temperature"
    pressure:
      name: "Pressure"
    humidity:
      name: "Humidity"
    address: 0x76
    update_interval: 30s

Flash Your ESP32

ESPHome dashboard → Install → Plug into this computer → select USB port → Install.

First flash takes 2–3 minutes to compile. Future updates are wireless (OTA).

Connect to Home Assistant

HA will auto-discover the device. Settings → Devices & Services → Configure. Your sensors are now available for automations and dashboards.

What to Build Next

ESPHome supports nearly any hardware with simple YAML additions:

Each takes 10–30 lines of YAML and works exactly like the temperature sensor.

ESPHome vs Tasmota

Both flash open-source firmware to ESP devices. ESPHome is YAML-configured and tightly integrated with Home Assistant. Tasmota works with more platforms but is more complex. If you use HA, ESPHome wins.