Photovoltaics supply a growing share of power to the electric grid worldwide. To mitigate resource intermittency issues, these systems are increasingly being paired with electrochemical energy storage devices, e.g., Li-ion batteries, for which ensuring long and safe operation is critical. However, in this operation framework, secondary Li-ion batteries undergo sporadic usage, which prevents the application of standard diagnostic methods. Here, we propose a diagnostic methodology that uses machine learning algorithms trained directly on data obtained from photovoltaic charging of Li-ion batteries. The training is carried out on synthetic voltage data at various degradation conditions calculated from clear sky model irradiance data. The method is validated using synthetic voltage responses calculated from plane of array irradiance observations for a photovoltaic system located in Maui, HI, USA. We report an average root mean square error of 2.75% obtained for more than 10,000 different degradation paths with 25% or less degradation on the Li-ion cells.