The Intelligent kWh Export-Import Utilizing Classification Models for Efficiency in Hybrid PLTS

Electricity demand is integral to the stability of the community's economic condition, where currently electricity is predominantly sourced from fossil fuels, posing limitations. One effort to maintain this stability is through the utilization of renewable energy, particularly solar energy. The abundance of solar energy in Indonesia presents an opportunity to maximize its potential. This study develops an intelligent kWh export-import system based on the Internet of Things (IoT) and integrated with machine learning. This integrated system enables smooth data flow and communication among various components. Sensors collect information from the solar panel, which is then transmitted to the ESP-32 microcontroller for preprocessing. The ESP-32 facilitates wireless connectivity by transmitting data to the Firebase data cloud using the MQTT protocol. Once stored in the cloud, the data undergoes further analysis and modeling, providing users with valuable insights into the performance of the solar panel system. Overall, this integrated approach allows for efficient monitoring and assessment of the system's efficiency and performance in real-time. Users can access real-time conditions via mobile based on three parameters: "current," "power," and "voltage." Machine learning is employed to classify conditions as "efficient" or "less efficient" by analyzing and comparing five different models: AdaBoost Classifier, DecisionTree Classifier, support vector machine (SVM), naïve Bayes classifier, and extra tree classifier. Model evaluation using accuracy percentage and F1-score indicates that the AdaBoost classifier exhibits high accuracy and F1-score values of 94.5% and 0.937, respectively.


Introduction
In the present era, approximately 1.3 billion individuals worldwide still lack access to electricity, with the majority, around 95%, residing in remote or developing regions [1], [2] the provision of affordable and reliable energy, particularly in remote areas, remains a paramount necessity for fostering economic growth and enhanced development [3].However, escalating concerns regarding the repercussions of climate change and environmental pollution, chiefly due to the predominant utilization of fossil fuels as the primary energy source globally, have underscored the imperative for transitioning towards clean energy and bolstering the efficiency of power generation systems.
The demand for energy continues to surge within progressively advanced societies, precipitating heightened exploitation across various sectors, particularly conventional energy sources notorious for their propensity to engender greenhouse gas emissions and environmental degradation [4].Hence, concerted endeavors persist in the pursuit of developing renewable energy sources as efficacious remedies.Among these, solar energy emerges as a particularly promising avenue [5].Indonesia stands as one of the countries fervently devoted to developing solar energy as a renewable resource.Solar energy epitomizes a cost-free, abundant, and environmentally clean energy source [6].Notably, the deployment of Solar Power Plants (PLTS) exemplifies a strategic initiative in capitalizing on solar energy potential [7].PLTS entails the generation of electricity using photovoltaic modules strategically positioned on rooftops, walls, or other structures owned by customers of the State Electricity Company (PLN).
opportunities [8].Furthermore, the efficiency of energy conversion is inherently influenced by several factors, including the type of photovoltaic cells, module orientation and tilt, installation typology, and geographical location [9].While climatic conditions, particularly dry climates prone to debris accumulation, may occasionally impede the performance of solar panels, this impact is mitigated in regions characterized by ample rainfall that facilitates panel cleansing [10].During daylight hours, solar panels harness solar radiation, converting it into thermal energy subsequently transmuted into electrical power, disseminated through the kWh Export-Import system to local electricity providers.
Indonesia faces several unique challenges in the implementation of solar energy.One of the main challenges is the variation in climate and weather.As a tropical country, Indonesia has long rainy seasons and inconsistent solar intensity throughout the year.This can significantly affect solar energy production and requires effective energy storage systems and adaptive grid management.Additionally, the uneven distribution of energy infrastructure presents a significant obstacle, especially in remote and island regions.Many areas in Indonesia lack the basic infrastructure needed to support the installation and operation of PLTS.This challenge is exacerbated by energy regulations and policies that are often insufficient or slow to change, creating uncertainty for investment and the development of solar energy projects [11] On the other hand, Indonesia has significant potential for solar energy implementation that can provide substantial benefits.As a country located on the equator, Indonesia receives abundant sunlight throughout the year, making it an ideal location for solar energy production.The implementation of solar energy can reduce dependence on fossil fuels and help lower carbon emissions, supporting Indonesia's commitment to climate change mitigation efforts.Moreover, by developing solar energy infrastructure, particularly in remote areas, Indonesia can enhance reliable energy access for communities currently underserved by conventional power grids.This not only improves the quality of life but also opens up new economic opportunities and supports sustainable development [12] A smart KWh export-import system is a technology designed to manage the flow of electrical energy between renewable power sources, such as PLTS, and the main electricity grid.This system enables bidirectional energy exchange, where excess energy produced by renewables can be exported to the grid when local production exceeds consumption, and conversely, energy can be imported from the grid when local demand surpasses renewable production.Key components of the system include smart meters that monitor real-time energy usage, control units that integrate data and optimize energy flow based on pre-programmed algorithms, energy storage systems to store surplus energy, and secure communication networks for data exchange [13].The benefits of this system include enhanced energy efficiency, reduced energy costs, support for grid stability, and increased reliability of energy supply.Implementing a smart KWh export-import system is crucial for fully leveraging the potential of renewable energy and supporting the transition to a more sustainable energy system [14], [15] Smart Export and Import systems represent technological innovations enabling users of renewable energy to channel surplus energy into public electricity grids during production surpluses, while concurrently facilitating energy imports from grids during renewable energy production deficits [13].Leveraging sensor technology and real-time data analytics, these systems optimize renewable energy utilization, sustain equilibrium between energy production and consumption, and enhance overall energy efficiency, thereby facilitating effective energy system management.The integration of machine learning within the automation framework of Smart Export and Import systems entails deploying machine learning algorithms and models to analyze data gleaned from energy sensors and monitoring infrastructure [14].These algorithms prognosticate energy consumption patterns, project renewable energy production, and identify anomalous energy utilization patterns indicative of system malfunctions.Moreover, machine learning can autonomously optimize system operations, dynamically adjusting renewable energy supply to meet user energy demand or modulating energy flow to minimize costs or carbon emissions [15].By harnessing machine learning, Smart Export-Import systems can achieve heightened responsiveness, efficiency, and adaptability to fluctuations in energy production and consumption dynamics.
Previous research endeavors, exemplified by studies conducted by researchers such as [16] and [17], have delved into realms such as energy storage systems and hybrid photovoltaic systems, maximizing performance through machine Vol. 5, No. 2, May 2024, pp.668-678 ISSN 2723-6471 670 learning techniques such as multi-layer perception, recurrent-neural network, convolutional-neural network, and longshort-term memory.Once stored in the cloud, the data undergoes further analysis and modeling, providing users with valuable insights into the performance of the solar panel system.Overall, this integrated approach enables efficient monitoring and assessment of the system's efficiency and performance in real-time.

