Smart Utilization of Batteries in Grid-Connected PV-Plants