UPQC (Unified Power Quality Conditioner) is indeed a Versatile power conditioner which could be utilized to adjust for a variety of power supply voltage disturbances, rectify voltage fluctuation, and minimize harmonic load current in accessing the power source. To ensure a continuous power supply. We are making use of UPQC technology in combination with shunt and series AFC (Active filter compensators) to counteract power quality problems resulting from grid harmonics and nonlinear loads. Therefore, the focus of this research is to analyze the UPQC's system performance under swell and sag with the variation of solar irradiation and temperature. To achieve these two distinct cases of PV system like temperature-25 °C, irradiance-700 W/m2, and temperature-45 °C, irradiance-800 W/m2, are considered respectively. The implementation of the FOPI controller purposes to bolster power quality of 3-phase HESS (hybrid energy storage system), which includes an integrated UPQC for outstanding performance. In order to manage harmonics resulting from non-linear loads and reduce grid power quality issues, the UPQC model integrates both shunt and series AFC. In the case of extended voltage interruptions, the integrated UPQC with BESS, wind and PV can effectively resolve power quality concerns. The UPQC shunt compensator efficiently harnesses power from HES (hybrid energy systems), whereas the series compensator acts as a guardian, protecting the load from power quality issues originating in the grid. In order to regulate the voltage of the DC connection at a desired level, the aim of this article is to develop a FOPI controller with isodamping properties. In particular, a novel hybrid algorithm called the Enhanced Seagull with Rooster Update (ES-RU) Algorithm, which combines the ideas of Chicken Swarm Optimization (CSO) and Seagull Optimization algorithm (SOA), optimally tunes the gain of the FOPI controller. For optimal performance, the FOPI controller's gain parameters (Kp, Ki, λ) are finely tuned using an Enhanced Seagull with Rooster Update (ES-RU) Algorithm. As a consequence, the performance of the adopted and extant models is examined during sag and swell conditions with respect to source voltage and load voltage and compared with other conventional models like PI, FF, CS and SG, respectively for both cases like temperature-25 °C, irradiance 700 W/m2, and temperature-45°C, irradiance-800 W/m2, correspondingly. The overshot and total harmonic distortion (THD) of the proposed ES-RU is superior to the existing models like PI, FF, CS and SG.