Introduction

In the upcoming years, a substantial growth and concurrent challenges are anticipated in power generation, distribution, and consumption. For maximum power use, it is necessary to smoothly integrate distributed and renewable energy sources with an intelligent energy management system on the demand side. The depletion of fossil fuels worldwide has increased the importance of renewable energy sources in response to customer demand for more reliable and reasonably priced energy. Micro-turbines for biomass, photovoltaic (PV), wind, and other renewable energy sources are widely utilized (Agyemang et al. 2021). Specifically, in cities, residential customers have a strong desire to install modest rooftop photovoltaic (PV) systems. These solar PV systems may run in two different modes: hybrid. While standalone PV systems necessitate substantial storage capacity, grid-connected PV systems are favored for their continuous supply over an extended period. Consequently, the need for hybrid systems, which combine the best aspects of on-grid and grid systems, is growing. Many grid-connected systems, on the other hand, export wasted power back to the grid because to a lack of storage. In developing countries, this poses challenges due to grid instability and frequent outages, making the export of power back to the grid problematic (Krishna Rao et al. 2023).

Motivations and Contribution

In modern grid-connected systems, integrating PV storage is vital. The intermittent nature of renewable energy sources poses challenges for microgrid integration, potentially causing power system oscillations. Accurate renewable energy forecasting is crucial to address this issue. Prioritized scheduling and storage strategies are necessary to align consumer loads with PV energy and grid availability (Bashir et al. 2021). Trustworthy prediction models considering solar irradiation levels and regional weather are essential. The discussed research paper focuses on demand-side management, stressing the significance of precise prediction models for optimizing consumer load scheduling in response to grid and PV energy availability (Shah et al. 2022).

  • The study assesses a range of machine learning techniques to find reliable prediction models, such as ensemble approaches, Particle Swarm Optimization (PSO) based ANN, Support Vector Machines (SVM), ANN based on PSO, and Artificial Neural Networks.

  • Performance metrics such as Mean Absolute Error, Root Mean Square Error and Mean Absolute Percentage Error are used to compare the generated prediction models.

  • The PSO-based SVM model outperforms all other models investigated in previous research, according to simulation data. Notably, hyper parameters are automatically tuned using the PSO optimization algorithm in this case.

  • Using customizable priority options, the hardware experimental setup implements control operations in accordance with a simulated power negotiation situation based on expected power.

  • The easy integration of a secure Internet of Things environment enables load monitoring and subsequent data analysis.

The Intelligent Smart Energy Management Systems architecture proposed in this study addresses demand-side energy management with an emphasis on renewable energy sources (Mohammadi et al. 2021). Users may access energy administration and information in an Internet of things environment, and smart energy management systems plan loads using data from solar sources (Almaiah et al. 2022). For both day-ahead and monthly forecasts, the machine learning technique included into the architecture allows for accurate energy forecasting. Based on the user-specified priorities, ISEMS uses the predicted data to negotiate power and transmit control actions to individual appliances.

"Motivations and Contribution" section of the paper offers a literature review, providing insights into existing research and justifying the study's purpose. In "Literature Review" section, the study outlines its methodologies and proposed approaches. "Methodologies" section presents the research findings, initiating a detailed discussion on their significance and implications. Finally, the last section summarizes key findings, provides concluding remarks, and suggests potential avenues for further research. It also discusses the study's future scope and recommends new research directions.

Literature Review

Solar PV power generation is recognized as a viable global energy source, yet its erratic nature due to factors like solar radiation and weather poses challenges. Effective harnessing and management of these resources are crucial to meet rising energy demands. The integration of IoT in the energy industry facilitates reliable data collection and remote monitoring. With concerns about fossil fuels, independent solar PV generation is expected to play a significant role. Accurate forecasting is essential for planning load operations and ensuring system reliability (Rao et al. 2023). Various techniques, including hybrid models and ensemble methods, are explored for precise PV output forecasts. Demand-side energy management, such as Demand Response events and appliance demand integration, is receiving attention for optimizing energy use patterns while maintaining user satisfaction. Improving energy meter accuracy and metrological performance is also a focus. This paper utilizes sun irradiation data for Berhampur area to optimize prediction models using Particle Swarm Optimization, achieving superior performance (Bashar et al. 2021). It underscores the need for precise renewable energy forecast models to control demand-side appliances effectively. The proposed Smart Energy Management System integrates IoT for dynamic priority assignment, enhancing system efficiency. Opportunities for research in machine learning, big data analytics, and energy cost optimization are highlighted for the continuous evolution of energy system management (Beştepe and Yildirim 2022).

Methodologies

