PORTLAND — A California company has won a contract to provide 620,000 so-called “smart meters” to Central Maine Power customers.

Trilliant Inc. said Thursday that CMP is using a $96 million federal stimulus grant to help pay for the meters. Matching funds from CMP’s parent company, Iberdrola USA, will bring total spending on the smart meters to nearly $200 million.

Smart meters are the front line of plans for an advanced electricity grid because they can communicate with utilities and respond to constantly changing energy prices.

Eventually, the meters will allow flexible rate schedules and lower energy costs by adjusting energy usage during times of peak energy load.