The ESPHome Device Builder is where most of your time with ESPHome is spent. It stores every device configuration, checks your YAML, compiles firmware, installs it over USB or Wi-Fi and streams live logs. This guide walks through a complete first project: creating a device with the wizard, reading the configuration it generates, adding a temperature sensor and a relay, and installing updates wirelessly.
Where the Device Builder runs
The Device Builder is the same web application in every setup. Only the host changes.
- Home Assistant app. Installed from Settings → Apps (named Add-ons on older Home Assistant releases) and opened from the sidebar. Configurations live in
/config/esphome/and are included in Home Assistant backups. - Desktop ESPHome app. Packaged builds for Windows, macOS and Linux bundle the Device Builder with everything it needs, so you can run it without setting up Python yourself.
- Command line. After
pip install esphome, runningesphome dashboard config/serves it on port 6052 from any computer. - Docker. The official image
ghcr.io/esphome/esphomeruns it on a server or NAS, also on port 6052.
Pick whichever matches where you keep your other home automation tools. If you run Home Assistant OS, the app is the obvious choice because backups, updates and access control are handled for you. If you prefer to compile on a powerful desktop, the desktop app or the pip install will produce firmware much faster than a small single-board computer.
A tour of the main screen
When you open the Device Builder you see a grid of cards, one per configuration file. Each card shows:
- The device name and its YAML filename.
- A status badge: Online, Offline, or Update available when the device runs an older ESPHome version than the Device Builder.
- Action buttons: Edit opens the YAML editor, Install compiles and uploads, Logs streams the device's output.
- A three-dot menu with Validate, Clean build files, Rename, Show API key and Delete.
Above the grid sits a Discovered area for ESPHome devices found on the network that the Device Builder does not manage yet, for example a board prepared with ESPHome Web or a pre-flashed product. A Secrets button opens secrets.yaml, the shared file for passwords and keys.
Creating a device with the wizard
Click New device (labelled Create device in newer versions). The wizard offers three starting points:
- New device setup walks you through naming the device, choosing the platform and board, and entering Wi-Fi details.
- Import from file accepts an existing
.yamlfile, which is useful when moving from another machine. - Empty configuration gives you a blank file for writing YAML from scratch.
Choose the guided setup. Give the device a lowercase name with hyphens, such as garage-climate. The name becomes the device's hostname on the network, so avoid spaces and underscores. Next, pick the chip family. If you are not sure, look at the metal shield on the module: it usually says ESP32, ESP32-S3, ESP32-C3 or ESP8266. RP2040 boards such as the Raspberry Pi Pico W are listed separately.
The wizard then asks for your Wi-Fi network name and password, and creates the file. It also generates an API encryption key and an OTA password automatically.
Reading the generated configuration
Click Edit on the new card. A minimal ESP32 configuration looks like this:
esphome:
name: garage-climate
friendly_name: Garage Climate
esp32:
board: esp32dev
framework:
type: esp-idf
logger:
api:
encryption:
key: "dGhpcyBpcyBhbiBleGFtcGxlIGtleSBvbmx5ISE="
ota:
- platform: esphome
password: "3f1a9c..."
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "Garage-Climate Fallback"
password: "k2Lm8Pq0"
captive_portal:
Each top-level key is a component:
- esphome sets the node name and the friendly name Home Assistant displays.
- esp32 chooses the board definition and the framework. Recent versions of the wizard set ESP-IDF here; Arduino remains available if a library you need depends on it.
- logger enables log output over USB and to the dashboard's log view.
- api enables the native API that Home Assistant uses, with an encryption key unique to this device.
- ota allows wireless updates, protected by a password.
- wifi connects to your network. The
!secrettags pull values fromsecrets.yaml. - ap and captive_portal provide a fallback hotspot. If the device cannot join your network, it starts its own access point where you can enter new credentials from a phone.
Leave all of this in place. Everything you add goes below.
Choosing the right board definition
The board: line matters more than it looks. It tells ESPHome how much flash the module has, which pins exist and which USB mode to expect. A few rules of thumb help:
- For generic ESP32 DevKit boards with a WROOM-32 module,
esp32devis the safe default. - For ESP32-S3 boards,
esp32-s3-devkitc-1covers most variants. If your board has 8 MB or 16 MB of flash and PSRAM, add aflash_size:option and apsram:block so the extra memory is used. - For ESP32-C3 boards,
esp32-c3-devkitm-1works for most modules, including the small "super mini" boards. - For ESP8266 boards such as the Wemos D1 mini, use
d1_mini. For bare ESP-01 modules with 1 MB of flash, useesp01_1m.
Picking a board with more flash than the chip actually has produces firmware that installs but crashes at boot. When in doubt, choose the smaller definition. You can confirm the real flash size in the log of the first boot, where ESPHome prints the detected chip and flash details.
Getting comfortable with the editor
The built-in editor is more capable than it first appears. It highlights YAML syntax, autocompletes component names and keys, and underlines errors as you type, using the same schemas that power validation. Hovering over a key shows a short description of what it does.
A few habits make editing faster:
- Keep one component per top-level block. All sensors go under a single
sensor:key as list items, rather than repeatingsensor:several times. - Comment generously. Lines starting with
#are ignored. A short note explaining why a pin or filter was chosen saves time months later. - Copy from the documentation, then trim. Each component page on esphome.io includes a full example. Paste it, then remove options you do not need rather than typing from memory.
- Save often. The editor does not autosave. Closing the window without saving discards your changes.
Adding a temperature and humidity sensor
Suppose a BME280 or SHT31 sensor is wired to the board's I²C pins. On a classic ESP32 DevKit those are usually GPIO21 for SDA and GPIO22 for SCL. Add an I²C bus and the sensor platform:
i2c:
sda: GPIO21
scl: GPIO22
scan: true
sensor:
- platform: sht3xd
address: 0x44
temperature:
name: "Temperature"
humidity:
name: "Humidity"
update_interval: 60s
The scan: true option makes the device log every I²C address it finds at boot, which is the quickest way to confirm the wiring. Each named sensor becomes an entity in Home Assistant. Because the device has a friendly_name, Home Assistant shows them as "Garage Climate Temperature" and "Garage Climate Humidity" without you repeating the device name.
Adding a relay output
Now add a relay on GPIO26 to switch a fan or a light:
switch:
- platform: gpio
pin: GPIO26
name: "Fan"
id: fan_relay
restore_mode: RESTORE_DEFAULT_OFF
The id lets other parts of the configuration refer to the relay. The restore_mode decides what happens after a power cut: here the relay returns to its last known state if one is stored, and stays off otherwise. For anything that could be dangerous if it switched on unexpectedly, such as a heater, use ALWAYS_OFF.
Linking them with an on-device automation
ESPHome can make decisions locally, without Home Assistant. Turn the fan on when humidity rises above 70 percent and off again below 60:
humidity:
name: "Humidity"
on_value_range:
- above: 70.0
then:
- switch.turn_on: fan_relay
- below: 60.0
then:
- switch.turn_off: fan_relay
This block goes inside the humidity sensor definition. The gap between 60 and 70 stops the fan from cycling on and off around a single threshold. Because the logic runs on the microcontroller, the fan still responds if Home Assistant restarts or the network goes down.
Validating before you compile
Click Save, then open the card's menu and choose Validate. Validation checks every key against the component's schema, confirms that pins exist on the selected board and warns about pins with special roles. Common messages include:
- "Component not found": a typo in the platform name, such as
sht31instead ofsht3xd. - "Pin is used in multiple places": two components claim the same GPIO.
- Strapping pin warnings: GPIO0, GPIO2, GPIO12 and GPIO15 on the ESP32 influence boot behaviour. They can be used, but connecting the wrong hardware to them can stop the board from booting.
- Indentation errors: YAML is strict about spaces. Use two spaces per level and never tabs.
Validation is fast and catches most mistakes before you wait for a compile.
The first install
The very first firmware has to go over USB. Click Install and the Device Builder offers several options:
- Wirelessly: only available once the device is already running ESPHome on your network.
- Plug into this computer: uses the browser's Web Serial to flash a board connected to the computer you are browsing from. Requires Chrome or Edge, and a secure HTTPS connection to the Device Builder.
- Plug into the computer running ESPHome Device Builder: uses a serial port on the host machine itself, useful when the board is connected to your Home Assistant server.
- Manual download: compiles the firmware and gives you a file to flash with ESPHome Web or another tool.
The first compile for each platform takes the longest because the Device Builder downloads the toolchain and framework. Expect several minutes on a desktop and considerably longer on a Raspberry Pi. Later builds reuse the cached files and are much quicker.
When the upload finishes, the log view opens automatically. You should see the device boot, connect to Wi-Fi, report its IP address and start publishing sensor values.
Updating over the air
From now on, every change follows the same short loop: Edit, Save, Install → Wirelessly. The Device Builder compiles the new firmware and sends it to the device over Wi-Fi using the OTA password from the configuration. The device writes the new image to a separate partition, verifies it, and only then reboots into it. If the transfer is interrupted, the board keeps running the old firmware.
Two habits make OTA updates painless:
- Keep the logger level reasonable. The default
DEBUGlevel is helpful during development. Once a device is stable,INFOorWARNreduces chatter. - Do not remove the
otaorwifiblocks. Without them, the next update has to go over USB again.
Adding the device to Home Assistant
If you run the Device Builder as a Home Assistant app, Home Assistant will usually show a notification within a minute: a new ESPHome device has been discovered. Open Settings → Devices & services, click Configure on the discovered entry and confirm. Because the encryption key is known to the Device Builder, the integration is set up automatically in most cases.
If you run the Device Builder elsewhere, Home Assistant may ask for the encryption key. Copy it from the card's menu under Show API key and paste it in.
Organising many devices
As the number of devices grows, a little structure saves time:
- Use substitutions at the top of each file for values that repeat, such as the device name or a pin number.
- Use packages to share common blocks, for example a standard
wifi,loggerandotasection, across every device. - Keep everything in Git. The configuration folder is plain text. Committing it gives you history and an easy way to roll back a change, as long as
secrets.yamlstays out of the repository. - Group by location in names.
kitchen-climate,kitchen-under-cabinet-ledsandkitchen-plug-kettlesort together in the dashboard.
Cleaning up and troubleshooting builds
If a compile fails with an error that does not make sense, especially after an ESPHome update, use Clean build files from the card's menu. It deletes the cached build for that device so the next compile starts fresh. It does not touch your YAML.
When the device shows Offline even though it works, the Device Builder probably cannot see its mDNS announcements. Either allow mDNS on your network or add use_address: 192.168.1.50 under wifi with the device's IP address.
Key takeaways
- The Device Builder is the same tool whether it runs as a Home Assistant app, a desktop ESPHome app, from pip or in Docker.
- The wizard generates a safe starting configuration with Wi-Fi, a fallback hotspot, an encrypted API and OTA already set up.
- Add hardware as new top-level components, validate, and only then compile.
- The first install needs USB; every later update goes over Wi-Fi.
- On-device automations keep critical behaviour working even when Home Assistant is offline.


