In some embodiments, the controller is configured to maintain an optimized ambient temperature in which the first battery is stored in. The optimized ambient temperature can be determined based on an estimated effort to cool the first battery, an estimated capacity of the first battery relative to storage duration and temperature, and a thermal characteristic of the TEC. The optimized ambient temperature can be determined by minimizing a cost function that includes minimizing the effort required to cool the first battery (e.g., air conditioning, fan, etc.), minimizing effort to replace the first battery due to battery degradation, and maximizing the output of the TEC which is stored as energy in the auxiliary batteries. The cost function can be minimized using regression (e.g., linear regression), to determine the optimized ambient or battery temperature. As such, harvesting of thermal energy using the TEC can be accounted for when optimizing management of the battery systems. The optimization can be adaptive (e.g., changing overtime), as shown in