The Intelligent Smart Energy Management System (ISEMS) design, depicted in Fig. 1, is tailored for demand-side energy management with a focus on renewable energy sources. Its key components include a predictive smart energy management system, PV generation and data collection, and an Internet of Things (IoT) ecosystem for user information and energy management (Blasi et al. 2022). Machine learning forms the core technique for anticipating energy levels, both hourly and day-ahead. The Smart Energy Management System (SEMS) utilizes this information to prioritize consumer appliances, negotiate power availability, and implement control actions. In the realm of solar energy generation, machine learning serves as a widely adopted forecasting tool to improve prediction accuracy. This integration of machine learning into the ISEMS architecture enhances demand-side energy management efficiency, addressing the unpredictability of renewable sources (Raghul et al. 2022).

Fig. 1
figure 1

Description of the intelligent energy management system (Rao et al. 2022)

Design of Machine Learning Framework

Regression analysis's main objective is to identify a function that, when applied to a set of input values, accurately approximates the target values. Figure 2 illustrates the typical steps that a regression model goes through: data preparation and collection, model creation, training, and testing (Hamdani et al. 2021).

Fig. 2
figure 2

A description of a primary prediction model (Agyemang et al. 2021)

Collecting and Preparing Data

The first step in creating a prediction model is gathering a pertinent dataset. In this study, solar irradiation level data from the Berhampur area was obtained from the National Renewable Energy website's National Solar Radiation Database. The dataset includes temperature, pressure, wind speed, and global horizontal irradiance data points for regression modeling. To handle missing data, a plan is implemented to replace any gaps with the average data from the same day. Additionally, as part of the preparation process, the data are normalized.

Creating Theprediction Model

During this stage, the designer adjusts the model's initial variables, maximum depth, and coefficients to create an accurate model. Through thorough analysis, the most precise forecast model is identified among others (Ahmadi et al. 2020). In this study, Support Vector Machine regressors based on Particle Swarm Optimization emerged as the most accurate among the five models investigated. As a result, for the forecasting approach of the Intelligent Smart Energy Management Systems (ISEMS), the PSO-based SVM repressors are chosen (Lekvan et al. 2021).

Analyzing the Energy Management System Prediction Model

Artificial Neural Network

In traditional solar irradiation forecasting methods, an artificial neural network (ANN) serves as the foundation. This model operates by utilizing historical data containing various input attributes such as temperature, wind speed, day of the week, and month. The dataset is split, with 25% allocated to a testing set and the remaining 75% to a training set. Finding the optimal values involves analyzing different combinations of ANN parameters, including the number of neurons and hidden layers. The model chosen for prediction after several trials is the one with the lowest error.

ANN-Based Particle Swam Optimization Technique

The process of determining the most effective parameters involves conducting a thorough investigation of various input parameter combinations. Initially, a fixed number of hidden layers (n) and two acceleration factors (c1 and c2) are chosen to find the ideal PSO (Particle Swarm Optimization) particle size, aiming to minimize inaccuracy (Peña et al. 2022). Multiple combinations of variable particle sizes are examined to identify the configuration with the least amount of error. Once the ideal particle size is determined, it is used to calculate the optimal values for acceleration factors (c1 and c2), keeping the hidden layer size (n) constant. Subsequently, a third analysis is conducted to ascertain the ideal number of hidden layers (Piatek et al. 2021). Throughout this study, various combinations are explored to maximize the overall performance of the model, considering a fixed, optimal particle size and previously obtained acceleration factor values (c1 and c2) (Fig. 3).

Fig. 3
figure 3

ANN flowchart based on PSO (Demirezen et al. 2020)

Support Vector Regression

Support Vector Regression (SVR) employs a distinct optimization approach, aiming to reduce training error while balancing the trade-off between hyper planes compared to neural networks, logistic regression, or linear regression. The meta-parameter Gamma is pivotal as it defines the Gaussian kernel function, assessing the similarity between different attributes and assigning weights to optimization functions corresponding to these features (Pong et al. 2021). Additionally, the regularization parameter C performs subsequent tasks. Initially, the SVR model's hyper parameters are set randomly and derived from the data pattern. The model's accuracy heavily relies on the values assigned to these parameters. For the SVR model, an initial setting of Gamma = 1.25 and C = 1 is utilized. The subsequent section discusses the optimization algorithm employed to fine-tune these parameters.

Support Vector Regression Based on PSO

The prediction accuracy of the SVR model relies on determining the optimal values for the C and Gamma parameters. Particle Swarm Optimization (PSO) offers an efficient method for maximizing these SVR parameters. PSO-SVR systematically evaluates the prediction error of the SVR model in each iteration to find the lowest error across the solution space. Subsequently, it identifies the best values for the SVR parameters under study (Pawar and Vittal 2019). The flowchart in Fig. 4 depict the operation of the PSO-SVR model. Initially, random values are assigned to the SVR model's hyper parameters. The dataset is then split into training and testing sets using random indexing. The SVR technique is applied iteratively in accordance with the requirements of PSO. At each iteration, the model's performance is evaluated, aiming to minimize error through PSO's iterative direction selection process (Ahmad et al. 2022). The PSO identifies the best solution as the set of hyper parameters corresponding to the lowest error value. Once determined, the model employs the best hyper parameter configuration to forecast using the testing data (Zhang et al. 2022).

