Skip to content

Conversation

@xvanov
Copy link

@xvanov xvanov commented Nov 26, 2025

Breaking change

N/A - This is a new integration with no breaking changes.

Proposed change

See: https://github.com/orgs/home-assistant/discussions/147

Add new entity_migration integration that scans Home Assistant
configurations to find all references to a given entity. This enables
administrators to understand where an entity is used before removing
or replacing it.

Key components:

  • EntityMigrationScanner: Scans automations, scripts, scenes, groups,
    and Lovelace dashboards for entity references
  • WebSocket API: entity_migration/scan command for frontend integration
  • Services: entity_migration.scan service for automation/script usage
  • Models: ScanResult, Reference, and ConfigType dataclasses

The scanner searches across:

  • automation.yaml and automations/*.yaml
  • scripts.yaml and scripts/*.yaml
  • scenes.yaml
  • groups.yaml
  • Lovelace dashboard configs (.storage/lovelace*)

Architecture follows Home Assistant patterns:

  • Async-first design with proper executor usage for file I/O
  • WebSocket commands require admin permission
  • Proper config entry lifecycle management
  • Comprehensive test coverage (27 tests, 91% coverage)

This is the foundation for a planned migration feature which will add
the capability to replace entity references across all configurations.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

reated-desc+review%3Anone+-status%3Afailure

Summary by CodeRabbit

  • New Features
    • Added Entity Migration (scan service + websocket), Google Air Quality integration (sensors, config flow), and Philips Hue BLE device support (BLE light platform, config flow).
  • Documentation
    • Added UI strings, service descriptions, icons, and quality_scale entries for new integrations.
  • Refactor
    • Template sensor internals reorganized; Esphome entity naming/association behavior updated.
  • Tests
    • Extensive unit, integration, and websocket tests for new features.
  • Chores
    • Brand lists and requirement pins updated; validation/quality checks adjusted.

✏️ Tip: You can customize this high-level summary in your review settings.

  Introduce the first phase of the Entity Migration Tool frontend, which
  allows users to scan any entity and discover all places where it is
  referenced across Home Assistant configurations.

  This commit includes:
  - New config panel at /config/entity-migration with scanner UI
  - WebSocket API integration (entity_migration/scan command)
  - Data layer with TypeScript interfaces for scan results
  - Panel registration in ha-panel-config.ts under devices section
  - English translations for all UI strings

  The scanner identifies references in automations, scripts, scenes,
  dashboards, helpers, template entities, groups, and other config types.
  Results are displayed in collapsible expansion panels organized by
  category.

  This lays the groundwork for Epic 2 (migration execution) and Epic 3
  (location-based entity management) as documented in the implementation
Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @xvanov

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant