The energy produced over the lifetime of typical rooftop solar panels more than makes up for the energy it takes to make, mount and then eventually recycle them. But adding a home battery usually lowers those dividends, according to new research from Stanford University.