Over-the-Air (OTA) updates let you flash new firmware to your ESPHome devices across your local network — no USB cable required after the first flash. ESPHome ships with a flexible OTA system built around platforms: each platform is an independent update channel with its own transport and security model. This guide covers the most common OTA scenarios and how to recover when things go wrong.Documentation 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.
How OTA Works in ESPHome
When you runesphome run or click Install in the dashboard, ESPHome compiles your YAML into a firmware binary and transfers it to the device over the network using the OTA protocol you have configured. The device verifies the upload, writes it to the inactive flash partition, and reboots into the new firmware.
Since ESPHome 2024.6.0, OTA is a platform component — you select one or more transport mechanisms under the ota: key.
Basic OTA Configuration
Theesphome platform is the default OTA transport used by the dashboard and CLI:
Adding an OTA Password
Protect your OTA endpoint so only authorised users can push firmware:secrets.yaml file:
Uploading Firmware
# Compile, then upload over OTA automatically
esphome run my-device.yaml
# Or as two separate steps:
esphome compile my-device.yaml
esphome upload my-device.yaml
Click your device card in the ESPHome Device Builder, then click Install → Wirelessly. The dashboard handles compilation and upload automatically.
OTA Automations
You can attach automations to OTA lifecycle events to provide visual or audible feedback:OTA updates block the main application loop while running. Avoid automation actions that require the loop to run (e.g., display updates driven by
loop()). Keep on_progress actions short and fast — slow actions can cause the OTA transfer to time out.Safe Mode
Safe mode is ESPHome’s built-in recovery mechanism. If the device fails to boot successfully a configurable number of times in a row, it automatically enters safe mode — a minimal firmware environment with only logging, networking, and OTA active. This gives you a window to push a fixed firmware without physically touching the device. Safe mode is automatically enabled when you include theota: component. You can customise its behaviour:
HTTP OTA — Pull Updates from a URL
Thehttp_request OTA platform lets your device fetch its own firmware update from a remote web server. This is useful for fleet management, staged rollouts, or offline-first deployments where you host firmware on a local server.
url and verifies its integrity against the MD5 hash at md5_url before writing to flash.
Web Server OTA
Theweb_server platform exposes an upload endpoint through the device’s built-in HTTP server, letting you flash from a browser or from the CLI with --ota-platform web_server:
Troubleshooting OTA Failures
OTA upload times out or connection is refused
OTA upload times out or connection is refused
- Confirm the device is online:
ping <device-hostname>.local - Check that the correct OTA password is configured in both the device YAML and your CLI/dashboard.
- Make sure the device and your computer are on the same network segment. OTA uses mDNS for hostname resolution; it may not work across VLANs or subnets without an mDNS repeater.
- Look at device logs (
esphome logs my-device.yaml) and search forOTAto see what the device reports.
Device crashes immediately after OTA
Device crashes immediately after OTA
If the new firmware crashes on boot, ESPHome’s safe mode will automatically kick in after
num_attempts failures. While in safe mode, the device accepts OTA uploads — push a corrected build.If safe mode is not reachable, you will need to flash via USB.'Wrong password' error even with the correct password
'Wrong password' error even with the correct password
The password in your YAML must exactly match the one compiled into the running firmware. If you changed the password in your YAML since the last upload, the device still expects the old password. Temporarily add the old password to your secrets, upload successfully, then change to the new password and upload again.
OTA succeeds but device still runs old firmware
OTA succeeds but device still runs old firmware
The device may have failed to reboot after a successful upload. Check if the device is reachable and manually reboot it via Home Assistant or
esphome run with a power-cycle fallback.Out-of-memory during OTA on ESP8266
Out-of-memory during OTA on ESP8266
ESP8266 has very limited RAM. Close any open connections to the device (e.g., the log viewer in the dashboard) before starting an OTA upload to free up as much heap as possible.