Tesla survived the throes of the coronavirus pandemic relatively unscathed, chalking up its fourth sequential quarterly profit for the first time on Wednesday.

On the energy front, however, things were much more complicated: Tesla reported its worst-ever quarter for solar installations but huge growth in its battery business. CEO Elon Musk nevertheless predicted the energy business will one day rival its car division in scale.

But today, Tesla’s bottom line is all about electric vehicles, and the temporary halt of activity at Tesla’s Fremont factory due to local health orders didn’t put much of a dent in vehicle production and delivery. Both figures declined 5 percent compared to the same quarter in 2019. In contrast, Q2 vehicle sales at legacy carmakers Ford, GM and Fiat Chrysler declined by a third or more year-over-year.

The costs of factory closures and a $101 million CEO award milestone for Elon Musk didn’t stop Tesla from achieving $418 million in free cash flow, a major improvement over the prior quarter. Cash and cash equivalents grew by $535 million to $8.6 billion during the quarter.

Musk praised his employees for “exceptional execution.” 

“There were so many challenges, too numerous to name, but they got it done,” he said on an investor call Wednesday.

Musk also confirmed that Tesla will build a new Gigafactory in Austin, Texas, five minutes from the airport. The 2,000-acre campus will abut the Colorado River and is “basically going to be an ecological paradise,” he said. The new Texas factory will build the Cybertruck, Semi, Model 3 and Model Y for the Eastern half of North America. Fremont, California will produce the S and X, and make Model 3 and Model Y for the West.

Return of the Tesla solar slump

This was the first quarter entirely affected by the coronavirus response, which threw the rooftop solar industry into turmoil by cutting off in-person sales. Other installers scrambled to shift to digital-first sales strategies, but Tesla had already done so months earlier.

Q2, then, offers a test case of whether Tesla’s pivot to passive, online sales made it better able to deal with stay-at-home orders than its peers. The other publicly traded solar installers have not yet reported Q2 performance, but Tesla delivered its worst-ever quarterly solar figures: just 27 megawatts. That’s a 7 percent decline from Q2 2019, its previous worst quarter for solar.

Musk did not address that weak performance in his remarks to investors, instead highlighting the company’s late-June decision to offer the cheapest solar in the country. “We’re the company to go to,” he said of rooftop solar. “It’s only going to get better later this year.”

But the sales slump indicates Tesla’s online sales model could not withstand a historically tough season for residential solar.

“Every single residential installer in the country is going to have a bad Q2 because of the initial impacts of COVID on the market,” said Austin Perea, senior solar analyst at Wood Mackenzie. “It’s hard to dissaggregate the impacts of COVID from their own individual strategies.”

Tesla’s 23 percent decline in quarter-over-quarter solar installations was not as bad as the expected Q2 decline across the rooftop solar industry, Perea added.

On the vehicle side, Tesla’s sales declined less than major automakers. It’s possible that the same pattern will hold for solar: a less severe drop than Sunrun or Vivint could be claimed as a victory of sorts. But this quarter made clear Q2 2019 was not the bottom for Tesla’s solar operation, which once led the residential market as SolarCity but significantly diminished since Tesla acquired it in 2016.

Tesla currently stands in third place for residential solar installers. But No. 1 installer Sunrun said this month that it will acquire No. 2 installer Vivint Solar, making Tesla the second largest installer by default. That major consolidation in the rooftop solar market went unremarked upon in Tesla’s investor call.

Solar and energy storage revenue currently equate to just 7 percent of automotive revenue. But Musk reiterated his prediction that this won’t always be the case. “Long term, Tesla Energy will be roughly the same size as Tesla Automotive,” he said on Wednesday’s call.

The grid storage business offered more reason for optimism: capacity deployed grew 61 percent from the first quarter, to 419 megawatt-hours. The prepackaged, large format Megapack product turned its first profit that quarter.

‘Difficult to predict’ second half of 2020

Tesla withdrew its financial guidance last quarter in light of upheaval in the global economy. It refrained from setting new guidance now.

“Although we have successfully ramped vehicle production back to prior levels, it remains difficult to predict whether there will be further operational interruptions or how global consumer sentiment will evolve in the second half of 2020,” the earnings report notes.

The company asserted it will still deliver 500,000 vehicles this year regardless. It already has sufficient production capacity installed to reach that, Tesla said. But with 179,387 cars delivered so far, Tesla faces an uphill climb to ship more cars in the second half.

Wall Street maintained its buoyant confidence in Tesla’s share price. It closed at $1,592 before the earnings announcement, and rose to $1,661 after hours.