This tutorial explains how to use ESPHome Device Builder to create an ESPHome configuration, compile the firmware, and flash it to a device.
1.12.4 and ESPHome 2026.8.1. Button names and locations may differ slightly between versions, but the workflow is essentially the same.ESPHome Builder from the Home Assistant sidebar.+ Create device in the lower-right corner. On the first run, you can also click Add new device on the page.
Create configuration window, select Create new project.
Connect your board and let ESPHome try to identify it.Generic ESP32 Board only after confirming the chip model and required parameters.Finish setup.
living-room-sensor. The name is used to generate the network hostname, so use only lowercase letters, numbers, and hyphens.After the project is created, ESPHome generates a minimal configuration. Edit YAML in the editor on the right. Use Core configuration, Components, and Automations on the left to review or add configuration items.
The default configuration usually contains the following sections:
| Configuration Item | Purpose |
|---|---|
esphome | Sets the device name and friendly name |
esp32 / esp8266 / rp2040 | Sets the chip, board, and framework |
logger | Outputs runtime logs for debugging |
api | Allows Home Assistant to connect |
ota | Enables future firmware updates over the network |
wifi | Configures Wi-Fi and the fallback access point |
captive_portal | Provides a provisioning page on the fallback access point |
api.encryption.key generated by the wizard. It encrypts API communication between the device and Home Assistant. Never publish real Wi-Fi passwords, API keys, or OTA passwords in public repositories, screenshots, or forums.Components panel. Some components used by M5Stack products are hosted in external GitHub repositories. Add the repository with external_components in the YAML editor before configuring the component. See the example below. For sensor-specific parameters and usage, follow the corresponding ESPHome component page.Using Unit TMOS PIR as an example, first import the ESPHome component repository:
external_components:
- source: github://m5stack/esphome-yaml/components
components: [sths34pf80]
refresh: 0s Then use the component in the appropriate ESPHome platform configuration. Refer to the corresponding component page for the exact platform name, parameters, and entity configuration for each product.
When editing is complete, click Save in the lower-right corner. Correct any syntax or component errors reported by the editor before compiling.
Install in the lower-right corner of the editor.
Use the following table when choosing an installation method:
| Installation Method | Use Case | Requirements |
|---|---|---|
Plug into this computer | First flash; device connected to the computer running the browser | WebSerial-capable browser, USB data cable, HTTPS or localhost page |
Plug into your Home Assistant server | Device connected directly to the Home Assistant host | Host recognizes the USB serial port and permits ESPHome access |
On the network | Subsequent OTA updates | ESPHome firmware running, device online, and OTA configured |
Plug into this computer refers to the computer where the browser is open. Plug into your Home Assistant server refers to the server actually running Home Assistant. When Home Assistant is accessed remotely, these are usually different machines.This method is recommended for the first flash.
Plug into this computer in the installation method dialog.Successfully compiled program, click Open USB flasher.
firmware.factory.bin, then click Connect & install.
Connect.
Common serial-port names include:
cu.usbmodem... or cu.usbserial.../dev/ttyUSB... or /dev/ttyACM...COM...Use this method when the device is connected directly to the Home Assistant host rather than to the computer running the browser.
Plug into your Home Assistant server./dev/ttyUSB0 or /dev/ttyACM0.If the target port is not listed, check that:
Use this method only for devices that are already running ESPHome firmware and are currently online.
On the network.For a first flash, an offline device, a device that cannot reconnect after network changes, or a device with OTA removed, recover it over USB instead.
Click Download on the compilation results page to save the firmware. A first full flash normally uses firmware.factory.bin; firmware.ota.bin is for OTA updates and must not replace the first full-flash image.
Before flashing manually, verify the file type, chip model, Flash settings, and write address. If no product-specific instructions are available, use the ESPHome USB flasher where possible.
After flashing, ESPHome Web displays the installation progress and restart status.
After the firmware starts and connects to the network, Home Assistant normally discovers the ESPHome device automatically.
Open Settings -> Devices & services.
Find the ESPHome device under Discovered and click Add.
Submit.
Area, and click Finish.
If Home Assistant does not discover the device automatically:
Add integration and search for ESPHome.living-room-sensor.local, or its IP address.api.encryption.key in the YAML.
logger. If the IP address is not shown, confirm that the device is connected to Wi-Fi and check the serial connection and log-output settings.