Using smart energy storage to increase self-consumption of solar-generated electricity and reduce peak grid load at household and community level