Entity not available - how to rid this

I’ve been building up a (still relatively modest) HA setup on a RPi 4 over about three years and we’re delighted with it; at last a system which caters for the rapidly changing sunrise and sunset times for several months around March and September.

I’ve had a play with various bits and bobs (DIY built light sensors) and suffered a failed Broadlink WiFi socket (still yet to be replaced) but (apart from the ones that have been successful and kept) these all lead to one thing (and now I have three or four of them): “Entity not available”.

My OCD is really being taxed to the limit since (without poking around in the innards of HA and possibly breaking something) I cannot find a way to simply remove them and leave no trace. I realise this is a well-worn topic but I’m struggling to understand why over several years it either hasn’t been addressed, or the implementation of a method to remove them hasn’t been widely advertised!

Short of totally re-installing my system (which might help me with a long-standing Life360 issue as well), or taking a long look in one of the recent full backups, deleting stuff that looks relevant and then installing that and hoping it still works but without the unavailable entities, is there a “proper” method?

Many thanks, Mark B

If you are keen to see a solution to this built in (I know I am) then this:

and this:

might be worth voting…

Surely it’s time this perennial issue was fixed. It doesn’t strike me as too much to ask.

I’m up for a referendum…

Are you talking about entities created by deleted integrations?

Spook has a bulk delete orphaned entities option. If you’re talking about missing entities in dashboards, it will also detect those.

Alternatively, Watchman will detect entities used in your configuration which no longer exist.

So I just need to install Spook?

You could give it a go. It automatically detects missing entities in dashboards, but you have to correct them yourself. Mostly it’s a toolbox of advanced commands that you can use from Developer Tools.

Spook and watchtower both hunt unavailable entities. The you have a list

Spook can help you kill the ones you can’t simply uninstall.

If you uninstall something and it’s still on your dash. Spook and Wartchtower will both start yelling at you. Spook even raises a repair item.

Can you tell me about that so I might be able to help you? Or feel free to create an issue or ask for help in this topic.

Spook has sorted it! Many thanks for all you HA people for helping me, I’m much obliged and my OCD self can settle back ready for the next very unimportant thing to stress about.

Now I’m going to investigate one of the preinstalled all-singing and all-dancing blueprints for better and more convenient lighting control. Any thoughts?

Cheers, Mark B