I Would Consider Restoring a backup to Recover. That Would be Easier than Fishing thru the automations.yaml file for Problems.
Also Make Sure you are not in SAFE MODE due to a Booting issue. That Would also make Things run ODD.
There Are TIPS & TRICKS in This Post That Might Yelp With Searching, Booting Problems, & Other Things. Check it Out.