Skip to content

Conversation

@tsgoff
Copy link

@tsgoff tsgoff commented Dec 22, 2025

Description

This PR adds a status filter to the ESPHome Dashboard device list, allowing users to filter devices by their online/offline status.

Changes Made

  • Added three filter buttons to the device list: "All", "Online", and "Offline"
  • Filter buttons appear between the search bar and the device grid
  • Filter applies only to configured devices (importable/discovered devices are not affected)
  • Active filter button is visually highlighted with the primary theme color
  • Filter selection persists across page reloads using localStorage

Implementation Details

  • Added StatusFilter type: "all" | "online" | "offline"
  • New _statusFilter state property to track the current filter selection
  • Enhanced _filter() method to check device online status from _onlineStatus
  • Filter state is saved to localStorage as esphome-status-filter
  • On component initialization, the saved filter is restored from localStorage

Use Case

Users with many ESPHome devices can now quickly:

  • View only online devices to check active devices
  • View only offline devices to identify devices that need attention
  • Toggle between views without losing their search query

Testing

  • Built successfully with script/build
  • Filter UI renders correctly above device grid
  • Filter logic correctly shows/hides devices based on online status
  • Filter selection persists after page reload
  • Works alongside existing search functionality

Added status filter functionality for devices list.
[Dashboard] Add online/offline status filter for devices
prettier
@balloob
Copy link
Member

balloob commented Dec 28, 2025

We don't want to introduce a new filter bar right now. We rather have #756 land.

@balloob balloob closed this Dec 28, 2025
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.

2 participants