New York City’s sewage presents a daunting and costly challenge: it creates foul odors and often contaminates waterways.

But the city is now casting its sewage treatment plants and the vast amounts of sludge, methane gas and other byproducts of the wastewater produced by New Yorkers, as an asset — specifically, as potential sources of renewable energy.

For the city’s Department of Environmental Protection, which is to issue its strategy on Wednesday, it is a shift. Until now, the agency has mainly played the role of water utility and environmental steward rather than energy producer.