How can i delete entity completely by api?

step 1 I config my entity it work perfectly

step 2 i delete my config file and restart it

it still exist in state

step3 i must to go Device&sevice β†’ Entities and select all entities and REMOVE SELECTED
it will delete entity completely right ? (not exist in state)

i want to ask Can i do step3 in api (not UI) ?

another way
i delete entities in core.entity_registry
it not exist entity in the state too.

Then will it be safe with the system?
Should i do like this ?

Look into the Spook integration for programmatically deleting stuff

1 Like


you mean this service right ?

yes.
don’t know how it works though. :slight_smile:

thank you so much
i create automation trigger home assistant start and call this service
it work perfectly