In energy distribution systems, uncertainty is the major single cause of power outages. In this paper, we consider the usage of electric batteries in order to mitigate it. We describe an intelligent battery able to maximize its own lifetime while guaranteeing to satisfy all the electric demand peaks. The battery exploits a customized steady-state evolution strategy to dynamically adapt its recharge strategy to changing environments. Experimental results on both synthetic and real data demonstrate the efficacy of the proposed solution