Now the files are corrected, but I must have corrupted one of the partitions while mounting the sdcard drives, editing the files, saving and unmounting.
Something must have gone wrong (also) on that process.
Those extra lines realy don’t matter (except your own irritation), disabled entities don’t take extra space nor cpu cycles
So next time, don’t bother the obsolete entities just disable/hide them
You can try what I said earlier
Re-install HA (on another SD card preferably)
If you have a backup, use that to restore
if not, shutdown HA and copy config and (hidden) .storage folders from old SD to the new one
Just an update
Managed to find a ~2months old backup on the sdcard.
Got a new sdcard, installed ha, restored the (old) backup and it’s now “all” up and running.
Few things to redo, but better than starting from scratch.
Ahhh, back into having tons of devices and entities to delete manually
I’m not gonna make the same mistake twice (despite the mistake was also on not having a decent backup/restore system in place), but it still gets me to question how come a solution so much developed and feature rich as Home Assistant, don’t have a interface for removing devices/entities. Sounds like I’m missing some hidden gem here, but I have been looking for it and so far found none