Fig. 4
figure 4

PSO based SVR flowchart (Bashar et al. 2021)

Ensemble Methods

In data analytics, feature selection is vital, and Decision Tree methods offer a notable advantage by implicitly fitting the dataset with feature selection. Unlike certain regression models that require proportional scaling among parameters, Decision Trees require minimal effort for data preparation. Moreover, they demonstrate remarkable performance in handling nonlinear relationships between parameters without necessitating linear assumptions. In this study, basic learners are chosen through iterative trials based on trial and error. This approach achieves higher accuracy rates while utilizing less computing power. Compared to other standard techniques, the ensemble of decision trees outperforms them (Demirezen et al. 2020).

Prediction Performance Evaluation Metrics

Performance evaluation is crucial for determining if a trained model is suitable for real-world applications. In this study, three key performance criteria are thoroughly examined to gauge the accuracy of the model:

  • Mean Absolute Percentage Error (MAPE)

  • Mean Absolute Error (MAE)

  • Root Mean Square Error (RMSE)

These performance metrics collectively provide a comprehensive assessment of the model's efficacy, offering insights into its accuracy and dependability for real-world applications (Mazhar et al. 2022).

The Mean Absolute Error

The forecast error, which indicates the disparity between actual and predicted data values, is computed using Mean Absolute Errors (MAEs). This statistic measures the average absolute differences between each expected value and its corresponding actual value. Utilizing MAEs offers a clear indicator of the overall forecasting performance, providing insights into the accuracy and precision of the forecasting model (Khan et al. 2022).

$$MAE = \frac{1}{N}\mathop \sum \limits_{i = 1}^N \left| {\overrightarrow {\text{P i}} - Pi} \right|$$
(1)

The Mean Absolute Percentage Error

A statistical indicator called Mean Absolute Percentage Error or Mean Absolute Percentage Deviation is used to assess the accuracy of forecasting techniques, particularly with regard to trend prediction. MAPE is often stated as a percentage and may be calculated using the following formula (Raza et al. 2020):

$$MAPE = \frac{1}{N}\mathop \sum \limits_{i = 1}^N 100\frac{{\left| {\overrightarrow {{\text{Pi}}} - Pi} \right|}}{Pn}$$
(2)

The number of test points in this instance is N, the nominal power is Pn, the actual value at the ith hour is Pi, and the predicted value is Pˆi.

The Mean Absolute Percentage Error (MAPE) offers two distinct advantages in forecasting evaluation. First, by using absolute values, it prevents the cancellation of positive and negative errors. This ensures that the measure accurately reflects the magnitude of the errors, without any offsetting effects (Rao et al. 2021a).

Second, MAPE is advantageous because the size of the dependent variable does not affect relative errors. This characteristic enables meaningful comparisons of forecast accuracy across datasets with different scales (Shajin and Rajesh 2020).

In prioritizing MAPE underscores its ability to provide a reliable and scale-independent assessment of forecasting accuracy, thereby contributing to a more robust evaluation of the model's performance.

Root Mean Square Error

Root Mean Square Deviation, commonly referred to as Root Mean Square Error (RMSE), is a metric used to compare the predicted values of an estimator or model with the actual observed values. It considers both the size and direction of each individual error when calculating the mean error magnitude (Lilis et al. 2017). The RMSE is calculated using the formula below

$$RMSE = \sqrt {{\frac{1}{N}\mathop \sum \limits_{i = 1}^N \frac{{\left| {\overrightarrow {{\text{Pi}}} - Pi} \right|2}}{Pn}}}$$
(3)

For the produced models, several trials and combinations are used to carry out detailed analysis.

Analysis of the ISEMS Experimental Design

This section presents an overview of the experimental setup of the Intelligent Smart Energy Management System (ISEMS). It delves into the architecture of the smart socket and elucidates the power negotiation algorithms crucial for efficient energy management. Furthermore, it outlines the integration of an Internet of Things (IoT) framework with ISEMS, highlighting its role in enabling remote data monitoring (Rao et al. 2021b). This comprehensive description aims to provide insights into the structure and functionality of the ISEMS experimental setup, covering both hardware and algorithmic components.

The Configuration of the Overall System

The complete Smart Energy Management system, illustrated in Fig. 5, comprises a smart socket module and a SEM unit. The SEM Gateway and the smart socket module serve as the system's core components, controlling connected appliances. Bidirectional communication between the SEM Gateway and the smart socket module is facilitated by XBee modules, configured as a router and coordinator respectively (Rao et al. 2024). The SEM unit, acting as the system's brain, executes power negotiation algorithms and transmits control signals to the smart socket module upon receiving external signals (Huang et al. 2016).

