A geothermal project in Wales that will use water from a former coal mine to heat homes has been awarded GBP 6.5 million (USD 9m/EUR 7.4m) in EU funding.