Came across this thread after ending up with over 200,000 device_tracker entities in my HA instance. These are the steps that worked for me go get rid of them:
- Make a backup just in case
- Go to Developer Tools > Actions
- Choose “Recorder: Purge entities”
- Set Domains to remove:
device_tracker - Set Entity globs:
device_tracker.**_**_**_**_**_** - Perform Action