sleep2 hysteresis works, goes to sleep, but sleep is flaky.
sleep2 working hysteresis code