Earth fault algorithm for recloser controller