You have changed your sensor/light/… entities and/or their “friendly names” and end up to situation where that old stuff is still there and at “History” view shows their names with “Unknown” status?
You have maybe red from here that “delete home-assistant_v2.db and reboot your HA”. But, then you “loose” all information, including those entities what actually work!
There is “better” way. You just need to terminal connection to that machines /config directory where that home-assistant_v2.db -file is. Hass.io add-on “SSH & Web Terminal” works here fine.
- Open connection terminal/ssh
- Give command ‘cd /config’
- Give command ‘sqlite3 home-assistant_v2.db’
- Give command ‘delete from states where state = ‘unknown’;’
// note that dot (.) before exit command - Give command ‘.exit’
Refresh your “history” view at HA.
At sqlite3, if you give command ‘.fullschema’, you get information what are structures of those schemas in use. From there you can figure out structure of data and you can delete some other data what you don’t need… Like events of sensors what don’t exist anymore.