The system will work during the daytime using solar energy to run the load and charge the batteries with free solar. In case of an outage during the day, there is a unified evolution from the grid to the batteries to provide backup power. During the night-time, the system releases the batteries through peak hours and does not allow charging from the grid when the rates are skyrocketing. Instead, it waits till the sun rises or a low grid rate is available to charge the batteries.