it can be done. You need to know the average power used in a home over the year. Then calculate the amount of sun light that falls on the house. If you know the intensity of the sunlight over an area you can calculate the power. But you said that all energy can be traced back to the sun, im assuming through photoelectric cells the power is being stored.