Dispatching rules for energy storage