Enhancement Request: Automatic Removal of Uninstalled Add-ons and Optional Cache Clearing

Subject: Enhancement Request: Automatic Removal of Uninstalled Add-ons and Optional Cache Clearing

Dear Home Assistant Community,

I am writing to propose two enhancements that would improve the user experience and maintainability of Home Assistant.

1. Automatic Removal of Uninstalled Add-on Entities:

Currently, after uninstalling an add-on, its associated entities may remain on the Home Assistant dashboard as disabled. This can clutter the interface and create confusion. To address this, I suggest that Home Assistant automatically remove any entities linked to an uninstalled add-on. This would streamline the process and provide a cleaner user experience.

2. Optional Cache and Cookie Clearing:

Implementing an optional setting to clear caches and cookies within Home Assistant would be beneficial for users facing performance issues or troubleshooting specific problems. By providing users with the ability to manually clear these files, they can potentially resolve various issues without needing to restart the entire system.

Additional Considerations:

  • Confirmation Prompt: To prevent accidental deletions, consider adding a confirmation prompt before uninstalling add-ons.
  • Manual Removal Instructions: Provide clear instructions on how to manually remove entities if needed.

I believe these enhancements would significantly improve the overall user experience and maintainability of Home Assistant. Thank you for considering my suggestions.
Kindest And Warmest Regards,
All the Best
Sincerely,
Pooya Mohammadhossein
my Nick name : Ryan

Hi @pooyair

Is it not the case that removing an add on will leave entities behind because it is also necessary to remove any associated integration?

Removing an integration will remove the entities.

Add-ons don’t install entities. So the first one is nonsense.

Also, one FR per thread, otherwise no one knows what they are voting for.

Yes, they can. e.g. The ‘Google drive backup’ add-on creates 2 sensors.

I stand corrected. Thank you.

Addons can not create entities, only integrations can.
If an addon “creates” that they are just injecting a state in the state machine which is very different from a proper entity.

2 Likes

So, from the doc (Add-on: Home Assistant Google Drive Backup)

Integrates with Home Assistant Notifications, and provides sensors you can trigger off of if something goes wrong.

these are somehow injected ?

The add-on creates a few sensors that show the status of backups that you could trigger automations off of. binary_sensor.backups_stale becomes true when the add-on has trouble backing up or creating backups.

Yes, https://github.com/sabeechen/hassio-google-drive-backup/blob/3d3f94057abe32fac97b7241ae9d8a4ec90efc01/hassio-google-drive-backup/backup/ha/harequests.py#L317
Same as if you use “Set state” in developer tools → states

1 Like

For clarification, a restart will remove these entities after the addon is removed. I.e. they don’t really fit into this feature request. Any “injected” entity is removed on restart.