Energy storage integrated into the grid