This article discusses the use of machine learning and optimization algorithms to manage energy in renewable microgrids, with a focus on hybrid electric vehicle charging. The proposed approach shows promising results in terms of efficiency and cost reduction.