Besides that, [PERSON] [8] presented the optimal sizing algorithms of grid-connected PV-battery systems for the residential houses to minimize their total annual cost of electricity, including a centralized battery system. In this regard, the coordination of PV units and ESSs needs to be analyzed to determine their optimal sizes, gather their potential economic benefits, and guarantee an efficient transition to SG systems. Therefore, an economic problem that considers the Total Cost of Ownership (TCO), which aims at minimizing all the direct and indirect costs that are associated with their lifetime, should be solved [16]. Nevertheless, technical aspects, such as voltage stability, should also be considered, as they play a prominent role in power quality [17]. Moreover, the successful coordination between PV, batteries, and smart grid is unlikely without an integration of proper controllers enabling efficient Battery-to-grid (B2G) and Grid-to-Battery (G2B) operations in the smart grid. Therefore, the goal of the present study is to address the technical and economic challenges that are related to PV-battery integration into the power system. Besides that, batteries can help with the demand-generation balance, and thus need a proper controller to enable B2G and G2B services [18]. Furthermore, controlling the charging and discharging of batteries is required to maintain the voltage level and stability of the power system. In this regard, [PERSON] et al. [19] used a Fuzzy Logic Controller (FLC) to smooth the load profile and obtain an optimum charging strategy when considering the State of Charge (SoC) and the Urgency Level (UL) as inputs, which refers to battery charging urgency, and as output the Preference Factor (PF), which indicates the batteries charging/discharging priority. Moreover, [PERSON] et al. [20] developed a battery capacity fade minimization model by introducing the model predictive control (MPC) framework, which has also been developed in [21], for the identification and realization of optimal charge-discharge cycles for Lithium-ion batteries. The proposed approach can be used to improve the battery life and charge carrying capacity of Li-ion batteries. [PERSON] et al. [21] used an MPC to develop efficient charging protocol for optimal battery charging and to identify an optimal trade-off between the charging time and battery life using information regarding the battery State of Health (SoH) and three performance metrics, namely charging time, capacity losses, and energy losses. [PERSON]. [22] also proposed an optimized fuzzy controller to control the charging and/or discharging power of each Electric Vehicle (EV) battery based on two variables and inputs to the fuzzy controller: battery SoC and grid frequency deviation, while considering the 35-bus system. Additionally, [PERSON] et al. [23] proposed a decentralized smart controller that is intended for a single EV charger, which determines the optimal charging current based on three signals to the fuzzy logic controller: battery SoH, user defined charging current and grid node voltage. However, these studies used smart control techniques to analyze charging/discharging of BESSs in interaction with the grid, but they have not considered both the technical and economic aspects to control the charging/discharging rates of batteries while considering the operation constraint of energy storage units. The on/off-peak electricity prices and the voltage profile are required in order to assess the economic, sustainable, and effective operation of SG systems. Therefore, a proper controller in the function of variable electricity prices, PV generation, energy consumption, on- and off-peak hours, and state of the battery (including SoC) is needed to control the charging/discharging rates of the batteries.