Flash firmware to an ESPHome device
esphome_upload_deviceFlash a compiled firmware build to an ESPHome device over OTA or serial, with confirmation required before overwriting the running firmware.
Instructions
Flash previously compiled firmware to an ESPHome device via the dashboard's /upload WebSocket route.
Requires the device to already be built (esphome_compile_device) and,
for OTA, reachable with a matching OTA password. Without confirm=True
returns a confirmation prompt and performs no I/O (ADR-0004 D5) — this
overwrites the running firmware with no automatic rollback if broken.
Same "ESPHome Device Builder" (esphome/device-builder) spawn wire
protocol as esphome_compile_device, on /upload.
Use when: deploying a compiled build to the device, once confirmed.
Not for: building the firmware — use esphome_compile_device first.
Returns: {"device", "action": "upload", "exit_code", "success", "log_tail", "log_lines"} on completion.
Errors: {"error": "confirmation_required", "message", "action"} when
confirm is false (checked first, before name is resolved);
{"error": "Invalid device name: ..."} for a path-escaping or blocked
(e.g. 'secrets') name; otherwise one of
esphome_dashboard.DashboardError's stable codes —
esphome_unreachable/esphome_auth_required add diagnosis (see
esphome_ping_dashboard); timeout adds log_tail/log_lines/
job_may_still_be_running (always True — do not retry, check
esphome_get_addon_logs); esphome_command_failed adds
dashboard_error_code/details.
Limits: requires confirm=True; blocks up to timeout seconds; no
rollback if the upload succeeds but firmware is broken.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Device name, with or without the '.yaml' suffix, e.g. 'kitchen_sensor'. | |
| port | No | 'OTA' for wireless flash (default) or a serial device path, e.g. '/dev/ttyUSB0', for a wired flash. | OTA |
| confirm | No | Set true to actually flash the device. False (default) performs no action and instead returns a confirmation prompt; `name` is not resolved or touched in that case. | |
| timeout | No | Maximum seconds to wait for the upload to finish, e.g. 240. | |
| log_lines | No | Number of trailing upload-log lines to return, e.g. 200. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||