Experimental Flowchart
The research encompasses several stages, as depicted in figure. 2 Initially, the process begins with the installation of devices comprising sensors and microcontrollers.Subsequently, the devices are connected to the solar panel via terminals.As part of the data analysis stage, a process of validating sensor data is undertaken, involving observation of data generated by sensor readings, consisting of three parameters: "current," "power," and "voltage." The subsequent stage involves the development of data modeling based on the observed data.The model development process entails a series of generic data science steps.Implementation of the model is carried out to assess the efficiency of the solar panel system, as evaluated through the three parameters: current, power, and voltage.
The final stage entails the development of a user interface, serving as the interaction interface between users and the developed system.Vol.The ESP-32 microcontroller is suitable for developing IoT based systems due to its wireless connectivity capabilities to both internet networks and Bluetooth.The ESP-32 features 30 pins, including GPIO, UART socket connector, ground (GND), and Voltage (VCC).It has a random-access memory (RAM) capacity of 2 kB and a flash memory of 32 kB. Figure 3 illustrates the ESP-32 microcontroller.

Sensor ZMPT101B
The ZMPT101B sensor is chosen for its efficiency and cost-effectiveness in this system.As an essential component in the solar panel monitoring system, the ZMPT101B sensor offers reliable performance at a relatively low cost.Its efficiency lies in its ability to accurately detect DC voltage, which is crucial for monitoring the output of the solar panel.Additionally, the sensor is designed to be compact and easy to integrate into the system, minimizing installation and maintenance costs.Despite its affordability, the ZMPT101B sensor maintains a high level of accuracy, ensuring reliable data collection for assessing the performance of the solar panel system.Therefore, the ZMPT101B sensor represents a cost-effective solution for achieving efficient and accurate monitoring of solar panel voltage, making it an ideal choice for this application.

The Intelligent Export-Import kWh using Classification Model
The selection of a fuzzy logic model in this research is based on several fundamental reasons.Firstly, the fuzzy logic model can handle uncertainty and complexity in decision-making, which often occurs in smart KWh export-import systems.By using linguistic concepts, this model allows for a more intuitive representation of variables and system rules.Secondly, the flexibility of the fuzzy logic model enables the direct use of human knowledge in the decisionmaking process, which is useful in situations where rules or relationships between variables are not known with certainty.Moreover, the fuzzy logic model can be easily integrated with existing control systems, enabling faster and more efficient implementation.Thus, the use of a fuzzy logic model in this research is expected to enhance the performance and reliability of the smart KWh export-import system overall.
In the development of the modeling, reference is made to the stages of generic data science, consisting of the following steps:

