Application of Real-Time Distribution Grid Monitoring for Grid Forecasting and Control Considering Incomplete Information of Resources Behind-the-Meter

This paper presents a rolling horizon optimal energy management mechanism using real-time grid monitoring data. The proposed mechanism includes novel approaches in terms of real-time data processing, net-load forecasting, and optimal scheduling of battery energy storage systems. The proposed real-time data processing and net-load forecasting techniques use fast training and computationally efficient methods based on grid monitoring data. The data processing and parameter forecasting methods are based on auto-regressive with exogenous variables (ARX). Two sets of features including similar values in previous hours, days, and weeks as well as calendar effects are used for training the forecast model. Furthermore, the impact of additional non-synchronized weather features adopted from meteorology databases on the forecasts’ accuracy is discussed. Finally, a real-time optimal scheduling is proposed to optimize battery energy storage systems (BESS), maximizing the self-consumption at grid and community levels. The application of real-time grid measurement in the proposed algorithm allows handling the impacts of loads and generators behind the meter without having their detailed information. The developed method is being effectively used in a real low voltage distribution grid in Switzerland.

INDEX TERMS Energy storage system, forecasting, low voltage grid, real-time measurement, real-time energy management.

Indices[Sets]:
Description t, τ [N tr , N t ] Time index for ARX training and energy management. j [N lag , N lead  State of charge of s-th BESS at time t.

I. INTRODUCTION
T HE proliferation of Distributed Energy Resources (DERs) at the electricity distribution grids and the local community levels embark on new challenges for grid situation awareness, management of faults, and grid control. Meanwhile, application of grid monitoring devices within distribution grids can provide visibility and evaluate the grid status. The grid state variables such as voltage, current, active/reactive powers, and frequency recorded by grid monitoring devices can be used in various decision-making processes. The clean and validated measurement data allows Distribution System Operators (DSOs) to evaluate the grid status and take real-time optimal decisions ensuring secure, reliable, and efficient grid operation. The important elements for a real-time grid control are computationally efficient data processing, parameters' forecasting and finally determining the optimal control actions.
In order to determine the optimal operating point, it is necessary to forecast the net-load in the presence of DERs. The forecast inaccuracies affect the performance of control mechanism and operating costs. Hence, an accurate shortterm net-load forecasting is required. Different forecasting methods based on statistical, machine learning and artificial intelligence and hybrid techniques are reviewed in [1] and [2]. In [3], the works on short term net-load forecasting is classified by direct and indirect methods. In direct methods, net-load's time series are forecasted considering the factors that affect DERs' and demand's time series. In indirect methods, at first, the time series of DERs and demands are forecasted individually and then, the net-load forecasts are calculated. Note that most of the DERs are installed behind-the-meter and rarely can be directly measured and/or monitored with existing DSO's metering devices. The lack of information about installed production and consumption behind-the-meter implies that an accurate net-load forecasting should be performed using the direct methods. The time series of net-load are impacted by human activities and electricity consumption as well as intermittent nature of DERs' productions. Some works, such as [4], focus on extracting effective attributes lied in human activities. Calendar effects including hour of the day, day of the week, holidays index and season of the year are used in [4] to consider the similarity between timeslots. Regarding the impact of the intermittent nature of DERs production, meteorological parameters such as temperature and solar irradiation are investigated in [5] and [6] as effective attributes for load forecasting. In [4] and [7], an instance-based feature ranking method using the original relief algorithm is proposed for selecting useful features. A hybrid model that combines the support vector machine with an intelligent technique for feature selection and optimizing parameters are introduced in [8]. In [8] the real-time market's price is used as an important input parameter for load forecasting in a restructured environment. Recently, innovative solutions based on artificial intelligence, especially using deep learning, are accustomed to discover non-linear relation between features in the electricity load forecasting. For instance, the estimated capacity of behindthe-meter resources in the grid is used as an important parameter to forecast net-load time series in [9]. Researchers in [10] and [11] used feed-forward neural network and Restricted Boltzmann machines with multiple layers to predict electricity demand. In [12] and [13], convolution neural network and long short-term memory are presented for load forecasting, respectively. In [14], an extended version of deep learning for short-term load forecasting is presented which learns from hidden layers between the residual and outputs. A systematic approach for reviewing models of short-term load forecasting is presented in [15]. An important outcome of the analysis of [15] is that there is no evidence that the performance of complex methods is better than simple ones. Note that the artificial intelligence-based methods suffer from high computation time for training positioning them less suitable for real-time applications.
The reviewed forecasting methods for the load patterns affected by the photovoltaic productions in [10]- [16], identify that solar irradiation, temperature, and sky images are important features. The above-mentioned methods need reliable and secure access to accurate meteorology datasets. Nevertheless, any issue related to access and accuracy of the meteorology databases may affect the performance of forecasting and energy management frameworks. Furthermore, most of the meteorology databases record the data in an hourly time resolution [17], [18]. Therefore, mapping the hourly weather datasets with higher-resolution grid monitoring datasets (usually 10min or 15min) can cause inconsistent time synchronization and un-correlation, thus reducing the accuracy of forecasting.
In addition to the net-load forecasting, state-of-the-art techniques addressing the implementation of energy management mechanisms in the real field faces two important challenges. The first challenge is to deal with bad data. The latest monitoring data may be lost because of communication failure or data may be distorted by external factors. Hence, it is important to have a pre-filtering stage to clean the monitoring data against outliers, duplicates, and missing slots. VOLUME 9, 2022 The second challenge the second challenge corresponds to difference between the scheduling with forecasted data and after the fact data. Although the mentioned difference always exists, but the objective is to minimize its technical impacts. In this regard, a two-layer look-ahead scheduling scheme is presented in [19]. The first layer approximate future cost function considering uncertain parameters through an offline stochastic optimization and the second layer is proposed for updating strategy based on real-time data. In [20], a realtime optimal operation of a microgrid is presented which combines the results of off-line optimization by using perfect knowledge of the net load profile with a sliding-window based sequential optimization.
In [21], an intraday rolling dispatch strategy is proposed for an islanded microgrid including two stage dispatch decisions, day-ahead and real-time adjustments. Based on realtime data, dispatchable DERs are rescheduled in the real-time adjustment stage. To deal with uncertain parameters of renewable resources, load and electricity market prices, Lyapunovbased optimization model for a microgrid's real-time energy management is presented in [22]. From the DSO's standpoint, a comprehensive review on the modeling of active distribution networks focusing on the controllable components and optimization techniques is represented in [23]. An efficient energy management for a small-scale hybrid energy system is presented in [24]. Due to increasing events and outages in active distribution system, real-time resilient operating schemes are discussed in [25], which provides robust schedules for interconnected communities. In [26], a real-time power management system for a microgrid is designed which addresses the flexibility in grid topology.
Reference [27] proposed a Lyapunov optimization-based online distributed algorithmic for active distribution networks to minimize the utility loss and to ensure the security of voltages. The review in [28] aims to present a methodological picture of state-of-the-art advances in this research field. The optimization methods are divided into three major categories: multistage, online, and multi-timescale optimization methods.
In the studied references related to the real-time operation of energy systems [19]- [26], the mathematical model and complete information of components and grid are required. However, in real field applications, specifically in low voltage grids, the number of installed grid monitoring devices are limited, and a full grid visibility is not always available. In addition, the complete information of installed loads and generators behind-the-meter is not always available. Therefore, a practical control mechanism should be able to determine the optimal control actions considering the incomplete information of the grid status and the resources. Moreover, due to the geographically spread-out distribution networks and the costs of monitoring equipment, grid operators don't deploy real-time measuring devices everywhere and they are installed in specific locations according to the operators' needs. Nevertheless, it is necessary to optimally control these networks using the currently installed monitoring devices. Noting that for optimal use of existing control devices and providing accurate forecasts of netload using monitoring devices' data, the impact of control devices' actions on the previously recorded data must be considered.
To the best of the authors' knowledge, a comprehensive mechanism to use real-time grid monitoring data to get accurate forecast and determine optimal control actions has not been addressed in the literature. Furthermore, it is important that the proposed scheme handle incomplete information of installed resources behind-the-meter. The main functions of the real-time control mechanism in coordination with grid measurement devices are: i) data cleaning, ii) forecasting parameters, and iii) optimal scheduling of resources. To sum up, the main contributions of this paper are highlighted as following: • An integrated mechanism is proposed including modules of online data processing, forecasting, and optimal energy management relying on the real-time grid measurement data in low voltage grids. The proposed mechanism is network supervisory software that can be used for grid real-time monitoring and optimal control.
• An online data processing method is proposed to identify the features corresponding to the before and after missing intervals. The identified features provide clean time-series datasets for forecasting and energy management modules.
• The proposed rolling horizon net-load forecasting mechanism perform accurate forecasts without using uncoordinated meteorology features from the meteorology datasets. The proposed real-time forecasting method has high accuracy in predicting load patterns in low voltage grid with high PV penetrations.
• An optimal energy management mechanism maximizing self-consumption and peak shaving at the grid level, simultaneously. It is assumed that the information of resources behind-the-meter is not available.
• Finally, after-the-fact analysis is performed to evaluate the performance of the proposed mechanism which is implemented in a real low voltage distribution grid. The remaining parts of this paper are organized as follows: the structure of proposed online data cleaning, forecasting and energy management are described in Section II. In Section III, missing data imputation, forecasting and real-time scheduling of energy resources are mathematically formulated. In Section IV, the performance of the proposed data processing and forecasting methods with respect to the case with uncoordinated weather data is presented. Furthermore, the proposed mechanism is applied on a distribution feeder in a low voltage grid in Switzerland with large PV productions and two battery energy storage systems. The employed real-time actions are assessed by after-the-fact analysis. Finally, the important outcomes of the work are concluded in Section V.

II. DESCRIPTION OF THE PROPOSED METHODOLOGY
The proposed mechanism for the application of real-time grid monitoring data in energy management at grid and community levels is depicted in Fig. 1. The proposed structure includes online data processing, rolling horizon forecasting, and real-time energy management modules. To provide realtime control set-points for controllable devices, the proposed mechanism requires online access to the grid monitoring data as well as the availability status and set-points of controllable devices. In this regard, an Application Programming Interface 1 (API 1) is used to read the latest grid monitoring data, and API 2 is employed to read status of the controllable devices and write set-points on them. According to Fig.1, the received data through the API 1 is cleaned in the online data processing function by cleaning outliers, removing duplicate samples, and replacing missing slots with proper values. To impute the missing data, autoregressive with exogenous variables method (ARX) using attributes from the before and after the missing slot is employed.
The output of the data processing module is utilized as the clean historic data to predict the net-load profile. Similar to the imputing missing data, ARX method is implemented to calculate the forecasts. The selected features include calendar effects, lagged values corresponding to a similar date, integer indices related to the holiday, day of the week, and hour & minutes of the day. Furthermore, the impacts of adding hourly weather attributes such as temperature, solar irradiance, and humidity are evaluated on the performance of forecasting method.
The performance of the proposed mechanism is tested on a real Low Voltage (LV) distribution network where two battery energy storage systems (BESS) are available as controllable components. The time granularity of grid monitoring data is selected as 10-minutes based on power quality standard EN 50160.
The rolling forecasts and energy management are used for the next 144 samples, i.e.,24 × 6. The objective of the energy management is to maximize self-consumption at grid level and local community. From DSO's point of view, the energy management optimization problem should be formulated to utilize all controllable resources subjected to the technical constraints of transformer, cables, and energy storage systems. Finally, the determined optimal set-points for the next timeslot are sent to the batteries through API 2. In the next section, the mathematical models of the proposed modules are described more in depth.

III. MATHEMATICAL FORMULATION OF THE PROPOSED MODULES A. ONLINE DATA PROCESSING
To achieve optimal control schedule, data preparation strategy is developed to clean, validate, and consolidate the new received data. Any duplicates, outliers, and missing data is detected and cleaned. The outliers are identified using appropriate thresholds calculated as the maximum and minimum values of measured voltages and currents. The outliers within the collected dataset ( o ) are identified by comparing the measured voltages and currents with the corresponding calculated thresholds. Equations (1) and (2) specifies the method of outlier detection. The detected outliers are replaced with NaN values and considered as missing data. Noting that the considered attributes in the training stage may include NaN values. Therefore, all attributes and rows are filtered against NaN values. ARX is an extended version of autoregressive model where particular lagged values of (y t ), noted with (y t−τ j ∈y), leaded values (y t+τ j ∈ŷ) and some exogenous variables (x t,j ∈ x t ) are considered as predictor variables.
The parameters of the used ARX model in (3)-(4), are calculated by the least absolute shrinkage and selection VOLUME 9, 2022 operator method (LASSO). LASSO is introduced in [29] as a regression-based analysis methodology which can be formulated as follow: where α, β, γ and δ are model identification coefficients. The is a predetermined free parameter to specify the degree of regularization.

B. ROLLING HORIZON FORECASTING
In this paper two different models are proposed for prediction of net-load in the next 24 hours, i.e., 144 samples-ahead. The considered exogenous variables are including: • HMI: This index is used to identify the hour and minutes of each timeslot. For instance, if a sample is corresponding to 02:30, the HMI is equal to 230.
• DWI: Day of week index presents integer numbers corresponding to the day of data sample.
• HI: Holiday index is a binary attribute that is 1 if the considered sample is on a public holiday.
• Weather features: Hourly attributes of temperature, humidity, wind speed, and solar irradiance information from [17] are mapped into 10min resolution and used as exogenous variables in the M1. The parameters of forecasting models are identified by implementing LASSO according to (5).

C. OPTIMAL REAL-TIME SCHEDULING
In this section, the mathematical model of the real-time optimal scheduling of battery energy storage systems is presented. At each timeslot, the net-load forecasts and batteries' current states are received from forecasting module and API 2, respectively. The proposed energy management model is developed from the DSO's point of view which maximize self-consumption at the LV grid, and more specifically at the MV/LV transformer. Noting that such objective function inherently increases the self-consumption at the community level. The grid monitoring devices are installed by the DSO and the smart metering data is not used due to privacy issues and unavailability of data at real-time. Therefore, installed resources by end-users, except the batteries, are considered as behind-the-meter resources. The objective function of the proposed real-time model is considered as follow: The square of injected power, given by P sqr t , is employed to increase the importance of maximizing self-consumption at peak hours. The penalty cost in the second term of (6) given by P Pen s,t , corresponds to changing the set points of storage systems from a timeslot to another. This term is included to avoid unnecessary change of the set-points, ensuring efficient operation of power electronic devices in controlling battery energy storage systems. For an efficient solution of the optimization problem, the square of injected power is linearized with a piecewise linearized technique as in (7) Employing quadratic form of the power injection in the objective function increases the usage of local resources at the hours with peak power exchange with the upper grid. This guarantees that the proposed methodology has efficient performance at the peak hours. In the piecewise linearized form, the injected power is separated into a positive and a negative variable (P p t,r , P n t,r ). The positive and negative variables of the injected power and its square values are constrained within the piecewise linear sections and the corresponding minimum and maximum values as shown in (10)- (11). Equations (12)- (13) ensures that the injected power is considered only in one linear section. The method for linearization is illustrated in Fig.2.
Moreover, the technical operation constraints in terms of power balance and secure operation of the batteries can be modelled as follows:  (20) Equation (14) shows the power balance considering the power exchange with upstream grid, power of batteries, and the forecasted net-load. The relation between the battery's power and its state of charge at every timeslot t is presented in (15). The SOC should stay within the maximum and minimum operation limits given by (16). Furthermore, the decision-making variables, i.e. charging and discharging powers of battery, should satisfy the minimum and maximum power limitations of batteries as shown in (17)- (18). To prevent unnecessary changes in the set-points of battery that may reduce their lifetime, a positive penalty cost is added to the objective function. For battery energy storages, (19) and (20) considering the second term of objective function (6) are utilized to make smooth charging and discharging regimes.
According to [30], the problem formulation presented in (6)-(20) minimizes a quadratic convex objective function subject to linear constraints with continues and binary variables and multi-period energy storage modelling. To solve this optimization, the quadratic objective function is linearized with peace-wise linearization technique (7)- (13). The general form of the optimization problem is a mixed integer linear programming (MILP). This problem can efficiently be solved by open-source and commercial solver guaranteeing the optimality gap is less than an a-priori defined threshold (e.g., 10 −6 ).

D. PERFORMANCE EVALUATION AND ANALYSIS OF RESULTS
This section consists of three parts. At the first two parts, the performance of the proposed missing data and forecasting methodologies are studied. In the third part, the proposed real-time energy management method is evaluated in a real LV grid. It is noteworthy that all the functions of Flowchart 1 are developed in Python and the optimization problem is solved by the open-source solver Pulp. By using a core i7 personal computer with 16 GB RAM, the execution time for the real-time data processing, forecasting, optimization and sending set-points to the storages is about 40 seconds.
The performances of the investigated techniques for data cleaning and forecasting are compared using the normalized mean absolute error (nMAE) as given below: where the parameter X nom is assumed to be the nominal capacity of transformer (i.e., 250 kVA) for normalizing the error criteria.

E. DATA PROCESSING
The achievement of missing data imputation technique is studied on four real feeders (Feeder1, Feeder2, Feeder3, and Feeder4) and the results are demonstrated in Fig.3 (a)-(d).
As shown in Fig.3 (a), the load pattern in Feeder1 is partially affected by PV production. In this feeder, the PV production in mid-day hours can produce all local consumption and the surplus power is injected to upstream grid. Feeder2 is a feeder containing only PV productions. Feeder3 and Feeder4 are commercial and residential feeders. To evaluate the performance of the proposed data cleaning module, a random sequence of 100 samples is selected and considered as the missing values. The outputs of the proposed model, i.e. corrected values, are illustrated with solid green lines. Furthermore, Table 1 presents the accuracy of the proposed method. In table I, the nMAE for all samples, as well as its minimum and maximum values are reported. Referring to Table 1, the value of error index for feeders with high penetration of PVs (Feeder1 and Feeder2) are greater than the residential and commercial feeders (Feeder 3 and Feeder4). In Table 1, the large error values corresponding to Feeder 1 are due to different load patterns in the day before and the day after the missing interval which highly affects the proposed missing imputation algorithm.  and the model M2, in addition to the parameters of M1, includes weather-related features. Training length is assumed 3 months and the recorded historic datasets of feeders have 10 minutes time resolution. Regarding M2, historic datasets related to weather features with hourly resolution are adopted from [24]. The proposed real-time forecasting models are validated through an offline 1 month testing interval and their accuracy in terms of 10min-ahead, 20min-ahead, 1hourahead, and 24hour-ahead are reported in Table 2. From the DSO's point of view, accurate forecast of the peak hours improves the efficiency of the energy management modules by better scheduling of controllable components and increasing the use of renewable energy [29]. Thus, the accuracy of the models in predicting the daily peak load are quantified and reported in Table 2. Referring to the results reported in Table 2, it can be concluded that M1 provides better accuracy compared to M2 in terms of peak load, 24-hour ahead and in 10min-ahead. The average of nMAEs for M1 and M2 in the studied feeders are %0.37 and %0.38, respectively. The slightly higher error in M2 is due to the hourly weather features in M2. Hourly features of weather databases besides 10-minute grid monitoring data don't have significant impact on the accuracy. In other words, M1 feeding by near to real-time data can provide accurate forecasts even for feeders that their netload is particularly affected by PV productions. The output of the rolling-horizon forecasting methods on two days for the test feeders are illustrated in Fig.4. As shown in Fig 4-(a)-(h), despite the volatility of PV resources, the forecasting method M1 is capable to forecasts 10min and 24 hours ahead with high accuracies. The energy difference between forecasts and measurements can show the overall performance of the forecasting method. In this regard, energy difference between real (x t ) and forecasted net-load (x t ) is calculated as: The energy difference between real-time forecasts and actual measurement data for the studied feeders are presented in Table 3.

G. REAL-TIME ENERGY MANAGEMENT
In this section, the performance of all proposed methodologies is validated for a real low voltage grid in Switzerland. The real LV grid includes two battery energy storage systems (BESSs) and some PV productions. The PV productions are considered as behind-the-meter resources since they are installed by end-users on their homes' roof. Therefore, from  DSO's point of view, the installed PV capacity and their productions are considered as unknown parameter.
The detailed and the simplified single line diagrams of the grid are illustrated in Fig. 5 (a)-(b), respectively. As shown in Fig. 5-(a), grid monitoring devices are installed on several LV nodes and feeders. The grid monitoring devices provide realtime information of the aggregated loads and productions at different feeders. The real-time and historic data of the loads and PV productions are not available, and they are not used for the control. Many PV arrays are installed by the end-users and the grid operator doesn't have complete and real-time information of the installations. Two batteries are installed and available for the control. Here, DSO's objective is to maximize self-consumption at the LV grid and local community. The characteristics of grid components and parameters of optimization model are presented in Table 4. In this grid, the cables are over-sized, and the buses are close to each other, thus the power flow equation are neglected. To obtain the aim of this study, only recorded data by the monitoring devices in buses 100, 106 and 107 are used to determine the net-load pattern of the system. The grid monitoring devices installed at nodes 106 and 107 are used to exclude the impact of energy storages on the historic net-load data. Therefore, the forecasted net-load can be obtained by: In (23), L 100 , L 106 and L 107 are clean historic datasets recorded by monitoring devices 100, 106 and 107, respectively. According to (23), at each timeslot clean datasets are used to predict the net-load for the next 24 hours ahead (i.e., 144 next samples in 10 minutes resolution). The forecasted net-load is used in the energy management module. The determined optimal control set-points for the next time slot are applied to the controllable devices via API2. In this case, control set-points are the power of batteries, i.e. (P ch s,t+1 − P ds s,t+1 ). The results of the implementation of the proposed control mechanism for a week (2021/09/07 00:00:00 -2021/09/14 23:50:00) are reported. To assess the accuracy of the real-time control mechanism, the results are compared with the optimal values calculated by the actual data, called after-the-fact analysis. In the after-the-fact analysis, it is supposed that the actual net-load for the entire time horizon is available. The real-time forecasts in comparison with the actual measurement is demonstrated in Fig. 6. The accuracy of forecasting method for the different days is presented in Table 5.
The reported results in Table 5 and Fig. 6 shows that the net-load pattern depends on the behind-the-meter PV's variations. Figure 6 shows that the application of updated realtime grid monitoring data without weather-based features has potential to predict the net-load pattern accurately even for the days with high volatility in PVs' generation, e.g. 11-12 September.  Furthermore, it can be concluded that for two consecutive days, the forecast error is less if the PV's output power for the second day follows the same pattern of the first day, e.g. 7-8 September. The accuracy of proposed method (nMAE) in terms of 10-minutes ahead and peak load forecasting are 2.42% and 4.13%, respectively. To sum up, the proposed method has successful performance for both sunny and cloudy days.
The results of the real-time optimal control mechanism for the real LV grid are discussed. The performance of the determined optimal set-points using the real-time control scheme are evaluated with respect to the after-the-fact results, as shown in Fig. 7-(a)-(b). The after-the-fact results are calculated using the actual values of the net-load in the next 24-hours, thus they are considered as the ideal solution in which there is no forecast error. The differences between the charging and discharging regimes of the batteries in the real-time schedule and the after-the-fact analysis are caused by the difference of forecasts for the next 24-hours. The realtime method traces efficiently the after-the-fact scheduling. According to the forecasted net-load (see Fig. 6) and the determined charging/discharging powers of the batteries (see Fig. 7), it is concluded that the batteries are charged when there is surplus PV production, and they are discharged when the net-load is positive.
As explained in Section III.C, the main objective of this study is the maximization of self-consumption from DSO's point of view. To evaluate the impact of proposed real-time control on self-consumption and peak load, the injected powers to the upper grid resulted from the real-time scheduling are compared with: i) the power injection resulted from the after-the-fact scheduling and ii) the exchanged power with upper grid without the batteries. In Fig. 8, the outputs of these two scenarios are illustrated. The realized patterns of injected power to upper grid resulted from the real-time and the after-the-fact schedules show the efficiency of the proposed   control mechanism in terms of reducing positive and negative peaks.
The proposed real-time control with real-time monitoring data has increased the self-consumption by %21.72. Whereas the after-the-fact scheduling without forecasting error increases the self-consumption by %28.32. Therefore, the self-consumption in the real-time control is %6.60 less than the optimal value calculated with the after-the-fact analysis. Moreover, the results show that implementing a quadratic form of the upper grid injected power in the objective function, shaves the peak load.
On 9 th September the actual net-load is affected by high variation of PVs, %25.92 of the positive peak load is supplied by the batteries and %32.01 of PVs generated power is stored in the batteries.

IV. CONCLUSION
In this work, a comprehensive grid forecasting and control mechanism based on the real-time grid monitoring data is presented. The method integrates online data processing, rolling forecasting, and optimal control mechanism. The performance of the proposed modules is evaluated on a real low voltage distribution grid. The presented online data processing module uses technical thresholds to detect outliers within the recorded datasets. The missed data are replaced with appropriate values. The introduced rolling horizon forecasting method can predict the high-resolution net-load for the next 24-hours at every timeslot without the meteorology databases even in feeders with high PV production. The rolling forecasts of net-load accounts for the impact of behind-the-meter resources. Finally, the forecasted net-load is used for the optimal scheduling of battery energy storage systems. The performance of the proposed methodology is evaluated and compared with the results of after-the-fact analysis. Comparing the results show that the real-time methodology leads to near the optimal solution. Also, by testing on two consequent days we figured out that BESSs increase %23.1 usage of local renewable resources and DSO can benefit from peak reduction of %29.1. Comparing results of the after-the-fact with real-time schedule shows that proposed real-time almost followed the global optimal results. Further research can be carried out for developing control algorithms to model more in detail uncertainties of the infrastructure interfacing with the controllable devices, in terms of read/write accuracy and communication delay.