1 Introduction

Homes with some automated facilities are commonly known as “smart homes” from more than 20 years. Recently, smart homes are defined as “Any residential buildings using different communication schemes and optimization algorithms to predict, analyze, optimize, and control its facilities energy consumption patterns according to preset users’ preferences to maximize home economic benefits with preserving predefined conditions of comfortable lifestyle. “[1]. Smart homes usually have installed renewable energy micro plants, such as micro wind turbine or PV modules, beside the utility grid connection.

African people have a severe shortage of reliable inexpensive sources of electricity. More than 35% of people in Africa don’t have a continuous supply of electrical power [2]. Solar powered smart homes as decentralized generating plants are a perfect solution for such persistent challenge. The propagation of smart homes in Africa faces many obstacles. Poverty, absence of internet connection in many areas, and some non-tech savvy African societies limit wide integration of smart homes technologies in some areas of Africa, as discussed in [3, 4]. SHEMSs models are extensively studied to consider many related home features, such as user’s discomfort, Photovoltaic (PV) powered homes and electric vehicles operating cycles [5].

This paper proposes a simple algorithm for real-time PV power prediction. The proposed deterministic index depends on Geographic Information System (GIS) solar radiation data and PV power measurement. GIS data are available without any charges from several meteorological web-based datasets [6, 7]. In addition, PV and consumed power measurements are essential for any SHEMS. After this introductory section, Sect. 2 summarizes previous related studies. Section 3 proposes an algorithm of deterministic short-term PV power prediction index for SHEMSs. A typical case study is discussed in Sect. 4. Finally, in Sect. 5, the main conclusions and contributions of the paper are highlighted.

2 Related works

2.1 Real-time SHEMSs

SHEMSs are usually divided into two processes. Daily/weekly load scheduling is the first stage that optimizes home appliances and sources according to home users’ plans and different available historical data [7]. Secondly, the real-time load rescheduling process operates in a short time frame, ranging from every 15 min to hourly [8]. Uncertainties of smart homes' different power profiles should be considered in this process, which increases the complexity of SHEMSs and the need for a reliable internet connection.

There are three sources of uncertainty, the pricing tariff, loads, and renewable source power. SHEMSs complexity is significantly varying according to the electrical tariff. Developed countries usually have varying electrical prices or tariff rates during the day, which are known as time of use tariffs or real-time pricing [9]. These pricing schemes change during the day according to the variable total grid load profile. The prediction of real-time varying tariff needs complicated artificial intelligence-based optimization techniques [11], such as model predictive control [11], deep reinforcement learning [12], stochastics modeling [13] and robust approach [14].

On the other hand, many developing countries use Inclining Block Rate tariff (IBR) for electrical power pricing for residential buildings [15]. IBR classifies consumed energy during the month into different categories. Each category has its own fixed rate tariff regardless of the daily load power behavior. The electrical pricing category can be easily predicted through accumulated consumed energy during the month. Load uncertainty can be predicted from unscheduled changes in the measured consumed power behavior due to the simple nature of such communities’ home appliances. Therefore, this study will concern only PV power uncertainty.

2.2 PV uncertainty

PV uncertainty studies concern improving the accuracy of predicting PV power behavior to apply the prospective power data in many offline and real-time analyses. They can be classified into long-term and short-term according to the applied timeframe. Long-term uncertainty is studied for offline power system planning analysis with a timeframe ranging from a day to years. Long-term PV uncertainty analysis is usually a probabilistic model for PV power according to time-consuming simulation techniques, such as Monte Carlo simulation [16]. It always considers the most probable daily, monthly, or annual prediction [17]. Different probability destiny functions (PDF) are proposed to predict PV such as parametric [18], and non-parametric [19]. Long-term uncertainty uses historical measured data for several past years.

Real-time control or scheduling studies need fast prediction based on measurements, known as short-term uncertainty analysis. Like long-term uncertainty, many researchers apply historical data to learning based artificial intelligence techniques. Learning-based techniques adapt the expected PV power output according to several measurements and highly complicated trained models.

