ESPHome supports updating device firmware wirelessly without a physical USB connection. As of ESPHome 2024.6.0, OTA functionality is organized as a platform component — each update mechanism is a separate platform under theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/esphome/esphome.io/llms.txt
Use this file to discover all available pages before exploring further.
ota: list key. The most common platform is esphome, which implements the native OTA protocol used by the ESPHome dashboard and CLI. Additional platforms include http_request for pull-based URL updates, web_server for browser-based uploads, and zephyr_mcumgr for nRF52 boards. Safe mode (automatic recovery) is automatically enabled alongside OTA and can be found at the Safe Mode section below.
Minimal Example
Configuration Variables (All Platforms)
Triggered when an OTA update starts. Keep the automation fast — OTA blocks the main loop while in progress and long-running actions will cause the update to fail.
Triggered approximately once per second during an update. The variable
x (float, 0–100) contains the current percentage. Suitable for driving a progress indicator on a display.Triggered when the update has completed successfully, just before the device reboots into the new firmware. At this point the OTA process is finished and longer-running actions are safe.
Triggered when the update fails. The variable
x (int) contains the internal error code.Triggered on every OTA state transition. The variable
state is of type OTAState with values: ota::OTA_STARTED, ota::OTA_IN_PROGRESS, ota::OTA_COMPLETED, ota::OTA_ERROR.Available Platforms
esphome Platform (Native OTA)
The default OTA method used by esphome upload, esphome run, and the dashboard. Communicates over the ESPHome native protocol.
Password required to authorize firmware uploads. Strongly recommended for all production devices. Leave empty to disable password protection (not recommended).
http_request Platform (Pull-Based OTA)
Pulls firmware from a remote HTTP/HTTPS URL. Useful for fleet updates without direct network access to devices.
web_server Platform
Enables firmware upload through the device’s built-in web server UI or via esphome upload --ota-platform web_server.
Advanced Example with Progress Feedback
State Change Automation
Multiple OTA Platforms
Safe Mode
Safe mode is automatically enabled when any OTA platform is configured. It provides a recovery mechanism if a bad firmware update prevents the device from functioning correctly. If the device fails to boot successfully within the configuredboot_is_good_after window (default 60 seconds), it reverts to a minimal safe-mode firmware that only exposes OTA, allowing you to push a corrected build.
For full safe mode configuration options, see the Safe Mode Guide.
OTA updates block the main application loop while in progress. Components that only update their output from
loop() (e.g. some display drivers) cannot be used to show OTA progress. Use components with direct hardware write capabilities (GPIO LEDs, display components with immediate rendering) for progress indicators.