Fig. 5
figure 5

Intelligent energy management system (Alavi et al. 2018)

The subsequent section provides further insights into planned appliance operations based on projected power statistics. Real loads, such as a laptop requiring charging, a fan, and lighting, are incorporated into the lab's experimental system (Rao et al. 2022). Algorithms implemented in the SEM unit dictate the sequence of appliance actions during Demand Response (DR) events, prioritizing predetermined tasks. To schedule appliances in accordance with Time of Usage and remain within the minimum slab rate, the system considers the maximum demand limit. This strategy ensures efficient resource and energy management (Abate et al. 2019).

In the laboratory, actual loads are utilized to emulate real-world conditions in the experimental setup. Load-A represents an incandescent lighting load, capable of adjusting power consumption by toggling the status of individual bulbs. Load-B is depicted by a fan equipped with temperature and humidity sensors, capable of adjusting its speed. This integration demonstrates how user comfort considerations are integrated into the algorithms deployed within the Smart Energy Management System (SEMS). Load-C is exemplified by a charging laptop, chosen deliberately to showcase the scheduling of chargeable loads based on Time of Usage. This deliberate selection underscores the system's ability to optimize device operation according to predetermined time intervals, enhancing energy efficiency (Alavi et al. 2018). Collectively, these loads provide a diverse and comprehensive tested for evaluating SEMS algorithms in a controlled laboratory environment.

Smart Socket Design for ISEMS

The schematic design of the smart socket, depicted in Fig. 6, employs Hall Effect voltage and current transducers to convert single-phase power characteristics (voltage and current) into low-level voltage signals. In the voltage transducer scheme, the input resistance (R1) is chosen to ensure that the measurement resistance (RM) falls within the range of 10 to 350 ohms. Similarly, a measurement resistance (RM) is included in the current transducer circuit to ensure that the output voltage remains below 4.5 V. Signal conditioning circuits, such as a voltage divider circuit used by the power supply module to create a 1.8 V DC offset, further refine these signals. Additionally, a Zener diode with a 4.7 V cut-off voltage is integrated into the signal conditioning circuit to protect the Arduino microcontroller from overvoltage (Hossein Motlagh et al. 2020).

Fig. 6
figure 6

Designing a smart socket for an intelligent energy management system (Asif et al. 2021)

The output signals, conditioned within the 0–4 V range, are received by the Arduino microcontroller's analog pins. Based on instructions received from the microcontroller, the relay module permits the switching ON or OFF of specific appliances (Dave et al. 2020). The XBee Series 2 module, attached to the smart socket and functioning as the SEMS unit (Router), establishes the communication channel. Each load controller can receive control commands transmitted by the SEMS unit via XBee modules. The Arduino in the coordinator module receives commands from various routers and SEMS units through XBee modules (Rao et al. 2020). It collects energy usage information from each router and provides users with an LCD interface to view total energy consumption statistics. The Arduino Ethernet shield may be utilized to upload this energy usage data to the local server (WAMP). Through the integration of sensor, control, and communication components, the smart socket design enables the Smart Energy Management System (SEMS) to effectively manage energy (Rehman et al. 2021).

Predictive Power Datadriven Algorithmic Decision-Making

The SEM hardware includes an algorithm that prioritizes appliances based on user preferences. When generated power is insufficient, this algorithm ensures essential appliances can still operate. It allocates available solar energy efficiently by estimating solar PV output using sun irradiation forecasts. This predictive approach optimizes energy usage, enhancing flexibility and user satisfaction within SEMS (Asif et al. 2021).

Demand Response Involves the Use of a Decisive Algorithm

Algorithm 1 outlines the deployed algorithm as follows.

  • Collect power usage data from each device in a predetermined sequence.

  • Execute a self-diagnostic process if a load controller fails to provide the required data.

  • Arrange collected power usage statistics based on consumer priorities.

  • Examine if any demand limit breaches have occurred by reviewing the information.

  • Check if the apparent power used by appliances exceeds the specified maximum demand limit (Fig. 7).

Fig. 7
figure 7

The decisive algorithm for the demand response (Rao et al. 2021)

figure a

Algorithm 1: An algorithm characterized by decisive decision-making capabilities alongside self-diagnostic functionality (Sarker et al. 2020)