Various artificial neural network (ANN) models are proposed to improve the accuracy of PV power forecasting [20]. In addition, several ANN weather-dependent models are trained and tested to express all the expected daily variations in PV power for the same system [22]. Several pre-processing of weather data [23], features classification [24], or key parameters [25] are needed to develop a proper ANN that copes accurately with PV power behavior. PV power fluctuates rapidly during rainy or cloudy weather, especially in cold countries that are featured by high and variable wind speeds. Therefore, many hybrid models based on ANN are proposed, such as the genetically optimized ANN model [26], adaptive neuro-wavelet model [27], and combined time series analysis and ANN model [28].

Moreover, many studies propose complicated deep learning models [29] to cover more weather scenarios’ PV power behavior. Model predictive control techniques are usually suggested for smart home energy management systems to take into consideration many factors in the training process, such as tariff, temperature, …etc. [31]. Mis-training of such techniques may lead to unacceptable high error levels that range between 15 to 40%, as discussed in [30].

The accuracy of PV power prediction is related to the sophisticated training process, which is unsuitable for introducing smart homes to simple societies. Moreover, such complicated algorithms need expensive high-tech controllers with many sensors and measurements, which increase the cost significantly that can’t be afforded by many areas in developing countries. Internet-based services also are suggested to solve the uncertainty problem in smart homes energy management studies. In [32], an aggregated model for all smart home components is proposed to deal with all uncertainties in loads, tariff, and PV power by the famous branch and bound technique with the help of a cloud service provider. The cloud service provider connects updated users’ preferences, power market conditions, and metrological data as a cloud component. Smart home appliances are modeled and controlled via the service provider through a high-speed internet connection. In this method, homeowners should understand and accept sharing their preferences and all home details with the service provider, which is not common in all communities such as conservative developing societies. Table 1 summarizes some uncertainty studies' features.

Table 1 Previous studies main features

As shown in Table 1, normalized Root Means Square Error (nRMSE) to the capacity of PV plant is applied for most of the uncertainty studies to express its accuracy level. The error is increased significantly in winter for a short duration due to clouds and rain effects. This effect is neutralized as the study time frame increases. Many factors are affecting on PV-generated power, such as solar radiation, ambient temperature, shading, …etc. While the global plane irradiance GPI is the main factor that is concerned in short-term PV uncertainty studies in such real-time applications [36]. Air temperatures have a minor effect on PV power uncertainty, as discussed in [37]. Satellite images are applied to predict PV-generated power for about two decades [38]. PV power varies mostly according to global solar irradiance, which is affected badly by clouds as discussed in [39]. Therefore, many researchers are mainly concerned with cloud cover in PV uncertainty studies.

Cloud and fog effects on PV power are less predictable for long-term planning studies. Therefore, a simple clearness index is applied to include the average cloud cover annually. The clearness index (CI) is a factor that ranges from 0 to 1 for total cloudy or totally clear scenarios, respectively. This factor is multiplied by the expected clear sky PV power to include the effect of power reduction according to clouds. CI differs geographically according to the common weather and average cloudiness cover, as discussed in [40].

Inspired by the long-term clearness index, another clustered cloud cover index is applied to the energy management scheme. The real-time weather is classified into seven different categories, i.e. rainy, snowy, overcast, overcast to cloudy, cloudy, cloudy to clear, and clear. Each category has its own factor that describes the weather effect which is varied geographically [41]. This simple discrete classification cannot express all expected variances in the weather. In this study, a simple cheap non-internet-based adaptive clearness index is proposed that fits developing countries' characteristics with a high degree of privacy.

2.3 GIS-based solar models

GIS-based solar irradiance models are computer-based systems that use geographic data and information to predict and map the amount of solar irradiance that an area receives. These models consider factors such as topography, land use, and weather patterns to calculate the amount of solar energy that is available in a particular location. The information generated by these models is used for a variety of purposes, including the design, and planning of solar energy systems, the assessment of potential solar energy resources, and the monitoring of solar energy production.

PVGIS (Photovoltaic Geographic Information System) is a widely used GIS-based solar irradiance model developed by the European Union's Joint Research Centre. The model uses a combination of satellite data and ground-based measurements to estimate the solar irradiance that a particular location receives daily.

