In July, as a heat wave bore down on the Boston area, warnings landed in the inboxes of National Grid and Eversource electricity customers: Demand was expected to be high, each company warned, and making a small change to conserve energy at home could help avoid outages.

But still, outages happened, from Acton to West Roxbury, Newton to Chelsea, silencing the reassuring whir of air conditioners. Another bout of intense heat is due this week that will test the power grid yet again, raising the question of how the energy system will respond as extreme temperatures become more frequent and intense due to climate change.

The networks of wires and substations that bring electricity to homes and businesses are already stressed as housing density increases, experts say, and many parts of them will likely need upgrading or expanding in a future when demand could double or even triple as the state relies ever more on clean electricity to replace fossil fuel power.

“These outages can occur during the worst possible time, in sizzling temperature conditions, because the substations are not necessarily expanded upon over time to keep pace with pockets of electric demand in various communities,” said Richard Levitan, president of Levitan and Associates, an energy management consulting firm. “A failure for a day or for hours when it’s 100 degrees is potentially devastating.”

On social media during the July heat wave, some of the unlucky and unhappy customers mused the outages were akin to problems in Texas, where the energy grid’s failure to keep up with demand had catastrophic consequences. But the energy grid here, operated by ISO-New England, has not had failures such as in Texas, and had plenty of surplus capacity each day of the heat wave, even as demand rose with increased use of air conditioners.

What happened, instead, were failures in the distribution system — the substations, transformers, and wires that bring electricity from power lines into neighborhoods and homes. These localized networks are affected by the demands of a specific street or area— eased in some places, perhaps, by the presence of solar panels on homes or intensified by the demands of big users such as apartment buildings with air conditioners and fast-chargers for electric vehicles.

The pressure on those local networks is a problem that will only become more urgent, experts said.

“You have to start with the basic infrastructure question: are we building infrastructure fast enough and forward-looking enough to anticipate what our future is going to look like, and is it being built in a way that addresses extreme weather?” said Jeff Dennis, general counsel at Advanced Energy Economy, an industry group, and a former director of the Federal Energy Regulatory Commission’s division of policy development.

At National Grid, Carol Sedewitz, vice president of electric asset management and engineering, said the company’s equipment is designed for the hottest temperatures that Massachusetts has seen in recent years, even 100 degrees. But it is only designed to withstand that heat for short periods and risks failing when cooler weather doesn’t come quickly.

“Your substation equipment depends on that,” she said.

Now that heat waves are often lasting longer, and nighttime temperatures are staying higher than they used to, Sedewitz said, rethinking how certain equipment can be expected to perform is a must, as is redesigning it for more extreme weather, such as heavy precipitation, high winds, drought, and more intense heat waves.

Craig Hallstrom, president of electric operations for Eversource, said outages in his company’s service area during the heat wave were the result of overheating equipment, which caused some joints and cables to fail.

“A lot of the failures were in the underground system, where there isn’t a lot of air flow, and the lines tend to hold their heat,” he said.

As Eversource and National Grid, which are responsible for delivering the lion’s share of electricity in the state, plan for the future, they’re looking at upgrading to transformers that can carry a greater load.

Doubling of demand for electricity does not necessarily mean a need to double the amount of infrastructure, experts said, because newer equipment would likely be able to handle higher demand. But there will need to be some new substations and transformers — and those can come with controversy.

In East Boston, for instance, Eversource is trying to build a new substation, but the choice of location next to a playground alongside the Chelsea Creek has led to strong resistance among community advocates, who fear the regular flooding at that location could spark a fire. They also note that environmental justice communities have historically borne the brunt of industrial infrastructure, and that siting decisions now can either help remedy past harms or make them worse.

As the utilities try to find locations for new substations, they’re also developing a new kind of distribution system.

Right now, for the most part, electricity travels in one direction: from a power source — such as a gas-fired fossil fuel power plant, or, increasingly, from renewables like solar and wind — to a building. But that’s changing.

With the growth of solar energy on rooftops, more businesses and homeowners are generating the power they need. In the future, experts say, such installations will increasingly be able to send excess solar electricity back into the grid, but that requires new advanced metering equipment and new market rules to allow energy to go in both directions.

Developments in battery technology will also affect the shape of the grid and neighborhood networks.

“In the future, most of us will have some level of a large battery at home,” said Dan Dolan, president of the New England Power Generators Association, whether that’s an electric vehicle or something like a Tesla Powerwall, that can store energy generated by solar panels and then use it as backup power. There are even scenarios where the car battery in a new electric vehicle could send power back to the home.

Policy experts, the state Department of Public Utilities, and the utilities are considering how to modernize the grid so that in the near future, customers could be incentivized to charge their vehicles at times of low demand, and then use the battery of their cars to help power their homes during a heat wave, decreasing the strain on local networks.

“Electric cars and buses, along with solar and storage, can even give energy back to the grid when there’s an unexpectedly hot or cold day,” said Melissa Birchard, director of clean energy and grid reform at Acadia Center, a nonprofit advocating for clean energy.

A fully charged Ford F-150 Lightning can provide enough electricity for an entire house for up to 10 days, according to Ford. And last summer, an electric school bus in Beverly was used to provide more than 50 hours of energy back to the electricity grid.

Electric school buses, which are used for just a few hours each day during the school year, and even less during the summer, are just one of the new technologies that offer promise in that regard, said Birchard.

Dennis, of Advanced Energy Economy, said it’s all about rethinking the tools that are available. “You really need to make demand much more flexible, and really make it a grid resource,” he said. “If we’re going to have large fleets of electric vehicles with batteries in them, let’s make those things a grid resource.”

Read the full article in The Boston Globe here.