## 1 Introduction
Integrating Artificial Intelligence (AI) and the Internet of Things (IoT) into household devices creates more intelligent, adaptive systems that optimize energy use without compromising comfort. Smart thermostats, for instance, learn user preferences and automatically adjust heating and cooling settings to minimize energy consumption while maintaining desired indoor conditions [35]. Regarding (AI) advancements in buildings, some experiences have been recently incorporated into the optimization of demand response applications, enhancing comfort-based flexibility models [36]. On the other side, techniques based on AI and Machine Learning have been recently used to develop an interactive mechanism to classify residential consumers in order to provide flexibility for peak demand saving on a quarter-hourly basis [37]. Moreover, demand response applications in residential buildings have been favored by systems based on IoT like presented in [38], where a new management system is proposed for residential clusters. IoT also enables the aggregation of residential flexibility in distribution grids, which is essential to provide significant demand packages to grid operators, facilitating the coordination of flexible appliances, as presented in [39]. This study's relevance lies in the residential sector's role in the stability and balancing of the electricity grid, as it constitutes a significant proportion of total demand. In particular, the case study where the methodology here presented has been applied consists of a municipal distribution grid, where most of the energy consumption is related to households. Moreover, the flexibility potential of residential consumers remains underexplored for different reasons, but mainly due to the difficulty to aggregate this potential in order to provide a significant amount of power to the grid operator. However, as mentioned above, this fact is changing due to the configuration of electricity networks as smart grids and the growing presence of enabling technologies based on IoT. However, in the context of smart grids, where consumers play an active role in the system's operation and the provision of balancing services, residential consumption faces significant challenges due to its non-linearity, heterogeneity, and uncertainty. Daily activities, weather conditions, and household occupancy patterns influence these factors. Unlike the industrial and commercial sectors, where energy consumption tends to be more controllable and predictable, residential demand is mainly determined by individual behavior, making it difficult to manage and forecast [40]. This makes forecasting and managing energy consumption in the residential sector complex and requires more sophisticated tools than those used in other sectors. It is, therefore, essential to further investigate ways to integrate and optimize the flexibility potential of the residential sector, considering its impact on the transition to sustainable and resilient energy systems. Adapting consumers to more flexible consumption behavior can be a significant change, and incentives, education, and enabling technologies will be key in this process. This study presents a methodology for disaggregating residential energy consumption data to serve as a basis for future analyses of the potential for flexibility. This disaggregation allows for identifying different household energy consumption patterns, which is fundamental to understanding how different appliances and systems contribute to overall consumption. The focus is on identifying and characterizing different types of household energy consumption to enable a detailed understanding of their contributions. The methodology implemented provides tools that allow the impact of each device to be quantified and has been validated using real data provided from the DSO of a Spanish municipality of about 29,000 habitants. The main contribution of this research resides in the approach based on processes or end uses to evaluate the flexibility potential of residential consumers.