Skip to content

Add Update Online button to update only online devices#868

Draft
mrmees wants to merge 1 commit intoesphome:mainfrom
mrmees:update-online-frontend-only
Draft

Add Update Online button to update only online devices#868
mrmees wants to merge 1 commit intoesphome:mainfrom
mrmees:update-online-frontend-only

Conversation

@mrmees
Copy link
Copy Markdown

@mrmees mrmees commented Feb 2, 2026

Summary

Adds an "Update Online" button that intelligently updates only devices that are:

  • Currently online (responding to ping)
  • Have an update available (deployed version differs from current ESPHome version)

This complements the existing "Update All" button by skipping offline devices and devices already running the current version, reducing failed OTA attempts and wasted compile time.

Features

  • Smart filtering: Fetches device list and online status, filters to updatable online devices
  • Clear feedback: Shows confirmation dialog with counts (X to update, Y already current, Z offline)
  • Sequential processing: Compiles and uploads each device one at a time via OTA
  • Progress tracking: Shows current device, progress bar, and success/failure counts
  • Downloadable logs: Full compile/upload output can be downloaded for troubleshooting
  • Colored console: ANSI color codes rendered for readable output

Implementation

Frontend-only approach - No backend modifications required. Uses existing WebSocket endpoints:

  • GET ./devices - List configured devices with version info
  • GET ./ping - Get online status map
  • WS ./compile - Compile configuration
  • WS ./upload - Upload firmware via OTA

Files changed

File Change
src/components/esphome-header-menu.ts Add button and click handler with device filtering logic
src/update-online/index.ts New - lazy loader for dialog
src/update-online/update-online-dialog.ts New - dialog with compile+upload workflow
package.json Add @material/mwc-linear-progress dependency

Screenshots

(Button appears next to "Update All" in the header menu)

Test plan

  • Click "Update Online" with mix of online/offline devices - verify correct filtering
  • Verify devices already at current version are skipped
  • Verify compile failure stops that device but continues to next
  • Verify OTA upload completes successfully for online devices
  • Test "Download Logs" button captures full output
  • Test "Stop" button aborts current operation
  • Verify narrow screen overflow menu includes the new option

@mrmees mrmees closed this Feb 2, 2026
@mrmees mrmees force-pushed the update-online-frontend-only branch from a3d48ac to 5efa3a8 Compare February 2, 2026 23:18
@mrmees mrmees reopened this Feb 2, 2026
Add button to compile and OTA-upload only online devices that need updates.
Fetches device status and online state, filters to updatable online devices,
then sequentially compiles and uploads each with progress tracking, retry
verification (5 attempts, 10s apart), and cancellable operations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mrmees mrmees force-pushed the update-online-frontend-only branch from 45c4870 to dfcd38d Compare February 10, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant