Hurricane Matthew is stress-testing a costly new effort by utilities and the U.S. government to make the nation’s electric grid more storm-resistant. Early indications: the investment is paying off.

From 2008 through 2017, the U.S. government and utilities are expected to spend more than $32 billion on smart-grid and storm-hardening technology, according to a federal report. That includes systems designed to resist wind, flying debris and flooding—and allow power providers to identify damage and restore electric service more quickly.

A stimulus package passed by Congress and signed into law by President Barack Obama in 2009 pumped $4.5 billion into electric-system upgrades, supplementing an even larger investment by utilities in cutting-edge gear.

The money helped utilities swap out old-fashioned meters for 65 million digital meters—about a third of the U.S. total—that now are able to ping utility control rooms when lights flicker out so outage locations are instantly known. Other gear automatically isolates problems and reroutes electricity around trouble spots so fewer people lose power.

“What we’re seeing is the powerful convergence of technology and software and analytics” tailored to the energy industry, said Jean-Pascal Tricoire, chairman and chief executive of French-based Schneider Electric , a major supplier of power industry equipment and software.