If the sun is not available, the utility grid provides power to the house.
Excess energy can be sent back to the electric utility for credit. When there is no power from the utility grid, power is supplied by the batteries and the solar panel array.