When Hurricane Irma blew out a transformer on his block in Orlando on the night of September 10, Andy Green–like most of the people on his street, and millions of people throughout Florida–lost power from the grid. But Green, who installed Tesla’s Powerwall home battery storage in early August, kept his lights on.

“We didn’t have full power–we couldn’t have the whole house running–but we cut it down to the bare minimum, like air conditioning, refrigeration, internet, that sort of thing,” says Green. Though power is still out in parts of Orlando, electricity on his block came back from the grid 21 hours later. While it was off, Green’s Powerwall, connected to the solar panels on his roof, kept going. When the clouds parted the next day, the battery started recharging.

Typically, rooftop solar panels send power directly back into the grid. Power customers usually get a discount on their electric bill, but in a disaster, the fact that solar panels keep generating power isn’t useful. The rise of new home battery storage products like the Powerwall is changing that.

The battery can be set up to use excess electricity generated during the day at night, or configured as a backup. Before the storm, Green set the system to fully charge. As soon as the power went out, the battery kicked in. Green’s house is large, at roughly 5,500 square feet, and the number of solar panels installed on his roof isn’t designed to power all of it. But with rationed electricity use and enough sunshine to recharge the system during the day, he believes that he would have continued to have basic power even if a repair hadn’t happened quickly. (The battery can also be used to charge Tesla cars, and if roads are passable in a storm, could be a renewable source of fuel if gas runs out; before the storm, Tesla also pushed out a temporary software update to give drivers in the evacuation area extra capacity to store power in their cars, which otherwise is turned off to increase battery life).

Of course, if a storm is strong enough to tear solar panels off a roof and the battery can’t recharge, this type of system wouldn’t work for long. It’s also expensive: A single Powerwall unit, which can store 14 kilowatt-hours of energy, costs $5,500 plus supporting hardware and installation that can cost up to $2,000. A similar battery from Mercedes-Benz ranges from $5,000 to $13,000 for a 20 kilowatt-hour system including installation. In the U.K., where Ikea now sells both solar panels and batteries, its batteries are also nearly $4,000 at current exchange rates. Beyond cost, if someone rents an apartment or house and can’t install solar panels, it’s not an option.

But the cost is likely to drop, and battery storage and solar power could also be used in community solar projects, where customers don’t have solar panels at their own homes, but invest in or buy power from a nearby microgrid. In Orlando, customers can buy solar energy from a 12-megawatt solar farm built on top of a landfill; while the power is currently sent back to the grid, in the future, it’s possible that it and other community solar farms could use batteries to provide local backup power from multiple locations in emergencies.

“A distributed energy resource–in other words, one that’s in multiple locations on the grid as opposed to just a centralized location–is obviously much more resilient because you don’t have a single point of failure,” says Christopher Burgess, director of projects for the Islands Energy Program at the nonprofit Rocky Mountains Institute, which is working to bring renewable energy to hurricane-prone islands in the Caribbean that currently rely primarily on expensive and polluting diesel generators. In Antigua, which managed to escape severe damage during Irma (unlike nearby Barbuda), the government has been installing microgrids throughout the island for critical infrastructure like hospitals and storm shelters. Those microgrids run partially on solar and battery power.