Elon Musk’s bet that he can sell 50,000 versions of the Model 3, the $35,000 version of the Tesla, due out in 2017, still seems like a long shot, given the somewhat limited market for electric cars.

But he might have one more card up his sleeve. The development of solar energy for home use offers an alternative market for his batteries that could be enough to save Tesla from a market collapse.

Musk is unveiling a new home storage unit that will allow homeowners to move their electrical consumption from expensive peak rates to the rock-bottom rates of overnight power. If nothing else, this will create a secondary market for the millions of lithium-ion batteries that Tesla will be cranking out from its $5 billion Gigafactory in Nevada, which is scheduled to be operational in 2017.

Early indications are that the demand for batteries to power the mid-priced roadster might be thinner than anticipated. Musk was counting on big demand from China, and already there are indications that it’s a much tougher market than he realized. As reported here last week, China already has 100 manufacturers turning out 400,000 undersized vehicles a year that can reach 48 miles an hour. They certainly wouldn’t sell in the United States, but for a million Chinese, it’s just what they need to putter around their small villages and cities. China also has 90 million electric scooters on the road and 120 million electric bicycles — an entire electric-vehicle market that doesn’t exist in this country. Making a dent in this market with a $35,000 scaled-down version of a luxury vehicle is not going to be easy, which is why Musk cut his China effort in half only a few weeks ago.

But there’s an out here in the burgeoning market for home electric storage that is taking shape in the United States, particularly in California. The Golden State has established a goal of getting 33 percent of its electricity from renewable resources by 2020, and 50 percent by 2030. Now powering with renewables isn’t just a matter of putting up solar collectors and windmills. You have to store that electricity for a time when it’s needed. Otherwise, most of it is wasted. And that’s where Musk’s plan to power electric vehicles with large complements of relatively small lithium-ion batteries enters in, because such a system also will be ideal for storing electricity in household-sized units.

Without any fanfare, Tesla already has installed such a system in more than 100 homes in California. It also has a deal with Walmart to install it on a commercial scale. “Tesla has been able to install more than 100 projects, really without anyone noticing,” Andrea James, a Dougherty & Co. analyst, told Bloomberg. She also estimated that the home-storage business could add $70 to Tesla’s stock, about one-third of its current value.

The effort already has paid off for Tesla in that it has collected $65 million in state incentives under the advanced storage technology portion of California’s Self-Generation Incentive Program (SGIP), which rewards users for coming up with ways of generating their own power. With household units running anywhere from $2,000 to $10,000, they’re going to need plenty of help from the government.

Tesla is not the only company working on battery storage. Bosch, General Electric and Samsung all have experimental systems going. There are also research projects being conducted at Harvard, MIT and other universities.

In Notrees, Texas, Duke Energy Renewables, with the help of the Department of Energy, has built a project that is using thousands of lead-acid batteries to store the electricity from a large wind farm. The lead-acid batteries are more expensive, however, and require frequent repair. Also, Duke has found that there is not as much of a market for their product as it had anticipated, mainly due to the costs. “There was little interest from customers willing to pay for that,” said Greg Wolf, president of Duke Energy Renewables, according to The New York Times. “That has not evolved as much as some folks, including ourselves, thought.”

But there are other opportunities that could enhance Tesla’s overall business model. One is that when lithium-ion batteries begin to lose their power so that they are no longer capable of driving a car, they still remain strong enough to power a home storage system. That could mean there will be a secondary market for Tesla’s car batteries.

Another dream that has always been in the back of people’s minds is that the electric vehicles themselves could serve as storage for utility power, drawing on cheap nighttime power and then reselling it to utilities during the day. This would involve an elaborate infrastructure, however, and this would mean the cars would not be available for a good part of the day if their stored power was being fed to the grid.

Altogether, however, the storage potential of the batteries means that Tesla will have an alternative means of income in addition to the electric cars. This means the company could diversify enough so that it will not depend entirely on the success of the Model 3. In the long run, this might mean that the company can survive long enough to make the electric vehicle a standard item for the American consumer.