One of the ways PVGIS improves the accuracy of its daily models is by using high-resolution satellite imagery to map the terrain and land cover of an area. This allows the model to consider factors such as topography, vegetation, and urban development that can affect the amount of solar irradiance that a location receives. Additionally, PVGIS uses data from weather stations and other ground-based measurements to estimate the amount of solar irradiance that is blocked by clouds, atmospheric aerosols, and other factors that can affect the amount of solar energy that reaches the surface. In general, PVGIS is a reliable and accurate tool for estimating solar irradiance, and it is widely used by researchers, engineers, and policymakers for a variety of applications related to solar energy [42]. In this research, PVGIS3 provides daily solar-irradiation databases as an average equivalent day for each month for both clear and cloudy skies.

3 The proposed method

Theoretically, most developing countries are in the high-potential PV global radiation belt. Practically, tropical forests area is excluded due to their high density of trees, as discussed in [43]. irradiance usually follows the same pattern daily due to the sun's regular motion from sunrise to sunset if the cloudiness level is constant. PVGIS applies different statistical analyses on GIS images and real measurements for several past years to define an equivalent average day for each month in cloudy and clear sky scenarios. Both scenarios collectively give a good indication of the expected PV power instead of the famous PDF methods.

3.1 Solar radiation behavior

In real-time, the clouds' motion is controlled by the wind speed that varies irregularly, which reduces PV generated power and distorted the regular pattern of clear sky pattern by different cloudiness levels. A location at Cairo, Egypt, a developing African country, is studied with latitude/longitude equal to 30.0330, 31.5620. Figures 1&2 show both average clear/cloudy solar radiation day [7] and real measurement of two days in each summer (June) and winter (December) of 2020 [6], respectively.

Fig. 1
figure 1

Global solar irradiation in June (Cairo site)

As shown in Fig. 1, the real measurements of solar radiation follow the same patterns of clear/cloudy sky-equivalent days due to a steady level of cloudiness. Therefore, the measured solar radiation profile can be predicted as a ratio of the average response of both clear and cloudy sky equivalent profiles. Figure 2 clarifies the significant effect of rapid cloud motion in winter. On the 31st of December 2020, solar radiation has an unusual pattern of solar radiation, i.e., black line curve. The 1st of December has a normal pattern of radiation due to the absence of variable cloudiness levels.

Fig. 2
figure 2

Global solar irradiation in December (Cairo site)

As shown in Fig. 1, the real measurements of solar radiation follow the same patterns of clear/cloudy sky equivalent days due to steady level of cloudiness in summer. Therefore, measured solar radiation profile can be predicted as a ratio of the average response of both clear and cloudy sky equivalent profile. Figure 2 clarifies the significant effect of rapid clouds motion in winter. In 31st of December 2020 solar radiation have an unusual pattern of solar radiation, i.e. black line curve. While 1st of December has a normal pattern of radiation due to absence of variable cloudiness levels.

3.2 PV model

PV power is modeled by a simple independent temperature formula in many studies of energy management systems to facilitate the coordination between different models of the studied control scheme, such as [34, 44,45,46]. Therefore, the PV measured power will be formulated mathematically, as follows:

$${P}_{m}= \eta .{A}_{s}. {Rad}_{m }$$
(1)

where, Pm: is the measured PV power(W),\(\eta\):is the PV modules efficiency, AS: is the total PV surface area(m2), and Radm: is the instantaneous global irradiance value (W/m2).

3.3 The proposed algorithm

Instantaneous incidents of global radiation can be calculated easily from the previous famous linear relationship between PV power and GPI. The proposed index supposes that the cloudiness level is stable, i.e. constant, for each of two consecutive time intervals. Therefore, the prospective PV can be predicted mathematically as a factor of the average between clear and cloudy values at the period daily. This factor depends on the cloudiness level that varies during the day and can be estimated from measured PV power. The cloudiness factor is adapted from the latest measured PV values for each interval. The proposed index can be expressed mathematically, as follows:

$${Solar }_{ave }=\frac{Cloudy+Clear}{2}$$
(2)
$${Rad}_{ratio}=\frac{{Rad}_{m}}{{Solar}_{ave}}$$
(3)
$${Rad}_{predict}\left(i\right)= {Rad}_{ratio}\left(i\right). {Solar}_{ave}\left(i+1\right)$$
(4)

