Automation trigger on # of repeated errors

I tend to check the HA logs tab every day at least once to see if there is any recurring error message that appears 10+ or so times.

It would be interesting to be able to fire an automation that lets me know if there are recurring error messages that have fired X amount of times or more. Typically this would mean an integration broke or it is something that requires the user’s attention if error messages are happening over and over.

E.g. when the Xiaomi Roborock goes to sleep (when it’s not on the charger) I typically see an error message that happened 1000+ times over the course of a day or two. This would be interesting to capture in an automation and bring to my attention.