Data Understanding
In this stage, data generated by the sensors in the form of parameters such as "current," "power," and "voltage" are examined through a process called evaluation data analysis (EDA).The process involves studying the characteristics of the data generated by these parameters.Subsequently, chi-square analysis is performed to observe the interdependence between variables.From this analysis, variables with high and low levels of interdependence are identified.The class labels in this case represent binary classification with labels "Efficient" and "Not Efficient".

Data Pre-Processing
The next stage involves data pre-processing by performing data transformation processes.The data generated by the intelligent export-import kWh device may contain anomalies referred to as outliers.In this stage, outlier reduction is conducted to produce valid output.Potential anomalies in the data include missing data, inconsistent values, typing errors, and other technical outliers.

Modeling
Modeling implementation involves comparing classification models through several algorithms, including NBCsupport vector machine, and decision tree classification.The modeling process is conducted using the Python programming language and Google Colab software, which is connected to the internet.

Evaluation
The evaluation process is conducted to assess the efficiency of the implemented model.Several factors are considered in the evaluation stage, including the measurement of accuracy percentage, F1-score, recall, and precision.Particularly, accuracy percentage and F1-score are key metrics, where higher percentages indicate better model performance due to increased accuracy and precision in determining the efficiency conditions of the voltage generated by the solar panel.

Installing and Validating Device
The installation of the devices is carried out by connecting sensor components to the microcontroller, as depicted in figure 6.

Figure 6. Block system component
Next, the data generated by the solar panel is calculated, where the data is read through the intelligent export-import kWh device.The following table 1 displays the measurement results based on time and three parameters consisting of "current," "power," and "voltage."The data collection process is conducted over 200 minutes during the timeframe from 08:00 AM to 11:20 AM. added by research results [18], [19] that the IoT system assembly diagram makes monitoring performance more effective.In table 1, there are 200 data records consisting of current, power, and voltage readings.At the start of the data collection, the current was recorded as 0.55 ampere, power as 0.15 watt, and voltage as 0.32 volt.There was a continuous increase observed in each parameter with every minute.At the last minute, or at 11:20 a.m., the recorded values were a current of 6.02 ampere, power of 5.14 watt, and voltage of 16.25 volt.In this study, the optimal ranges for current are 59 Ampere, voltage is 1620 Volt DC, and power is 5~20 watt.The data readings obtained from the device indicate that it can be utilized as an intelligent export-import kWh device, which will later be integrated with machine learning classification modeling.

Data Transformation
To facilitate the process of EDA, the data records need to be transformed based on classification.There are several label categories in each parameter: "current," "power," and "voltage," each containing four label categories consisting of 0, 1, 3, 4. Figure 7 illustrates the transformation results of the scrutinized dataset.The next step is to perform EDA by analyzing each parameter.For the "current" parameter, it is presented in figure 8(a), where the highest label is found in label 1 with a total of 68 data points, while labels 0 and 3 have lower values.Therefore, in this case, data balancing is necessary to produce modeling with credible results.Meanwhile, the graphical visualization can be observed in figure 8(b)."power" is the same as the "current" parameter, namely by balancing the data process.The "power" parameter exhibits unbalanced data, where labels 0 and 1 have values far below those of labels 3 and 4. Therefore, the treatment applied to the "power" parameter is similar to that of the "current" parameter, which involves balancing the data process.Next, the data balancing process employs the SMOTE, which involves increasing the number of data points in the dataset to achieve data balance.SMOTE is applied to the label space containing minority or low data.In this case, SMOTE is implemented for the "current" and "power" parameters.The results of SMOTE implementation for both parameters can be observed in table 2.  Discussion on the performance of shallow machine learning models is crucial in understanding the differences among models.Exploring the underlying assumptions of each model, the importance of selected features, and error analysis helps provide deeper insights into the strengths and weaknesses of each model.Simple models may have easily understandable assumptions but may overlook the complexity of the data, while more complex models may be stronger in capturing intricate patterns but are harder to interpret.added by research results [20] that fuzzy is a model that can improve monitoring results.
The selection of a fuzzy logic model in the research on smart KWh export-import systems is based on the need to address uncertainty and complexity in the data.This model allows for the direct integration of human knowledge in decision-making, aligning with the qualitative nature of the data involved in the system.Furthermore, the advantages of fuzzy logic models in ease of implementation and interpretation make them a suitable choice for practical applications like energy export-import systems.Thus, the selection of a fuzzy logic model in this research is based on its ability to handle data complexity, ease of implementation, and good integration with the qualitative nature of the system under study.

