Microgrid system battery defect detection