Integrating microgeneration into smart energy networks