Welsh Water's power from sewage at Cardiff works
A £40m investment to produce power from sewage from 300,000 homes is opening at a Cardiff water treatment works.
The new technology at Welsh Water's plant in Tremorfa will produce electricity for onsite use.
It captures gas from wastewater and will cut the company's reliance on the national grid by 45% and produce 75% of the gas it needs at Tremorfa.
Welsh Water said the anaerobic digestion (AD) unit was one of the largest of its kind in Europe.
It is part of a £75m investment by the company in renewable energy sources at its own facilities to reduce its carbon footprint.
Chairman Robert Ayling said: "We have invested heavily for more than a decade in wastewater treatment to bring widespread environmental benefits, including vastly improved water quality in our rivers and on the coastline of Wales.
"However, the downside is that the water industry is very energy-intensive, which has been reflected in our £30m annual bill."
Welsh Water is investing £30m on a similar AD facility at its Afan Wastewater Works in Port Talbot.
Mr Ayling added: "We will focus on energy efficiency and produce our own sustainable energy where we can, thereby reducing our reliance on power from fossil fuels while also cutting costs and helping to keep down customers' bills.
"The Cardiff Wastewater Works is itself a £220m investment in delivering great benefit by improving coastal waters, and the opening of this AD Facility is a leap forward in our strategy to benefit the environment further."
First Minister Carwyn Jones is at the official opening.