I have a script where I'm monitoring consumption, but can get no finer numbers than 1, 2, 3 and 4 for my measurements. When consumption is same or above 2 I set an object to true, and when it is below the object goes to false.
However, this is causing some issues as the consumption temporarily drops below 2 for a few milliseconds, causing my object to drop to false.
Does anyone have a best practice or hysteresis-type solution to this kind of problem?
However, this is causing some issues as the consumption temporarily drops below 2 for a few milliseconds, causing my object to drop to false.
Does anyone have a best practice or hysteresis-type solution to this kind of problem?