The savings, representing a discount of about 22 percent, have already begun. A new three-year contract went into effect Sept. 29, and consumers are automatically enrolled. Anyone can opt out at any time, however.

“It would be crazy to opt out,” City Manager Kevin Murphy said Tuesday at a City Council meeting where the program was announced.

Energy bills won’t be going down — in fact, they’ll be rising along with the bills of anyone else connected to the electric grid this winter, as rates are expected to rise dramatically. But bills won’t be nearly as high as they would be otherwise without the program, said Philip Ferreira, the manager of the city’s Housing and Energy Department.

About 31,000 residential customers and 4,200 commercial and industrial properties are included in the city’s energy aggregation plan to use purchasing power to secure better rates. Hampshire Power, an arm of the Hampshire Council of Governments in western Massachusetts, was the lowest bidder of those seeking a contract with the city.

Energy used by the city under the contract will also use only renewable power sources, such as solar, wind or hydroelectric.

Already, 39 Massachusetts communities, mostly in the western and central parts of the state, are part of Hampshire Power’s group-purchasing program for electricity.

The upcoming electric rate for Lowell customers starting in November is 10.8 cents per kilowatt hour, compared to 16.27 for National Grid, Ferreira said. The current rates are 7.8 for the city and 8.2 for National Grid, he said.

“This is going to be something that proves to be beneficial for us for years to come,” City Councilor Bill Martin said of the new program on Tuesday.

National Grid said last month the average ratepayer will pay 37 percent more on their bills this winter. Comparison savings versus National Grid are available only for the next six months because National Grid sets its rates in six-month intervals, Ferreira said.

“This represents a significant savings for the people of Lowell,” Ferreira said.

A few residents have in fact opted out of the aggregation program, some believing the government shouldn’t be involved in their power supply choice. “Despite the savings,” Ferreira said.

Lowell first began looking into energy aggregation in 2012, when that November the City Council approved seeking bids for rates lower than National Grid’s. The city began its first energy aggregation program, under a six-month contract, in May. That program, with Dominion Retail, saved residents 8 percent to 10 percent.

Communities that belong to the Northern Middlesex Council of Governments, which includes Lowell and eight surrounding towns, are also looking into their own shared energy purchasing program for even greater savings, Ferreira said. Chelmsford is also considering an aggregation program, with an annual estimated savings of $1.7 million.