To prevent the demand limit from being exceeded while maximizing the activation of high-priority appliances, the SEM unit sends command signals to turn on the greatest number of such appliances while simultaneously turning off the remaining ones. The algorithm verifies activated appliances for peak load conditions, signaled by both a peak load hours signal from the utility and the apparent power of the appliance exceeding 25% of the highest recorded apparent power consumption for the home in the previous month (Yousafzai et al. 2021). To avoid expensive tariff charges during peak load hours, the SEM unit alerts the load controller of increased power usage, triggering an alarm to the customer. After sending appropriate command signals to each device, the SEM unit waits thirty seconds before initiating the next data sampling cycle (Xiaoyi et al. 2021). During this time, customers can adjust the appliances given priority. The process repeats by following steps 1 through 6. The flowchart for this SEM decisive technique, applicable to 'n' number of loads within a house, is depicted in Fig. 2. It's noted that appliance priorities are initialized with preset values before the procedure begins. The flowchart employs two variables, "i" and "k," where "i" increments based on priority and "k" follows a predefined sequence to collect data on power consumption from all appliances (Yu 2020).

Energy Monitoring System Integrated into an IoT Environment

In a residential complex, energy usage is monitored in real-time using smart meters. The Smart Energy Monitoring System (SEMS) facilitates the smooth flow of power data to a server once an Ethernet shield establishes a connection (Zhang et al. 2018). This data can be accessed and viewed by authorized users through a localhost monitoring system consisting of a server and database management system. The server, powered by the WAMP stack, operates within the local network and hosts multiple databases for storing various power settings (Sarker et al. 2020). The firmware responsible for data transmission uploads power data to the server every five minutes. Access to the online site is restricted to authenticated users. The subsequent section presents results and trend graphs derived from the uploaded power data (Fig. 8).

Fig. 8
figure 8

An overview of the internet of things (Aliyan et al. 2020)

Results and Discussion

This section validates the Intelligent Smart Energy Management System and evaluates its demand-side consumer-focused forecast outcomes. After thorough investigation, the most accurate prediction system is determined among various machine learning models. The experimental setup, as detailed in the preceding section ("Methodologies" section), is implemented; showcasing optimal load scheduling based on assigned priorities and predicted power values across diverse scenarios. Integration of the Internet of Things (IoT) ecosystem enhances data monitoring and analysis capabilities, ensuring a flexible and adaptable approach to energy management with real-time monitoring and analysis.

Analyzing Forecasting Models

This phase conducts an in-depth study of the data using multiple machine learning models to ascertain the most accurate prediction technique. Parameter tuning methods are explored to ensure model accuracy by identifying optimal values. The developed models offer month- and day-wise forecasts, providing detailed insights into performance across various temporal scales. An optimal-performing model is identified through comprehensive error analysis. To enhance the forecasting accuracy and reliability of the Intelligent Smart Energy Management System, a thorough analysis is conducted to improve its predictive capabilities (Fig. 9).

Fig. 9
figure 9

Developing firmware for the IoT infrastructure of an intelligent energy management system (Khan et al. 2022)

Tuning the Parameters of Optimization Methods

Parameter tuning is the practice of experimenting with various combinations to use the optimization technique to find the most effective optimal value. A brief summary of the parameter tweaking processes for several algorithms is provided below.

Parameter Tuning of Support Vector Regression

In a standard SVR algorithm, hyper parameters are conventionally chosen randomly. However, this study employs Particle Swarm Optimization (PSO) as a general optimization algorithm to pinpoint optimal values for SVR parameters. PSO looks for the optimal point methodically over the whole solution space since it is a clever algorithm. By using PSO to intelligently walk through the solution space without having to look at every point; this method drastically cuts down on the amount of time needed to achieve optimal values.

Parameter Tuning of Artificial Neural Network

An artificial neural network has a variable number of neurons in the hidden layer, an independent number of inputs, and a dependent number of outputs. PSO is used to optimize a number of variables, including swarm population size (N), inertia weight (w), and acceleration factors (C1 & C2). The number of neurons (n) in the hidden layer during this waiting period is the ANN parameter. It is common practice to choose the inertia weight at random. There are other ways to choose the number of hidden layers, acceleration factors, and size of the swarm population. The experiment comprises changing the number of hidden layers (n) and the acceleration factors (C1 & C2) while keeping the swarm size constant. Next, using the previously established optimal swarm size and the same hidden layer size (n), the ideal values of the acceleration factors (C1 & C2) are calculated. In order to determine the optimal value, the final analysis looks at several combinations of C1, C2, swarm population size, and hidden layer topologies while accounting for the ideal swarm size and acceleration factor values (C1 & C2).

On a Monthly Basis Seasonal Forecasting with Machine Learning Methodology

Historical data provide yearly insights into the Berhampur region's monthly seasonal forecast, allowing the months to be divided into wet, summer, and winter seasons. The statistics showed that significant rainfall occurred in June, July, August, September, and October, with July being the wettest month. In addition, it was discovered that December was the coldest month and May was the warmest. The simulation studies included five distinct prediction models: ensemble techniques, SVM, PSO-SVM, ANN, and PSO-ANN. In separate tests, the models were trained using the 2021 and 2022 datasets to estimate prediction accuracy, and then they were validated using the 2022 dataset. The prediction models' performance was assessed using a variety of assessment criteria, including MAPE and MAE. Remarkably, in bright conditions, the PSO-based SVM model performed better than other models. The simulation experiments for winter days utilized training data from 2020 and 2021, with testing on December 2022 data, as illustrated in Fig. 10. Although solar irradiation levels were lower than during sunny days, the periodic nature of irradiation contributed to enhance prediction accuracy, with the PSO-based SVM model demonstrating superior performance. Finally, simulation experiments for rainy days involved training data from 2020 and 2021, with testing on July 2022 data, as illustrated in Fig. 11. Rainy days exhibited lower and more erratic solar irradiation levels, leading to a notable increase in error rates. The PSO-based SVM model consistently performed better than the other approaches examined. Concluding the analysis, Fig. 12 showcases the April month prediction for the PSO-based SVM model during the summer season, along with error metrics. The comprehensive experimentation and comparison across seasons highlight the effectiveness of the PSO-based SVM model in accurately predicting solar irradiation levels in the Mangalore region.

Fig. 10
figure 10

Forecasting sunny days in April using various predictive models

Fig. 11
figure 11

Forecasting winter days in December using various predictive models

Fig. 12
figure 12

Predicting rainy days in July using diverse predictive models

Figures 13 and 14, respectively, provide error analysis plots for the winter and summer seasons. Table 1 offers a thorough month-by-month comparison using much assessment measures. The PSO-based SVM model outperforms all other regression models, as seen by Table 1, particularly in terms of mean absolute percentage error. It's interesting to note that the ANN and Ensemble techniques exhibit better accuracy in December and April as well because these are the months when the data is more periodic. However, challenges arise in July, the rainy season, where historical data is characterized by significant randomness, posing difficulties in accurate predictions. Despite these challenges, the PSO-based SVM model demonstrates superior performance across diverse seasonal conditions, affirming its reliability in predicting solar irradiation levels in the Mangalore region.

Fig. 13
figure 13

Forecast for sunny days in April based on PSO SVM model, categorized by month

Fig. 14
figure 14

Predictions for winter days in December, segmented by month, using the PSO SVM model

Table 1 Analysis of errors on a month-wise basis

On a Daily Basis Forecasting Using a Machine Learning Method

A comparison of many machine learning-based repressors for forecasting solar irradiance on a given day is shown in Fig. 15. The graphic shows the time (in hours) and the amount of solar radiation, covering the hours of 7 AM to 5 PM. After being trained on a two-year dataset extracted from the NSRDB database, the models' performance was assessed daily. Remarkably, among all the implemented forecasting regressors, the PSO-based SVM repressor emerges as the top performer, as highlighted in Fig. 15. This underscores the robustness and efficacy of the PSO-based SVM model in accurately predicting solar irradiance levels throughout the course of a day, showcasing its superiority over alternative techniques in this specific context.

Fig. 15
figure 15

PSO SVM model-based forecast for rainy days in July, organized by month

Analysis of ISEMS's Efficiency

This section contains the findings of our experiments from the several situations that we have presented and analyzed. In order to demonstrate the efficacy of the energy management system through user comfort scenarios and cost optimization strategies, we ran trials in which we assigned varying orders of priority to appliances with unique configurations. To assess the performance of the energy management system, different priority configurations were assigned to appliances, reflecting varying levels of importance. Additionally, we explored scenarios related to user comfort, aiming to optimize energy consumption while ensuring a satisfactory user experience. Cost optimization techniques were employed to further demonstrate the efficiency of the energy management system in achieving economical energy consumption patterns.

The results obtained from these experiments provide valuable insights into the system's adaptability to diverse scenarios and its ability to balance user comfort with energy efficiency. The analysis of these results sheds light on the effectiveness and versatility of the energy management system, affirming its potential in real-world applications.

Load Operation Strategy with Specified Priority Using Available Power

The bank of incandescent bulbs in this particular case is called Load A and is given the greatest priority, followed by a fan load that is given a mid-priority. Due to its schedule ability, the battery charging load is assigned a low priority. The load scheduling function of the Smart Energy Management system is shown in Fig. 16. The maximum demand (the input from the utility) is set at 196W in Fig. 16. Due to the fact that the overall power usage stays within the Maximum Demand Limit (MDL), or available power, all three loads are operating from 9.17.45 PM to 9.20.45PM. Two incandescent lamps are turned on at 8:19:44 PM, which raises the overall power usage above the MDL. In response, the SEM controller quickly turns off the battery charging load. Afterwards, at 9:20:45 PM, an additional bulb (three lights on) is turned on, increasing the lighting load's power usage. To keep supply and demand in balance, the controller, however, disables the second load because the lighting load alone uses 185W of the 196W MDL.

