How can I cleanup old (deleted) entities (from PowerCalc integration)?

Today, I updated my HA to the latest version.
After it restarted, it said it wa updating the database. I left it to run until the CPU usage was back at idle.

After it completed, some entities (generated by PowerCalc integration) were ‘unavailable’. When looking them up in the developer tab, they had a red mark next to them saying the entity was no longer being provided by the integration.

I tried reloading the PowerCalc integration, which did not solve it.
Then I deleted the PowerCalc integration. The entities got deleted with it (I could not find them anymore in the developer tab). Then I added the PowerCalc integration again. But I notice that if I use the same name for it I used before, there are no entites added after I finish configuring it. When I use a random other name, it does generate new entities. So I guess the old entity names are still stored somewhere in HA.
How can I delete them so I can use the same name again?

Thanks in advance!


After some messing around, I found out that turning off the “Create utility meters” toggle, solves it partially.
When I turn the toggle OFF, 2 entities (power and energy) are added. And they work. The show the current power and consumed energy.
But when I turn the toggle back in, it does NOT add the utility meters and also the power and energy entities break. See pics below:

Turning the toggle back OFF, fixes it again. The red “status error” mark disappears and the 2 entities show the sensor value again.

Also maybe worth mentioning. After deleting the integration (and entities). And setting them up again. The energy entity is not reset. It ‘remembered’ the old value it had. So I think although the entities are deleted, their data still exists in the database. So maybe that’s why it breaks as soon as I turn on the “Create utility meters” toggle?

Settings- dashboards - energy

Scroll to the bottom and you can delete them from there

Do you mean the “individual devices” section?
The ‘energy’ entity was indeed still in that list. But deleting it there unfortunately did not fix it. =(

Yes, that’s what I meant…
I thing you can also do it by editing the file:

But probably won’t help you