Integration of distributed generation