Fig. 16
figure 16

Forecasting power levels on a day-to-day basis using various models

Table 2 under case (1) provides a summary of the appliance scheduling by SEM in this instance, along with comprehensive power usage data. Altering the load priority order has an impact on the appliance state after load scheduling, as Table 3 illustrates; this is also noted in the same table under instance (2). These cases exemplify the adaptability of the SEM system in managing diverse load configurations and priorities effectively.

Table 2 Device state of operation behind Load arrangement
Table 3 Device state of operation behind Load arrangement

Establishing User Preferences Using Data Collected

The Smart Energy Management System (SEMS) includes a temperature and humidity sensor (the DT H11 module) to improve user comfort. Figure 17 shows the features of load scheduling dependent on temperature and humidity. The recommended SEMS allows users to freely select the lower and higher threshold criteria for room temperature. The SEMS turns on the fan load controller in accordance with the room temperature when it rises over these set limits. The room temperature in Fig. 17 drops below 22 °C at 08:44:21 PM, causing the controller to turn off the fan load. The controller then triggers the fan load at 08:52:17 PM since the temperature has risen over the upper limit of 25 °C. This integration of temperature and humidity-based load scheduling ensures that the SEMS not only optimizes energy consumption but also prioritizes user comfort by adjusting loads based on environmental conditions. The system's responsiveness to temperature fluctuations exemplifies its capability to provide a personalized and comfortable environment for users (Table 4).

Fig. 17
figure 17

Scheduling loads according to their assigned priorities

Table 4 Device state of operation following Load arrangement

Calculating Accuracy and Measuring Power Consumption of ISEMS Units

One specific power meter that is recognized as the industry standard is used for calibration in our study. Here is the formula used in the calibration process:

$$\left( {{\text{Measured value}} - {\text{offset factor}}} \right)*{\text{k}} = \left( {\text{Value observed in ref power meter}} \right)$$

Here, k stands for the scaling factor. For more than two load scenarios, we have recorded the power levels from both the reference meter and our configuration. With this, we were able to determine the scaling factor and offset factor. In our test module, evaluating correctness entails taking into account the subsequent error situations:

  • Nonlinearity in the ADC

  • The resistors' tolerance when used

  • The precision of the operational amplifiers utilized

  • The precision of the LEMs' transducers

An analog-to-digital converter of the successive approximation type with a precision of 10 bits is included inside the ATMEGA 328 microprocessor. The ATMEGA328 controller's datasheet specs state that the error is ± 1LSB (Least Significant Bit). As a result, it is found that the used converter has an accuracy of ± 0.125%. The following calculations have also been done, assuming that the resistors used in the components have a tolerance of 0.05%. The instantaneous product value of voltage (V) and current (I) is used to calculate power (P).

$${\text{P}} = {\text{V}}*{\text{I}}$$
(4)

The transducer is powered by the power supply unit, which generates ± 12 V from a main supply of 230 V. There might be a 2% measurement error in the power supply module. The voltage divider circuit design uses resistor components with a tolerance of 0.06%. The fact that 0.95 V is thought to represent the internal reference voltage is interesting.

Therefore, the total error might be responsible for 2 + 0.06 × 2 = 2.12% = 0.02014v.

The instantaneous voltage and current values acquired from the transducer output, multiplied by the appropriate scaling factor, may be found using the following equation:

$$V = (0.95 \pm 0.02014) \times \left( {1 + \frac{{R_{fi} }}{R_1 }} \right) - \left( {\frac{R_f i}{{R_1 }}} \right) \times V_{LEM(v)} \times K_{vi}$$

where, kvi is a Voltage scaling factor.

The present measurement is similar to that.

$$I = (0.95 \pm 0.02014) \times \left( {1 + \frac{{R_{fi} }}{R_1 }} \right) - \left( {\frac{{R_{fi} }}{R_1 }} \right) \times V_{LEM(v)} \times K_{ii}$$

The current scaling factor is denoted by kii.

The ADC error percentage is ± 0.124%.

Voltage Accuracy Measurement

According to the manufacturer's datasheet, the LEM LV 25P transducer has a secondary coil current percentage error of 0.95%. The RMS output of the LEM transducer is 1.99 V when it receives an input voltage of 230 V. The following formula may be used to determine the percentage inaccuracy of VLEM (v) while taking into account the tolerances of all resistors used in the circuit:

$$V_{LEM\left( v \right)} = LEM\left( {er} \right) + R_{fi} \left( {er} \right) + R_1 \left( {er} \right) + R_2 \left( {er} \right) + R_3 \left( {er} \right)$$

where, R2 = 100kΩ, R3 = 100Ω.

