Model for a hysteresis block that optionally allows to specify a hold time. During the hold time, the output is not allowed to switch.
When the input u becomes greater than
uHigh, the output y becomes
true and remains true for at least
trueHoldDuration seconds, after which time it is
allowed to switch immediately.
When the input u becomes less than
uLow, the output y becomes
false and remains false for at least
falseHoldDuration seconds, after which time it is
allowed to switch immediately.

This model for example could be used to disable an economizer, and not re-enable it for 10 minutes, and vice versa. Using hysteresis can avoid the distraction from the input noise.