Summary. The paper addresses the optimal choice of the waiting period (or time out) that a device should respect before entering sleep mode, to optimize a trade-off between power consumption and device availability. The optimal time out is inferred by appropriate statistical modelling of the times between user requests. In our first approach, these times are assumed to be independent, and a constant optimal time out is inferred accordingly. In our second approach, some dependence is introduced through a hidden Markov chain, which also models specific activity states, like business hours or night periods. This model leads to a statistical framework for computing adaptive optimal time-out values. Different strategies are assessed by using real data sets, on the basis of power consumption and device availability from the user's point of view.