Automatic threshold detection


I’m setting up energy monitor on a plant, and we have different consumers
Most of consumers have 3 states, off/idling/working
On a chart they are easily seen for an eye
Is there any plugin, or something, to get values of threshold based on three or some days of usage?

Best regards, Dmitry