Open
Description
I've just discovered my automation_rules_disabled.json containing over 93000 lines.
The entries in it are only removed when the rule got re-enabled.
When the rule got disabled, then subsequently removed, the corresponding entry in automation_rules_disabled.json remains.
Removing the entry when the rule is removed doesn't work, because, for example, when a rule is saved in MainUI, it would remove the rule and re-add it, causing a previously disabled rule to become enabled.
At the moment, the only way to solve this is by adding the removal of non-existent rules in the MainUI's health check, perhaps.