Need assistant to remove duplicate entities and 'unavailable' entities

I accidentally created SEVERAL duplicate entities while attempting to register my daughter’s android phone Home Assistant companion app. I didn’t realize it was creating a bunch of duplicate entities in Home Assistant since the interface wasn’t displaying correctly on her tiny phone screen.

I tried rebooting HASSIO several times… and then attempted removing the entities using HA’s GUI under Configuration/Entities… however, HA complains that " Only 0 selected entities can be removed. Entities can only be removed when the integration is no longer providing the entities."

Is there a way to do this via the GUI? If not, then I guess I’ll have to carefully remove the duplicates in the below files (after I stop HASSIO).


Lastly, I also have some entities created by the Alexa Media Player addon that are showing as “Unavailable” with a red exclamation mark. I can’t remove those either under Configuration/Entities. Would I have to remove these entities via the above files too… or is there a better way to remove these?

This applies to the regular app as well:

If the above doesn’t work for you then I think to remove those entities you are going to have to remove the entire integration (I call it the "nuclear option’) and then re-add it.

But be aware that you will lose all of your mobile_app entities including other entities for other phones that are connected.

That process started to change a few versions back where they removed the ability for the admin HA user to actually administer their own entities. Not an ideal situation but the decision has already been made and it’s been made clear it won’t be addressed further (I tried…).

The only other thing you might do is just disable the errant entities and then hide disabled entities. It won’t remove them from your system but they also won’t be staring you in the face and be distracting.

Thanks @finity for the tips. I was able to edit the storage files successfully. However, it would have been much easier to do in HA’s GUI. I wonder why they decided to remove the ability to manage entities within the GUI. Removing the entire integration is a bit extreme for me considering I would have to re-register all phone apps for the sake of one… but, at least it’s an option. Disabling/hiding entities doesn’t sound too appealing to me since I would know the duplicates are still there… just hidden.