## 1 Introduction
Laboratory tests of water quality are carried out based on the following criteria:  
* Physical (small, taste, turbidity, color);
* Microbiological (total microbial count, content of coliform bacteria, spores of sulfite-reducing clostridia, and cysts of lamblia);
* Chemical (hydrogen index of water pH, hardness and alkalinity, mineralization, anionic and cationic composition (inorganic substances), content of organic substances). This approach is currently the most accurate, but has two significant drawbacks. First, there are no clear regulations on the timing of water sampling. Due to the dynamics of liquid movement, samples are sometimes taken too late, resulting in missed instances of exceeding the MPC and lower concentrations than we present at the sampling time. Second, laboratory studies require substantial time, leading to delays in responding to  
Figure 1: Smart energy impact assessment. these instances. Additionally, laboratory testing is costly and requires the optimization of the sampling process. The development of IoT and other technologies has enabled the installation of mobile laboratory posts equipped with direct measurement sensors. Direct measurement analyzers measure the chemical composition in the laboratory by finding the value of the tested indicator (for example, Manganese) and comparing it with the standards for the maximum permissible concentration of Manganese in water. A major limitation of this approach is the high maintenance cost. Since mobile posts function as laboratories, they require chemical component supplies for analysis, which becomes very expensive due to their remote locations. Furthermore, it is important to note that conducting a complete chemical analysis of water samples daily is impractical due to the high costs. As a result, there may have been instances where contamination exceeded MPC but went undocumented. There is a need for low-cost systems to detect when the MPC is exceeded and trigger automatic water sampling. The sampled water can then be sent to the laboratory for analysis. Inexpensive devices include indirect measurement sensors, which detect changes in the water's chemical composition without identifying the cause. This indirect measurement approach is one way to monitor wastewater quality and quickly spot anomalies that may indicate that the MPC standards have been exceeded. When working with real-life data, we need to detect known and potential new anomalies in case of some missed events. Smart energy monitoring systems use indirect measurement sensor channels without information on specific indicators of the concentration of harmful substances in the same water sample. Such sensors measure changes in the chemical water composition (the ratio of oxidized and reduced forms of all chemicals in solution) over time using electrochemical methods with pH/ORP (the power of Hydrogen/Oxidation-Reduction Potential) electrodes that generate time series data with an index of timestamp format. Changes in the water composition affect the readings of indirect measurement sensors, often showing atypical patterns that differ from those of clean water. These anomalies can indicate cases where wastewater contamination exceeds the maximum permissible concentrations. The diversity in chemical composition is reflected in sensor readings and calls for time series analysis methods that minimize human involvement. Automated techniques, such as stationarity checks, partial autocorrelation function (PACF) and autocorrelation function (ACF) calculations, or advanced methods, such as convolutional neural networks and Isolation Forest, can be used for efficient analysis. When using this approach to detect instances of exceeding the MPC, a key research question arises: how can such events be identified using indirect sensor readings when only a limited number of confirmed cases are available? The limited number of confirmed MPC exceedances results from the fact that not every discharge detected by indirect measurement sensors is confirmed or refuted by laboratory tests.