Install ESPHome in Home Assistant
Install ESPHome Device Builder: add-on, secrets.yaml, encryption key, first ESP32-C6 and adoption in Home Assistant.
Getting started
Home Assistant
Buying
Install ESPHome Device Builder: add-on, secrets.yaml, encryption key, first ESP32-C6 and adoption in Home Assistant.

ESPHome is software that turns an ESP32 board, a small electronic board with Wi-Fi, into a smart home device: you describe what the board must do in a simple configuration file called YAML, and ESPHome turns it into the board’s program, without you writing any code. In Home Assistant, the free software that gathers your connected devices, the ESPHome Device Builder add-on provides the editor, the compiler (the tool that builds the program) and the update tool. Once installed, it serves all your ESP32 projects.
Expected result: ESPHome open in the sidebar, a secrets.yaml file and a first device ready to flash. Time: 20 minutes. Difficulty: beginner.

The first device this add-on is meant to flash is an ESP32-C6-DevKitC-1. The UART port is the one used for that first USB install.
Add-ons exist only on Home Assistant OS (Green, Yellow, Raspberry Pi, virtual machine) and Supervised. On a Container or Core install, ESPHome is installed separately, as described below. If you do not know which variant you run, open Settings → System → About: the “Installation type” line tells you.
Check: the ESPHome dashboard loads without error and offers the + New Device button.
Without add-ons, install ESPHome on any Linux, macOS or Windows machine with Python:
pip install esphome
esphome dashboard config/
The dashboard then opens at http://localhost:6052. An official Docker image is also available (ghcr.io/esphome/esphome, with --net=host so network discovery works): follow the ESPHome installation documentation.
In ESPHome, click Secrets (top right). This file keeps your passwords out of the device files, so you can share those without leaking them:
wifi_ssid: "YourNetworkName"
wifi_password: "wifi-password"
ap_password: "fallback-password"
api_encryption_key: "PASTE-A-GENERATED-KEY"
ota_password: "ota-password"
Generate the encryption key with openssl rand -base64 32 (or any generator of 32 bytes in base64). Your network must be 2.4 GHz: the ESP32-C6 does not join a 5 GHz-only network. Never publish this file.
test-esp32, and confirm.esphome:
name: test-esp32
esp32:
board: esp32-c6-devkitc-1
framework:
type: esp-idf
logger:
api:
encryption:
key: !secret api_encryption_key
ota:
- platform: esphome
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "test-esp32 Fallback"
password: !secret ap_password
captive_portal:
Click Validate: the “Configuration is valid” message confirms the syntax. This file was not run on a board for this article; it follows the standard structure from the ESPHome documentation.
The first flash goes over a USB cable: follow flash an ESP32 with ESPHome. Home Assistant then detects the device: open Settings → Devices & services, click Configure on the discovered ESPHome card and paste the encryption key. Later updates go without a cable, over OTA.
| Symptom | Likely cause | Fix |
|---|---|---|
| The ESPHome add-on is missing | Container or Core install | Use method B |
| “Invalid key” on adoption | Key differs from the YAML’s | Copy the exact api_encryption_key value |
| Very long compile | First build, empty cache | Wait: later ones are faster |
| “secret not defined” error | Entry missing from secrets.yaml |
Add the missing line |
| Device never discovered | 5 GHz Wi-Fi, separate VLAN or blocked mDNS | Use 2.4 GHz and the same network as Home Assistant |
Next: pick an ESP32 project and review GPIO wiring basics.
Updated on 30 October 2026. Sources: ESPHome documentation and Home Assistant documentation. Check menu names on your version.
Was this page helpful?
Thank you!
What should we improve?
Torn between two models or stuck on a build? Drop us a line and we will get back to you by email.
Cookies and analytics
We use Google Analytics 4 to understand how the site is used (page views, navigation). It is only switched on if you accept. Declining does not stop you using the site. More: cookie settings and privacy policy (in French).