Conclusion
In this study, a smart KWh export-import system was developed to determine the inputs of "current," "power," and "voltage" generated by solar panels.Machine learning implementation was carried out using a classification model through generic data science stages.Experiments were conducted to observe how the device reads the data generated by solar panels.Meanwhile, modeling analysis included comparing classification models consisting of the AdaBoost Classifier, DecisionTree Classifier, Support Vector Machine, Naïve Bayes Classifier, and Extra Tree Classifier.Model evaluation utilized accuracy percentages and F1 scores, with the AdaBoost classifier showing high accuracy and F1 scores of 94.5% and 0.937, respectively.As a continuation of further research development, the device needs to undergo validation processes compared to reference instruments to determine the average absolute error percentage.Regarding modeling, the dataset could be expanded to enhance the accuracy of the model applied to the device.
For future research, additional aspects could be explored to advance the understanding and application of smart KWh export-import systems.One potential avenue could involve investigating the scalability and adaptability of the developed system to various solar panel configurations and environmental conditions.Additionally, the integration of real-time monitoring and predictive maintenance capabilities could be explored to optimize system performance and reliability.Furthermore, exploring the integration of renewable energy forecasting techniques could enhance the system's ability to anticipate and respond to changes in solar energy production, thereby improving overall efficiency and grid stability.Finally, exploring the potential for incorporating artificial intelligence techniques, such as reinforcement learning, could further enhance the system's autonomous decision-making capabilities and adaptability to dynamic operating conditions.These avenues of research could contribute to the continued advancement and deployment of smart KWh export-import systems in real-world settings.

Figure 1
Figure1illustrates the proposed system in this study, wherein several sensors are deployed to detect data obtained from the solar panel.The solar panel absorbs heat from sunlight and subsequently converts it into voltage.This voltage is then detected by an ACS712 sensor as a direct current (DC) current detector and a ZMPT101B sensor as a DC voltage detector.The data read by these sensors is transmitted to the ESP-32 microcontroller as a connector between the sensor devices and the cloud data, enabling wireless reception by users.The data generated by the device comprises three parameters: power, current, and voltage.In this research, the ESP-32 communication system utilizes the message queueing telemetry transport (MQTT) protocol, enabling connectivity to the Wi-Fi network.The device's readings are sent to the Firebase data cloud, subsequently processed through data modeling, allowing users to assess the efficiency level of the solar panel system via the intelligent export-import kWh device.

Figure 1 .
Figure 1.System ProposedThis integrated system allows for seamless data flow and communication between the various components.The sensors gather information from the solar panel, which is then transmitted to the ESP-32 microcontroller for preprocessing.The ESP-32 facilitates wireless connectivity, transmitting the data to the Firebase data cloud using the MQTT protocol.Once stored in the cloud, the data undergoes further analysis and modeling, providing users with valuable insights into the performance of the solar panel system.Overall, this integrated approach enables efficient monitoring and assessment of the system's efficiency and performance in real-time.

Figure 4
Figure 4 depicts the ZMPT101B sensor utilized for voltage measurement, commonly employed in electrical monitoring systems.It comprises four pins, including 2 ground pins (GND), a voltage pin (VCC), and an output pin.The ZMPT101B sensor operates within an input voltage range of 0250 volts, with a frequency range typically between
Parameter "power" (a) Number of data labels.(b) Graphical visualization shown in figure 9.

Figure 9 .
Figure 9. Parameter "power" (a) Number of data labels.(b) Graphical visualization Meanwhile, the "voltage" parameter exhibits data that is nearly balanced and still acceptable for implementation in the modeling process.For labels 1 and 4, there are 20 and 18 data points, respectively.As for labels 0 and 3, each has 28 data points.Parameter "voltage" (a) Number of data labels.(b) Graphical visualization is shown in figure 10.

Table 1 .
Measurement result by Intelligent Export-Import kWh

Table 2 .
SMOTE implementation on "current" and "power" parameters Naïve Bayes Classifier, and Extra Tree Classifier.The data is divided into two parts: training data and test data with percentages of 80% and 20%, respectively.The metrics used for evaluating model performance are accuracy and F1-score.The results are represented in table3, where the highest accuracy is achieved by the AdaBoost Classifier with an accuracy percentage of 94.5%, while the lowest accuracy is observed with the Extra Tree Classifier at 85.1%.AdaBoost classifier influences real-world effectiveness in this research by enhancing the accuracy and robustness of the classification model.AdaBoost, short for Adaptive Boosting, is an ensemble learning method that combines multiple weak classifiers to form a strong classifier.In the context of this research, AdaBoost can effectively handle complex patterns and relationships in the data, leading to improved classification performance.By iteratively adjusting the weights of misclassified data points, AdaBoost focuses on difficult-to-classify instances, thereby reducing bias and variance and increasing the overall model accuracy.In real-world applications, this enhanced classification accuracy provided by AdaBoost can lead to more reliable and efficient decision-making processes, especially in scenarios where accurate classification is critical, such as medical diagnosis or fraud detection.Thus, the utilization of AdaBoost classifier contributes significantly to the effectiveness of the research outcomes in real-world settings.

Table 3 .
Modeling result performance