Dire predictions of blackouts in California during a fearsome heatwave this month never came to pass, with technology - and a dose of community spirit - helping the creaking grid through its most testing period ever.
The mercury topped 43 Celsius on consecutive days, as a thrumming heat dome parked itself over the western United States.
But the grid never failed, thanks in part to the state's quietly acquired battery fleet.
"Batteries stepped in and... played a critical role" in rebalancing electricity demand, said Weikko Wirta, director of operations at AES Southland, a 400 megawatt installation at Long Beach near Los Angeles.
The huge electricity storage facility, which resembles an enormous server farm, is one of the largest in the state.
Sunny California has abundant solar energy at its disposal, and harnesses a growing amount of the rays that land on its rooftops.
During daylight hours, solar and other renewables provide around 30 to 40% of the state's electricity needs.
But as the sun dips, there can be a shortfall - especially on very hot days when air conditioners are switched on as everyone gets home from work and school.
"When the solar goes away at the end of the day, (batteries) stepped right in to fill that void between four o'clock in the afternoon... and 10 o'clock at night," said Wirta.
Nearly every day of the lengthy heatwave that gripped California, Nevada and Arizona, the grid's operator called on consumers to limit their electricity use.
Automated phone calls rang out urging households to turn up their thermostats, and not to use large appliances - including charging electric vehicles - during peak hours.
'Conserve energy now'
"Conserve energy now to protect public health and safety," read one urgent text message from the California Governor's Office of Emergency Services.
"Extreme heat is straining the state energy grid. Power interruptions may occur unless you take action. Turn off or reduce nonessential power."
That message, sent on the day demand reached its highest, seemed to do the trick.
"Within moments, we saw a significant amount of load reduction," said Elliot Mainzer, president of the California Independent System Operator, the grid operator.
"That significant response from California consumers... allowed us to restore our operating reserves and took us back from the edge."
Fresh in the minds of many Californians was August 2020, when the grid collapsed, leaving 800,000 homes without power over a two-day period.
Critics have blasted energy policy in the Golden State, insisting its increasing reliance on renewables at the expense of reliable, but dirty, fossil fuels puts needless strain on supply.
Climate change-skeptics took particular glee in pointing out that the call to conserve power came just days after California said it would no longer sell gasoline-powered cars from 2035.
"California's threat of rolling blackouts ought to be a warning about how the government force-fed green energy transition is endangering grid reliability," tweeted Kevin McCarthy, a US representative from the state and the lead Republican in the House.
For energy researchers like Eric Fournier at UCLA's Institute of the Environment and Sustainability, this kind of sentiment is a non-starter.
"Dealing with the source of the problem and stopping emitting so many greenhouse gases into the atmosphere is the only rational way to address the problem" of climate change, he said.
"Instead of criticising the renewables, we should be championing the value of battery storage."
And that's what California has been quietly doing, as it works towards a policy of 100% carbon-neutral energy by 2045.
Over the last two years, battery storage capacity has increased tenfold; at the peak of the heatwave, these batteries were able to put 3,300 megawatts into the grid.
"That's more combined power than the state's largest power plant... which is rated at about 2200 megawatts," said Mike Ferry, research director at the UC San Diego Center for Energy Research.
During the last heatwave "batteries that were interconnected to the grid played a barely noticeable role in meeting that peak power."
"This time around, everything has changed, and batteries... played a key role in allowing the state to avoid power outages."
For Fournier, battery solutions are impressive, but not the whole answer; Californians' impressive voluntary cutbacks could once again be the missing piece of the puzzle.
"Paying people to not ask for power for a small number of hours may be a better option," he says.
Independent journalism costs money. Support Times of Malta for the price of a coffee.Support Us