Elon Musk, never a cook to stay out of the kitchen, isn't content with selling you an electric car—he wants to control how you power it too. The Tesla Motors CEO this week announced plans to purchase solar power-provider Solar City. Critics and a dropping stock price say Tesla's push beyond the auto industry, which it's hardly mastered, is a gamble too far. But Tesla is playing the long game.

“The world does not lack for automotive companies," Musk said Tuesday. "The world lacks for sustainable energy companies."

In the two and a half months since introducing the Model 3, Tesla Motors has taken more than 400,000 deposits for the long-awaited $30,000 sedan, due to start production late next year. The rest of the industry is also slowly ramping up its electric offerings, which shouldn't cost any more than a gas-powered car by 2022. That has potential environment benefits, but it won't help much if the aging, fossil-fuel reliant American energy grid can't keep up without piling coal into the furnace.

Last year Musk announced Tesla Energy, a scheme to sell huge batteries for home and industrial energy storage. Now Tesla wants to complete the package by enveloping SolarCity, which bills itself as a complete solution for ditching fossil fuels and running your home on sun power. Musk already owns 22 percent of the company and sits on its board.

It's an enticing vision of clean energy vertical integration: If Tesla and Solar City shareholders approve the deal, a customer could someday walk into one of the bright white stores popping up around the country, buy rooftop solar panels to turn sunlight into electricity, a brand new car to use that electricity, and a 6.4-kWh battery to store anything left over.

“They’re building the model of the energy company of the future,” says Matt Roberts, executive director of the Energy Storage Association, an industry trade group. As electric cars spread, the energy ecosystem must adapt to support them.

One of the obstacles to increasing America's use of renewable energy is that the nation's grid doesn't store energy. It produces just enough to meet consumer demand at any given moment, but solar panels and wind turbines can't spin up whenever someone flicks a light switch the way a coal- or gas-fired power can. So engineers are investigating ways to hold onto the energy they produce for use when needed, from rock-filled trains on hills to giant hydroelectric projects, to Tesla's "Powerwall" batteries.

There's a clear business case here: Musk says he can expand the market for solar panels by offering them to people who are already considering buying an electric car, and vice versa. He didn’t offer figures on how many Tesla customers were interested in strapping solar panels onto their roofs, but said he’d be shocked if they weren’t. In other words, Tesla wants to offer the whole fossil fuel-free frittata. Forget "well to wheels." Tesla's talking generation to acceleration.

A distributed network of batteries in homes could help buffer the energy supply, but so could electric vehicles themselves. In Japan, Nissan is experimenting with using electric Leaf cars to give power back to homes, or to keep lights on in dealerships. Right now in the US there’s not much advantage to volunteering your car or expensive home battery to help out the local grid. But within the next decade, utility companies will start jacking up rates when demand climbs—so the option to power your Xbox from your EV instead of the grid will suddenly be tantalizing. “Things like the Powerwall are an expensive product for a subset of early adopters,” says Roberts, “but they’re laying the foundation for what will come.”

Tesla is far from alone in this view of the future; BMW and Daimler have programs that use old and new electric car batteries as energy storage systems. But Musk has a strong brand and the ability to generate publicity—rather like Apple, which recently created “Apple Energy LLC”. That sub-company plans to sell consumers the excess energy it generates with its solar installations at corporate sites. Combine that with the reports and rumors that Apple's building an electric car, you can imagine another “integrated energy company” motoring into life.