Charging while using solar energy