where, Solarave: is the average solar radiation data between cloudy and clear daily equivalent(W/m2), Radm: is the extracted radiation measurement from physical PV power measurement (W/m2), Radratio: is the adapted factor of cloudiness level, Radpredicted: is the predicted solar radiation for the next interval(W/m2), and i,i + 1: two consecutive time intervals.

A simple algorithm is proposed to define the clouds’ effect on PV power according to GIS based monthly average solar radiation of cloudy/clear sky day and PV power meter measurements. From PV real-time measurement, solar radiation can be calculated by a proper PV model. A ratio between clear/cloudy sky day and the recent measurements continuously to predict next interval solar radiation and PV power more accurately than weekly/daily historical data with 15 min timeframe. The algorithm is applied within sunrise (tmin) to sunset (tmax) modeled GIS monthly time range, as shown in Fig. 3.

Fig. 3
figure 3

Prediction of solar radiation flow chart

4 Results and discussion

4.1 PV prediction error

By applying the algorithm of Fig. 3 on pre-mentioned June and December measured data, solar radiation can be predicted in real time with time frame of 15 min as shown in Figs. 4 and 5.

Fig. 4
figure 4

Predicted and measured solar radiation: a- 1st June, b-30th June

Fig. 5
figure 5

Predicted and measured solar radiation: a- 1st Dec., b-31st Dec

As shown in Figs. 4&5, the predicted solar radiation has a perfect matching with the real measured. Although the unusual pattern of the 31st of December studied data, the proposed algorithm follows the measured data effectively with a little delay. Many uncertainty studies consider normalized root mean square error based on system capacity nRMSE to verify the accuracy of predicted PV power, which is calculated related mathematically, as follows:

$$nRMSE=\sqrt{\frac{1}{P}\sum_{1}^{P}(\frac{{\theta }_{i}^{Pre}-{\theta }_{i}^{act}}{c}{)}^{2}} \%$$
(5)

where, P: is the number of total time intervals,\({\theta }_{i}^{Pre},{\theta }_{i}^{act}\): are the predict and actual values respectively, and C: PV system capacity.

Root mean square percentage error (RMSPE) is another more restricted error indicator compared to nRMS one, which is applied for uncertainty studies from more than twenty years [47]. RMSPE expresses the error as a percentage of the actual data, which indicates more accurately the deviation of predicted values from actual ones. RMSPE is calculated mathematically, as follows:

$$RMSPE=\sqrt{\frac{1}{P}\sum_{1}^{P}(\frac{{\theta }_{i}^{Pre}-{\theta }_{i}^{act}}{{\theta }_{i}^{act}}{)}^{2}} \%$$
(6)

where, P: is the number of total time intervals, \({\theta }_{i}^{Pre},{\theta }_{i}^{act}\): are the predict and actual values respectively.

Both error indicators are applied to the predicted power results. Table 2 shows the relative error in predicted PV power and energy for the studied days.

Table 2 Predicted power and energy root mean square errors

As shown in Table 2, RMSPE is always higher than nRMSE, as RMSPE is related to lower actual values compared to the capacity one, which reflects properly the deviation in real-time energy management decisions. RMSPE is relatively high in power-predicted values due to the shifted action by 15 min of measurement time intervals. While RMSE error is reduced for predicted energy values due to the negligible effect of prediction delay on the total curve area.

Real-time SHEMSs predict the prospective accumulated PV energy to coordinate this energy between two processes, i.e., storing the energy in the home battery or selling it to the grid. Therefore, error of the predicted PV energy has the main attention for any management schemes. Figure 6 shows RMSPE for daily PV energy during 2020 in the studied case.

Fig. 6
figure 6

: Daily PV energy RMSPE

As shown in Fig. 6, maximum RMSPE is 8.3%, only one day in February. 25 days only have RMSPE more than 3%, i.e. 93.16% of the studied days errors are less than three percent. The mean RMSPE is only 1.44%. Although the simplicity of the proposed index, it has a high degree of accuracy according to the studied case.

4.2 Real-time SHEMs errors

In [48], a three-timeframes SHEMS was proposed to suit developing countries' IBR tariff, as shown in Fig. 7. The suggested management scheme mainly reduced air conditioners consumed energy by defining adapted comfort zones according to home occupants. It also coordinated home battery charge/discharge processes to maximize the economic benefits and extend the battery lifetime. [48] discussed only weekly/daily load scheduling based on the well-known Mixed Integer Linear Programing MILP technique. The proposed index is examined based on MatLab language program inserted in Simulink/MatLab model.