$${\text{V}}_{{\text{LEM}}\left( {\text{v}} \right)} = 0.{95}\% + 0.0{6}\% + 0.0{6}\% + 0.0{6}\% + 0.0{6}\% = {1}.{19}\% {\text{ of 1}}.{\text{89v}} = 0.0{\text{23681v}}$$

Thus, the equation above may be expressed as,

$$\begin{aligned} V & = (0.95 \pm 0.02014) \times \left( {1 + \frac{{R_{fi} }}{R_1 }} \right) - \left( {\frac{R_f i}{{R_1 }}} \right) \times V_{LEM(v)} \times K_{vi} \\ {\text{V}} & = \left( {1.8 \pm 0.0586} \right) \times {\text{k}}_{\text{v}} \\ \end{aligned}$$

Consequently, the percentage error in the voltage measurement is 0.0586 ± 1.8 =  ± 3.25%. Thus, the overall percentage error in voltage measurement is 3.250 + 0.1250 =  ± 3.375%.

Current Accuracy Measurement: A current transducer, such the LEM LA 25P, can be used to measure the primary current supplied to the load. A load resistor with a resistance of 100Ω encounters a corresponding secondary current (I) of 2 mA when given a transducer with a nominal current of 2A. An RMS output voltage corresponding to 0.2A is obtained in the LEM transducer with this arrangement. Thus, it is possible to calculate the total % inaccuracy in the present transducer in the following way:

$$V_{LEM\left( i \right)} = LEM\left( {er} \right) + R_{fi} \left( {er} \right) + R_1 \left( {er} \right) + R_2 \left( {er} \right) + R_3 \left( {er} \right)$$

Here, R2 = 100000Ω, R3 = 100Ω.

VLEM (i) = 1.06% of 0.2A = 0.02A

$$\begin{aligned} I & = (0.95 \pm 0.02014) \times \left( {1 + \frac{{R_{fi} }}{R_1 }} \right) - \left( {\frac{{R_{fi} }}{R_1 }} \right) \times V_{LEM(v)} \times K_{ii} \\ {\text{I}} & = (1.8 + 0.0407) \times {\text{k}}_{\text{i}} \\ \end{aligned}$$

The current measurement error is determined to be ± 2.260%. When incorporating the ADC error, the total error in current measurement becomes 2.260% + 0.1250%, resulting in a cumulative percentage error of ± 2.3850%. Consequently, the overall percentage error in power measurement is computed as the sum of the errors in current measurement and ADC, which is ± 5.010% (2.6250% + 2.3850%).

Power Consumption Measurement: SEM units, operational 24 h a day throughout the entire year, play a significant role in the overall annual electricity consumption. We looked at the energy use of the load controllers used in the experiment as well as the SEM unit that was on display in order to mitigate this effect. Table 5 provides an estimate of the power usage for these parts.

Table 5 Analysis of power consumption within the ISEMS

Energy Monitoring System with Internet of Things Environment

To utilize the webpage's functionality, users must input their login credentials on the login screen, which is shown in Fig. 18. Upon successful login, users are granted access to the main page, enabling them to explore and make use of the diverse functionalities available.

Fig. 18
figure 18

Scheduling loads based on sensed parameters

Users may choose from a variety of load consumption, watch trend graphs of energy use, obtain power usage statistics, and monitor energy consumption in real time all from the main page. Figure 19 displays load-wise power information, including RMS current, power demand, power factor, energy consumption, and a load's assigned priority, inside the developed Smart Energy Management System (SEMS). The total energy utilized by the selected laboratory will be displayed on a display at the bottom of the page. As seen in Fig. 19, the home page has a facility to display the trend graph illustrating the power consumption of various loads.

Fig. 19
figure 19

Web access interface and power consumption data

Conclusion

The Intelligent Smart Energy Management System (ISEMS) is intended to provide a demand-side energy management platform with a focus on the integration of renewable energy sources. The Smart Energy Management unit’s power negotiation algorithms are developed and tested in a controlled laboratory environment by ISEMS, which also performs tests to demonstrate the efficacy of this algorithms. ISEMS is centered on making the best use of renewable energy sources, especially when there is less available generation. This optimization is made possible by precise solar irradiation forecasts made both one month and one day in advance. The system successfully lowers the utilization of low-priority, or non-critical, appliances by doing this. Experiments conducted in real time show that only appliances with higher priorities can operate under demand limit limitations. To create dependable prediction models, a number of machine learning techniques are examined, including ensemble methods, PSO-based SVM, Artificial Neural Networks Support Vector Machines, and Particle Swarm Optimization based ANN. Two metrics are utilized in model comparisons: Mean Absolute Error (MAE) and Mean Absolute Percentage Error. Our PSO-based SVM model works better than earlier models seen in the literature today. The automatic hyper parameter change of the PSO optimization approach is responsible for this benefit.