Communities who build solar panels and wind farms should benefit from lower energy bills, Labour’s energy minister has said.