Distributed energy storage in power grid