###### Abstract  
End-User Development has been proposed over the years to allow end users to control and manage their Internet of Things-based environments, such as smart homes. With End-User Development, end users are able to create trigger-action rules or routines to tailor the behavior of their smart homes. However, the scientific research proposed to date does not encompass methods that evaluate the suitability of user-created routines in terms of energy consumption. This paper proposes using Machine Learning to build a Digital Twin of a smart home that can predict the energy consumption of smart appliances. The Digital Twin will allow end users to simulate possible scenarios related to the creation of routines. Simulations will be used to assess the effects of the activation of appliances involved in the routines under creation and possibly modify them to save energy consumption according to the Digital Twin's suggestions. End-User Development; digital twin; internet of things; routine; smart home +
Footnote †: journal:  
0000-0001-4600-0000-0000-0000-0000-0000-0000-0000-0000-0000-00000-0000-000  
Defining smart home behaviors means creating _routines_ (namely, trigger-action rules) that are automatically executed when some event or condition occurs. The user is guided through the steps required to set up the name of the routine, the trigger, and the actions. A given number of parameters are requested for the trigger and each action of a routine. For instance, if the user would like to create a routine that starts at 7:00 a.m. every working day, time and day parameters must be set; and, if the user would like the light of the bathroom to be switched on with brightness 40%, both these parameters (\"on\" and \"40%\") must be set for the light-switching action. IFTTT (_IF This Then That_) [10] is one of the most widely known examples of this kind: it allows the user to combine a huge number of services, apps, and devices in rules with a single trigger and a single action. Scientific research (e.g., refs. [11; 12; 13; 14]) has addressed the problem of allowing the creation of more complex rules through easy-to-use graphical user interfaces, augmented reality [15], voice-based interfaces [16; 17; 18], and multi-modal interfaces combining visual, voice, and touch interaction [19]. This approach can address end users' diverse and changing needs, where the term _end user_ refers to people who are not experts in programming or computer technologies. Therefore, in the case at hand, smart home inhabitants are end users who require End-User Development techniques to facilitate the creation of smart home behaviors tailored to their needs. Specifically, End-User Development has been defined as \"the set of methods, techniques, tools, and sociotechnical environments that allow end users to act as professionals in those information and communication technology-related domains in which they are not professionals, by creating, modifying, extending and testing digital artifacts without requiring knowledge in traditional software engineering techniques\" [20]. In the current era of the Internet of Things, the creation of automatic behaviors like routines may have significant potential to develop effective energy management systems for homes. This will contribute to achieving the United Nations' sustainability development goals ([[https://sdgs.un.org/goals](https://sdgs.un.org/goals)]([https://sdgs.un.org/goals](https://sdgs.un.org/goals)) accessed on 1 May 2024) by reducing energy consumption and environmental impact while lowering residents' energy bills. The Internet of Things can be combined with Machine Learning algorithms to obtain a so-called Digital Twin, a powerful tool for modeling and optimizing complex systems in various domains, such as manufacturing, healthcare, and energy saving [21; 22; 23].