How to get rid of old template entities?

I’m trying to migrate my old template entities to the new format but notice that not only do all the old template entities remain (after restarts, reloads, etc) but they cannot be removed because they don’t have a the unique ID.

So this is to say that this old style:

switch:
  - platform: template
    switches:
      my_switch:
         ...

Sticks around, even though I’m now using an entirely different file and the new template style. How do I get rid of these old templated devices?

You don’t get a pop up box when you click on the entity that says something like “this is an orphan…” with an option to remove the entity?

If not then you may have to edit the .storage files manually to delete them.

If it didn’t have an id all you have to do is delete the yaml config and restart.

If it did have an id you should be able to delete it from the configuration entities list after deleting the yaml and restarting.

Well, that doesn’t work.

I had about 5 template entities created with unique UUIDs in the yaml file (measurements). I removed them from the yaml file, restarted, tried to delete them from the web interface, and I cannot. I had to deactivate them, I don’t know how to properly get rid of them now.

Did you find solution yet?
I’m trying the create a template image entity.
Because documentation on how to create these is hard to understand, and now I also have an bunch of entities which I can seem to remove.
The delete button is greyed out.
I wish these kind of things were more intuitive in HA or at least that the documentation would provide complete(!) yaml examples.

Did your template images have a unique_id?

There is s suggestions link at the bottom of every documentation page, you could ask for clarification or more examples.

@tom_l, initially (way back) it didn’t and I recently added a unique_id (as I think I mentioned.
I didn’t post any code as I consider this to be more of a core issue between UI and yaml configurations.

Delete the yaml.
Restart.
Go to Settings → Devices & Services → Entities and delete the “Restored” entity.