To.optimize electrity you Can charge your battery from the Solar panels ,and use the energy for your house, but reverse way you Can charge your battery from the grid AT some point were the elelectricity IS low Price and use it later for your house when electricity IS expensive