The article introduces a method for optimizing energy storage system scheduling in industrial microgrids. It employs a PSO-based heuristic algorithm using daily generation and load forecasts. The objective is economic optimization, minimizing energy costs, and maximizing profits. Market energy prices and distributor tariffs are the base of the objective function. An algorithm maintains the plan by controlling storage power based on real-time microgrid measurements, aligning with the intended power exchange curve. Due to PSO’s ability to perform multidimensional optimization, it is possible to find the global optimum of the objective function. To validate the practical applicability of this approach, it is exemplified through its implementation within a real-world industrial microgrid setting. The presented results indicate the method’s effectiveness but also show its weaknesses. For the two considered cases, a decrease in operating costs of 6.7% and 10.8% was achieved, respectively. On the other hand, the best results are obtained for shorter forecasts, which is why the algorithm, despite long planning periods, revises the ESS operation plan whenever there are significant deviations between the forecast and the actual power.