The unintentional islanding is a critical issue in grid-connected solar battery systems in case of grid loss. This interrupts the power supply to the loads. Therefore, in this paper, an uninterrupted photovoltaic (PV)-battery energy storage (BES) system is presented to improve the reliability of the power supply. Besides, this system also furnishes the mitigation of load harmonics current and nonactive power compensation along with peak energy optimization for the PV array. The PV-battery system comprises a battery control by converter and an inverter regulated by an adaptive algorithm. The bidirectional controller regulates the voltage of the DC link capacitor. The moving average filter (MAF) - dual cascaded generalized integrator (DCGI) based adaptive control algorithm is used for utility-interactive operation and a voltage-based control algorithm is used for a standalone mode of operation. MAF-DCGI based phase-locked loop (PLL) is used for synchronization and islanding detection mechanisms. An energy management system is used to manage the power flow between the devices in different modes of operation and smooth connection to the grid satisfying the IEEE 1547-2018 standard.