Energy storage devices and renewable resources, especially rooftop photovoltaic (PV), are vital to the operation of standalone systems. In this study, an energy management strategy (EMS) for battery energy storage systems (BESS), PV, and supercapacitors (SC) is presented. The proposed control strategy is designed to optimize the BESS flow rate, discharge, and charge cycles of the energy system using the Meta-heuristic Jaya algorithm by properly coordinating SC and PV. SC is employed in HESS to fulfill the transient energy mismatches and reduce the transitory high charge/discharge current rate impacts on BESS using EMS. The proposed controller also has the benefit of keeping the battery's SoC within limitations for a long period. To extend the life of BESS, the EMS is aimed at minimizing deep charging and discharging by reducing PV generation, particularly under light load (no-load) situations and when battery and SC's SoC≥SoCmax or charging. Similarly, the optional load shedding is employed when battery and SC's SoC≤SoCmin to avoid deep discharge. The proposed EMS is validated in both simulation environment and hardware-prototype under different perturbations and operating conditions. The charge and discharge rate performance of BESS and SC under different charge and discharge time durations, i.e., 1 s, 2 s, and 3 s, were evaluated in both simulation and hardware, and compared to conventional charge and discharge methods for HESS, whose charge and discharge time durations are nearly 0.3 s to 0.4 s. As a result, battery stress is significantly reduced. Furthermore, the economic analysis of the complete system is carried out. In this, it is observed that standalone PV and HESS systems with the proposed EMS are cost-effective and economical compared with PV and BESS systems when operated for a long horizon beyond 6 years.