Fig. 7
figure 7

A three-time frames SHEMS based on IBR Tariff [48]

A home with a total area of 200 m2 is studied with A 8 kW rooftop PV/30kWh, 220 V battery system that covers an area of 192 m2 and the average efficiency equals 30% [49]. The battery charging cycle is constrained to extend the battery lifetime [50]. The proposed adaptive clearness index is validated by applying it to pre-described SHEMS with the same case study in an hourly timeframe. The rescheduling process in SHEMSs has a timeframe ranging from 15 min to an hour. Hourly load rescheduling is more common for SHEMS because of the limited variance speed in total home loads [9].

Both measured and predicted data are studied individually to define the difference in both daily sold and bought energy. Table 3 summarizes the studied total daily energy behavior and their related errors.

Table 3 Daily behavior summary

As shown in Table 3, the proposed algorithm predicts an accurate behavior of both daily bought and sold energy with an error of around only 3%. Therefore, the proposed algorithm can be a simple and cheap alternative to the existing complicated PV uncertainty methods that suit the developing countries’ home requirements.

The proposed algorithm predicts the PV power in a simple and efficient way that suits smart home energy management systems. Most of the existing prediction methods depend on complex artificial intelligence techniques. These techniques are based on learning process by raw historical data of solar radiation during many past years. However, the proposed method applies on monthly models for both clear and cloudy sky scenarios based on GIS data. Solar radiation monthly models provide an accurate estimation of daily PV power that minimizes long and complicated learning process of such artificial intelligence techniques. Also, simplicity of the proposed algorithm suits any controller’s hardware requirements, which facilitate implementing cheap and simple non-internet-based smart home energy management systems.

5 Conclusion

Rooftop PV/battery systems can be an excellent source for simple societies and homes in many developing countries. Smart home energy management systems can be used to optimize energy consumption in a home by using data from various sources, such as weather forecasts, occupancy patterns, and solar energy production. The real-time management phase should consider uncertainty in solar photovoltaic (PV) energy production, such as changes in weather conditions or shading of the PV panels. This allows the system to make more accurate predictions about the amount of energy that will be available, and to adjust consumption accordingly.

A new adaptive clearness index is proposed to estimate PV power for the real-time rescheduling process. Real-time solar radiation data can be predicted by using measured PV power via a smart meter. In the proposed scheme, both average clear and cloudy average days have been processed based on free-of charge GIS models to estimate updated PV power.

Most of the existing short-term prediction methods depend on complex artificial intelligence techniques. These techniques are based on the learning process of raw historical data of solar radiation from many past years. Although artificial intelligence techniques are complex, they can’t cover all expected variances in PV power all over the year by one or two models. However, the proposed method applies to monthly models for both clear and cloudy sky scenarios based on GIS data.

Solar radiation monthly models provide an accurate estimation of daily PV power that minimizes the long and complicated learning process of such artificial intelligence techniques. Also, the simplicity of the proposed algorithm suits any controller’s hardware requirements, which facilitates the implementation of cheap and simple non-internet-based smart home energy management systems.

PV power can be calculated for the following interval by interpolation between clear/cloudy and the calculated solar irradiance. Historical solar irradiation data and interpolated ones are analyzed to define the accuracy of the proposed SHEMS in real-time operation. Under the study conditions, the proposed PV uncertainty assessment provides a cheap simple fast, and non-internet-based solution for predicting PV power in real-time operation. Maximum root means square percentage errors of both predicted PV power and energy are 15.7% and 1.77%, respectively, within four studied days, two days in each summer and winter seasons. The proposed index has a moderate accuracy in power due to the prediction delay of 15 min time intervals. While PV energy prediction has perfectly matched the actual one.

A MILP-based SHEMS has been applied to validate the accuracy of the suggested index in the real operation rescheduling process. The proposed index has a maximum error of about 3% in both sold and bought energy in the studied case within the studied four days. By getting benefits from available GIS based solar insolation data and only PV power measurement the proposed index provides an accurate inexpensive fast and uncomplicated method to estimate PV power in real-time operation of SHEMS that match developing countries’ home characteristics.