spook icon indicating copy to clipboard operation
spook copied to clipboard

Add list_orphaned_database_entities service

Open gieljnssns opened this issue 2 months ago • 5 comments

Description

I have added a service to list all entities that are in your database and not in Home-Assistant anymore. ~If you are open to this PR, I will write some documentation for this.~

Motivation and Context

When you disable or delete an entity in HA they do not get removed from your database. So after some time your can free some space in your database

How has this been tested?

I have tested this in the devcontainer. When I disable some entities and then run this service, the disabled entities get returned as a serviceresponse. Then you can use this response to recorder.puge_entities, keep_days: 0 to remove them from your database.

Screenshots (if appropriate):

Scherm­afbeelding 2024-05-07 om 09 36 43 Scherm­afbeelding 2024-05-07 om 09 37 06 Scherm­afbeelding 2024-05-07 om 09 37 21 Scherm­afbeelding 2024-05-07 om 09 37 54 Scherm­afbeelding 2024-05-07 om 09 38 12

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Other

Checklist

  • [x] My code follows the code style of this project.
  • [x] My change requires a change to the documentation.
  • [x] I have updated the documentation accordingly.

gieljnssns avatar May 07 '24 07:05 gieljnssns