Ofgem rules grid investment