Energy storage grid connection detection concept