This paper refers to the issue that mainly appears in distribution grids, where renewable energy sources (RES) are widely installed. In such grids, one of the main problems is the coordination of energy production time with demand time, especially if photovoltaic energy sources are present. To face this problem, battery energy storage units (ESU) can be installed. In recent years, more and more attention has been paid to optimizing the use of ESU. This paper contains a simple description of available solutions for the application of ESU as well as an original proposal for selecting the optimal location and control of ESU. The ESU selection method is based on the use of a genetic algorithm and the ESU control method utilizes the fuzzy logic. The combination of the aforementioned methods/algorithms of ESU application is named an integrated algorithm. The performance of the proposed algorithm was validated by multivariate computer simulations with the use of the real low-voltage grid model. The DIgSILENT PowerFactory environment was employed to develop the simulation model of the integrated algorithm. The proposal was utilized to improve the voltage level in the distribution grid and to install the optimal number of ESU. Based on daily load variations for selected load profiles, it was shown that after the ESU application the voltage deviations in the analyzed network were significantly limited. Moreover, the analysis proves that both the location of ESU in the grid and the control of their active and reactive power are important from the point of view of reducing overall costs.