Add switching between work and idle modes by means of threshold