Grid-connected energy storage principle