Improving the Effectiveness of by adaption to the Users Context

THI AN PHAM

Computer Science and Engineering, master's level 2019

Luleå University of Technology Department of Computer Science, Electrical and Space Engineering This thesis is prepared as part of an European Erasmus Mundus programme PERCCOM - PERvasive Computing & COMmunications for sustainable development.

This thesis has been accepted by partner institutions of the consortium (cf. UDL-DAJ, n°1524, 2012 PERCCOM agreement).

Successful defense of this thesis is obligatory for graduation with the following national diplomas:

• Master in Complex Systems Engineering (University of Lorraine) • Master of Science in Technology (LUT University) • Master of Science in Computer Science and Engineering, specialization in Pervasive Computing and Communications for Sustainable Development (Luleå University of Technology)

i ABSTRACT

LUT University School of Engineering Science Erasmus Mundus Masters in PERvasive Computing and COMmunications for sustainable development (PERCCOM)

An Pham

Improving the Effectiveness of Building Automation by adaption to the Users Context

Master’s Thesis

71 pages, 23 figures, 8 tables, 4 appendices

Keywords: , User Context, Effectiveness Improvement, Sustainable Develop- ment.

The operations of either residential housing or commercial buildings are energy intensive, es- timated to occupy around 40% of all energy consumed worldwide by the year 2030 (by GeSI, SMARTer2030). ICT-enabled smart home or building solutions are expected to contribute to sus- tainability gain in term of improving energy and resource efficiency. These technologies not only enable buildings to be automated and centrally controlled but also help to provide a healthier and more comfortable living or working environment. While studies in smart home system show good results in reducing the energy consumption of a building by automating tasks to tear down unused appliances, most of the applications are limited implemented based on fixed schedule reassem- bling user behavior or routines, which is one of the major obstacles for home automation systems (HAS) to be widely acquired. As a solution for this matter, this study aims at exploring actual contexts of user for HAS to adapt in a more meaningful way so that not only the goal of reduced energy consumption is improved, but the user comfort is also taken care of in the best way. Using available studies on the expected reaction in HAS (in this work we focus on German Use case), a rule-based dictionary will be defined as a set of meaningful adaptions which can later be imple- mented on top of a home automation platform. Then, the study will present the assessment of this model in comparison with available studies to prove an improvement for energy efficiency.

ii ACKNOWLEDGEMENTS

I want to express my sincerest gratitude to the following people and organization who made this graduate thesis a worthwhile endeavor and an incredible journey.

To Prof. Olaf Droegehorn, for the tirelessly support and guidance in my research and always effectively answer to my questions. Thank you for the conversation about German culture, for introducing me to incredible people and excellent food, life in Germany could have been worse without your help.

To Prof. Eric Rondeau, the PERCCOM program coordinator, for giving me such in- valuable opportunity to join the program, and for inspiring us in the journey of fostering sustainable development.

To all the professors and program coordinators, especially Prof. Jean-Philippe Georges, Prof. Jari Porras, and Prof. Karl Andersson, for all your knowledge sharing, guidance, advises and support during our incredible program.

To all the university and administrative staffs from France, Finland, Russia, Sweden, and Germany, especially to Caroline Schrepff - our hardworking and dedicated PERCCOM secretary, but most of all, a thoughtful person who always take care of us in the best possible way. Thank you for making our life more comfortable.

Lastly, big thank to all my family and , here or overseas, near or far, my dear Perccommies, for good and bad times, for laughing and crying together. Forever grateful.

The research reported here was supported and funded by the Erasmus Mundus Joint Mas- ter’s Degree (EMJMD) in PERvasive Computing and COMmunications in sustainable development (PERCCOM) (Kor et al., 2019). The authors would like to express their gratitude to all the associate partners, sponsors, and researchers of the PERCCOM Con- sortium.

iii CONTENTS

ABSTRACT ii

ACKNOWLEDGEMENTS iii

LIST OF FIGURES vi

LIST OF TABLES viii

LIST OF SYMBOLS AND ABBREVIATIONS ix

1 INTRODUCTION 1 1.1 Background ...... 1 1.2 Problem Definition ...... 2 1.3 Research Goals and Research Questions ...... 3 1.4 Delimitation ...... 4 1.5 Thesis Structure ...... 4

2 LITERATURE REVIEW 5 2.1 Search Strategy ...... 5 2.2 Home Automation System (HAS) ...... 8 2.2.1 HAS - Definition, current features and its role in energy manage- ment ...... 8 2.2.2 HAS - key challenges and social barriers ...... 11 2.2.3 HAS - Architecture ...... 12 2.3 User Context and Impact of User Behavior in HAS ...... 13 2.4 User Context and HAS Integration Enablers ...... 15

3 RESEARCH METHODOLOGY 17 3.1 Design Science Research ...... 17 3.2 Research Process ...... 19

4 SYSTEM DESIGN AND DEVELOPMENT 21 4.1 System Specification - German Use case ...... 21

iv 4.2 Technology Stack ...... 23 4.3 The Proposition ...... 27 4.4 Application Development ...... 30 4.4.1 Prerequisites ...... 30 4.4.2 Scenarios ...... 30 4.4.3 Implementation ...... 34

5 EFFICIENCY EVALUATION 40 5.1 Outcomes ...... 40 5.1.1 Overall architecture to integrate user context ...... 40 5.1.2 Proof of Concept ...... 41 5.2 Evaluation ...... 42 5.2.1 Evaluation in terms of energy usage ...... 42 5.2.2 Evaluation in terms of carbon emission ...... 46

6 DISCUSSION AND SUSTAINABILITY ANALYSIS 47 6.1 Discussion ...... 47 6.2 Sustainability Analysis ...... 48

7 CONCLUSION AND FUTURE WORK 51 7.1 Conclusion ...... 51 7.2 Future Work ...... 52

References 53

Appendices 58

v LIST OF FIGURES

Figure 1 CASAS smart home architecture overview. Source: CASAS: A Smart Home in a Box (Cook et al., 2013) ...... 13 Figure 2 The overall architecture of a location-aware HAS. Source: A location- aware architecture for heterogeneous Building Automation Systems (Mainetti, Mighali, and Patrono, 2015) ...... 14

Figure 3 Design Science Research Methodology. Source: Design Science Research in Information Systems (Vaishnavi, Kuechler, and Petter, n.d.) . 18

Figure 4 Technology Stack...... 24 Figure 5 Home Assistant Architecture...... 25 Figure 6 Network port-forwarding setup...... 26 Figure 7 An overall architecture of user-context integrated home automa- tion system...... 28 Figure 8 Activity diagram of the automation on thermostat based on calen- dar event (S1 - S2)...... 32 Figure 9 Influence diagram of Home Assistant Components...... 32 Figure 10 State diagram of estimating time to arrive home based on driving mode...... 33 Figure 11 Infrastructure of the user-context integrated system...... 36 Figure 12 Admin view on desktop with full control...... 36 Figure 13 User interface for general information - admin...... 37 Figure 14 User interface for home status - admin...... 37 Figure 15 User interface for profile information - admin...... 38 Figure 16 User interface on mobile for normal user’s view...... 39

Figure 17 History graph of heating/cooling system status on a fixed schedule scenario...... 43 Figure 18 On/off period of heating/cooling system - fixed schedule...... 45 Figure 19 On/off period of heating/cooling system - context adapted. .... 45 Figure 20 Compare on/off period of heating/cooling system...... 46

vi Figure 21 Sustainability Awareness Diagram...... 50

Figure 22 The interface to work with Home Assistant Configuration Tool. .. 60 Figure 23 The setting of HA server and network infrastructure...... 61

vii LIST OF TABLES

Table 1 Traceability of research goals and research questions ...... 4

Table 2 Details of the literature review method...... 6 Table 3 Chosen keywords and search results from different sources of data. 7 Table 4 Inclusion/Exclusion criteria for articles searching ...... 7 Table 5 Compare context integration feature of HAS platforms...... 16

Table 6 Implemented user-context integrated scenarios...... 31 Table 7 Supported trigger types in Home Assistant platform...... 35

Table 8 Events extracted from user’s calendar...... 44

viii LIST OF SYMBOLS AND ABBREVIATIONS

API Application Programming Interface DNS Domain Name System DSR Design Sience Research ETA Estimated Time of Arrival GeSI Global e-Sustainability Initiative HA Home Automation HAS Home Automation System ICT Information and Communications Technology IoT LAN Local Area Network

ix 1 INTRODUCTION

Technologies have evolved quickly, especially in recent years, leading to growing in ur- banization at a fast pace. Along with the increasing in population in urban area, the demand on housing and buildings, especially commercial ones, is thus on the rise expo- nentially. Studies show that the construction and operation of building is highly energy intensive. According to GeSI (Global e-Sustainability Initiative) SMARTer2030 report (GeSI, 2015), buildings along are accountable for approximately 40% of worldwide en- ergy consumption.

In this section, we provide an overall understanding of the background in this field of research and introduce our motivation through defining problematic issues that this study aims to address. Based on our finding and goal-oriented navigators, research goals are listed in detail as well as the delimitation of this study. We list our specific questions that we will later on look into, these questions serve the purpose of reaching our research goals.

1.1 Background

ICT-enabled home/buildings or so-called smart home or smart buildings come in handy to better control appliances inside the facilities, thus ultimately optimize the building energy efficiency. As stated by (ibid.), "Smart building solutions will enable energy and resource savings both in existing buildings as well as newly constructed buildings". Monitoring, motion detection and diagnosis technologies allow data to be gathered in new house or building environment, thus, enable monitoring energy usage more effectively. Occupants inside the smart house or building gain control and comfort, at the same time, resource management can be ensured (Toschi, Campos, and Cugnasca, 2017). Automated heating or cooling, ventilation and lighting control systems are gaining popularity for energy sav- ing possibilities. Market estimation of smart appliances is reported to grow up to to 26 billion dollars in 2019 (Fagnant and Kockelman, 2015). In a report published by (Gartner, 2012), Home Automation has been recognized among the potential rising technologies.

1 Chapter 1. INTRODUCTION

ICT-enabled tools have great impacts on management of energy and resource, on improve- ment of process efficiency, and also on the enhancement of living comfort. Researchers have been conducting studies in Home or Building Automation system and architecture for more than a decade and have contributed great results. Surveying on home automation networks points out differences between various types of smart home system, thus pro- vide a better understanding and simultaneously identify trends of the future in connected home sphere (Toschi, Campos, and Cugnasca, 2017).

ICT-enabled smart building is believed to be the solution for huge carbon emission from electricity usage (from heating or cooling and electronic devices) in the home sector by shutting down unused appliances, which are often neglected to take care of by human negligence.

1.2 Problem Definition

It is a matter of fact that modern buildings contribute a significant amount of energy con- sumption comparing to other sectors. Reports show a high percentage of CO2 emission, in terms of energy consumption, from Home or Building sector. Building/Home Automa- tion thus becomes a well evolving field of research and applications, where the energy consumption of buildings can be monitored and reduced by installing smart automation systems. However, the smart home market is still in an immature state (Poulson, Nicolle, and Galley, 2002). Due to a serious lack of standards and overall integrated solution, smart home has failed to make a significant impact on a mass market. Although several different technologies are available to achieve these tasks, no clear focus of applications makes it hard for normal user to approach.

Existing work in Home Automation System (HAS) gives already a good result in reducing energy consumption, and it remains a static solution that does not react on the unusual behavior of users. Available applications of smart home mainly about home security system and remotely controlling the home while away, to support special needs for people with disabilities (ibid.).

Besides, user habit in a home or building environment affect the energy critically, and it is common sense that human behavior in utilizing facilities at home or office buildings can make a huge difference. Actual context of users should be taken into account to adapt the

2 Chapter 1. INTRODUCTION building automation system meaningfully in real time, so that the goal of reduced energy consumption is improved and simultaneously, the user comfort can be taken care of in the best way.

1.3 Research Goals and Research Questions

The current research aims to investigate in which way the effectiveness of home automa- tion installations can be improved by tracking or sensing and interpreting the actual user context, given available sensors within the automation system as well as incorporating sensors from smart devices. This study addresses the following matters:

• RG1 - To investigate the impact of actual user context on smart home systems taken into account different dimensions of user context. • RG2 - To abstract a sound way to integrate user context into HAS. • RG3 - To observe the efficiency improvement of HAS in term of energy usage by semantically reacting to high-level contextual data in a specific use case.

We need to understand the impact of user context in order to adjust system behavior for better enhancement in system efficiency. By answering to two questions: what user context can be used in HAS? and how can these context attributes affect the HAS?, we come to further understanding of the impact of user context in smart home systems. The second goal of the study is to look for a sound integration model for smart home system to react to actual user context. We achieve this by answering to the question: how to integrate user context effectively, how to evaluate what we have propose and build and how do we know in what terms what we projected is good. All these questions are targeted and answered throughout the rest of the report.

Table 1 summarizes the research questions and its traceability to the corresponding goal of research. Clearly identifying and keeping track of the connection helps the authors focus on the main issues and have a mean to justify any findings in the end.

3 Chapter 1. INTRODUCTION

Table 1: Traceability of research goals and research questions

RQ1 What are possible user context attributes that can be use in HAS? RG1 RQ2 What are possible impacts of user context in HAS? RG1 RQ3 How do we integrate user context into HAS in an effective way? RG2 RQ4 How do we make HAS react more meaningfully to different user context? RG3 RQ5 How do we evaluate the impact of user context in HAS? RG3

1.4 Delimitation

Within the context of this research, we investigate different user context attributes that can have an impact on HAS energy efficiency. To simplify the concept, we only focus on the single-user environment where the smart home system is considered private housing with one occupant.

The ultimate goal of the study is to find a way that user context can be used effectively and the impact can be verified in a certain smart home system. For this reason, we need to de- fine a scenario and use-case with clear specifications. (Sangogboye, O. Droegehorn, and Porras, 2016) has conducted a research in German household requirement specification and we extend our use-case based on these findings.

The authors are interested in investigate the affect that user context can bring into HAS. For that reason, existing HAS architectures will be inherited as they do exist.

1.5 Thesis Structure

The thesis is organized as follows. Within this Introduction, we discuss problem definition that drives this study, investigate related work in the field using a systematic literature re- view method and summarized into two areas: Home Automation System (HAS) and User Context. The chapter entitled “Research Methodology” describes the scientific method- ology this study has been followed. An overall integration architecture and the features of heuristic evaluation are presented as Research Results. Summary of research findings and future work are discussed, and finally, a conclusion is drawn in the last chapter.

4 2 LITERATURE REVIEW

Learning the background work in the field is essential for quality findings, the authors follow a systematic literature review methodology to search, select and analyze related papers, journals to form an overall view on concerned matters. (Klimova, 2018) has pre- sented a well-organized literature review which enhances searching quality by focusing on content and relations between topics of interest. The two well-evolved fields of re- search: home automation and user context are of primary benefits. This study tries to form strong understanding in the impact of user context, or user behavior in the context of home automation and how beneficial extracted knowledge could be utilized in the quest to improve HAS efficiency, thus, contribute to the advancement in Home Automation (HA) social adaption.

2.1 Search Strategy

The process of data selection includes a periodic search for articles. We used the follow- ing terms as searched keywords: User Context, Home/House Automation, Smart Home, Context-aware in the renowned scientific databases: ScienceDirect, Scopus, and Springer. A large number of results returned indicate the popularity in the fields and also implied that the keywords we used might be too broadly linked. To this end, compositions have been applied to connect keywords (e.g., AND) as a mean to filter related results as well as to point the search focus to relations between keywords. Other journal databases: ACM Digital Library, IEEE Xplore, Taylor & Francis Online, and Cambridge Core were also used to fulfill the necessary materials for reviewing.

Table 2 describes the details of the literature review process. This includes the following information: task description, an objective of each task and specific activities to achieve these objectives. The outcome of this process is a list of what we believe to be relevant and can be leveraged to build a foundation for our research.

5 Chapter 2. LITERATURE REVIEW

Table 2: Details of the literature review method.

Task Objective Activities Keywords search To find all relevant articles • Extracted keywords relevant to research goals: “user context” in “home automa- tion” system. • Searched in different databases and skimmed through returned results.

Combine keywords To filter closely related and • Leveraged advanced search features in useful articles in the context scientific databases: conditions on key- of this research words, compositions.

Inclusion and ex- To define the scope to later • Selected results writeen in English and clusion criteria select articles as we are in- from 2010 with high impact factor and terested in more recent find- published in top conferences. ings

Sources selection To select the most relevant • Scanned article’s content, including ab- and analyze and available articles for stract, keywords and marked good items deeper analysis. for analysis. This task is done with the help of Mendeley tool. • Looked for full-text documents to sup- port further reading.

Quality assessment To select relevant articles • Looked into the content of articles and capable of addressing the cross-referenced to detect additional rele- research questions vant papers (or keywords). • Eliminated duplicated and irrelevant studies. • Enriched the literature collections for any new relevant keywords found and discussed to finalize results for next step.

Searching for “Home Automation” alone returned more than 20.000 results (ScienceDi- rect) and same observation applied to “User Context”. This incident is not surprising, although both research fields are not new, the attention has never dropped, especially in studies towards conserving energy and consciousness in consuming energy, which is covered in the theme of sustainable development. Due to the nature of this study, we only look into the intersection where “user context” meets “home automation” that can enhance the efficiency of HAS.

To enhance the diversity of related articles, we conducted searching in different sources of data, specifically, ScienceDirect, IEEE Xplore, Springer Link, and Emerald Insight, these

6 Chapter 2. LITERATURE REVIEW are the most famous scientific databases with thousands of articles, conference papers, etc.. A final list of keywords have been gathered (Table 3a) from research goal analysis and extended during cross-referenced article scanning. Total number of articles found in each database is summarized in Table 3b.

Table 3: Chosen keywords and search results from different sources of data.

Keywords Keywords ScienceDirect IEEE Xplore Springer Link Emerald Insight 1 user context/user behavior 2 smart home/building (1)(2|3) 2007 8771 5363 4533 3 home/building automation (2|3)(4) 963 60 511 184 4 user context detection (2|3)(7) 1485 279 1246 570 5 energy saving (1)(2|3)(5) 808 191 808 381 6 energy monitor 7 context aware (1)(2|3)(6) 300 348 588 405 (a) Related key- (b) Search results in different database. words.

From the result pools, we have selected 91 articles in total, including related papers, cross- reference and existing work from the similar topic, to further analyze. Searching from different scientific database covers larger range of possible articles, however, it comes with the cost of an immense amount of returned matches. Inclusion and exclusion criteria are applied to filter the results. Summary of conditions used to select articles is explained in Table 4.

Selected papers for further studying fit into three main groups: study in definition, archi- tectural aspects, role of HAS in energy management (44%); user context and impact of user behavior in HAS (19%); and research in the field of context recognition within home automation environment (26%). Furthermore, this study aims to explore external dimen- sions of user context at a higher level which is closely related to user data and looking for an effective way to integrate such context data into HAS. Thus, we also investigate modern HAS platforms in its user context enabler aspect. The rest of the selected articles relates to design science research methodology, doing literature review and sustainability analysis. In the following section, we present findings among those categories of interest.

Table 4: Inclusion/Exclusion criteria for articles searching

Inclusion Exclusion Most recent published: 2008-2018 Non-academic resources (e.g., magazine reports, book chapters, blog) Journals/papers in English only Other languages than English Highly ranked conference User context appearing in other unrelated fields of research High impact factor: >=1.0 Not closely related to Home Automation System Computer science or ICT related fields

7 Chapter 2. LITERATURE REVIEW

2.2 Home Automation System (HAS)

Having a clear understanding of what is home automation system and its role is essential for our research. We look carefully into different definitions, survey on current state of research in smart home area, technical and social barriers that prevent smart home to be adoptive in mass market (Risteska Stojkoska and Trivodaliev, 2017). Several practical architectures of HAS is also presented here in this section.

2.2.1 HAS - Definition, current features and its role in energy man- agement

Smart Home/Building have been studied and developed over the last three decades. Mul- tiple studies have been conducted to provide an adequate view of the definition of a smart home. (Toschi, Campos, and Cugnasca, 2017) surveyed to summarize the current state of the art of smart home automation and has pointed out several different definitions.

• “One which provides a productive and cost-effective environment through opti- mization of its four basic elements including structures, systems, services and man- agement” (Wigginton, 2013) • “A smart home is a residence equipped with a high-tech network, linking sensors and domestic devices, appliances, and features that can be remotely monitored, accessed or controlled, and provide services that respond to the needs of its inhabi- tants” (Chan et al., 2009). • (Buckman, Mayfield, and Beck, 2014) defines Smart Buildings as buildings which “integrate and account for intelligence, enterprise, control, and materials and con- struction as an entire building system, with adaptability, not reactivity, at the core, in order to meet the drivers for building progression: energy and efficiency, longevity, and comfort and satisfaction”.

Definition from service/context-led perspective is another approach to identify home au- tomation (Reinisch et al., 2011). Although being expressed in different way, there is a substantial intersection among these definitions (Marikyan, Papagiannidis, and Ala- manos, 2019). Alternately, smart home should satisfy three main characteristics: internet of things, services and the ability to serve users’ need and comfort. User comfort is often expressed through air quality and thermal comfort management (Félix Iglesias Vázquez,

8 Chapter 2. LITERATURE REVIEW

Kastner, and Kofler, 2013), together with the full control ability over the house. These re- quired characteristics are reflected understandably in HAS architecture that we are going to look into later on.

In summary, Smart Home/Building concept refers to all buildings in general, commercial or industrial buildings, apartment buildings, private houses. Although the terms Smart Buildings and Smart Home are used interchangeably from time to time, difference re- mains. Smart Buildings refer to significant economic buildings (e.g., office buildings, shopping mall) with shared facilities, HVAC systems, and multiple users. On the other hand, the term Smart Home may, in principle, indicate private housing or any form of residence, for example, standalone house or an apartment, where fewer users are inter- acting with the system in a personalized environment. Thus, a smart home is designed to be adaptive and user-centered. Within this study, to simplify the concept, we account for Smart Home or Home Automation System (HAS) in the scenario of a single user.

Smart homes are residential units substantially integrated with a communicating network of sensors and actuators centrally connected and monitored by intelligent systems. Ini- tially, HAS monitors the energy consumption of home appliances and automating the process of switching on/off devices to maximize energy usage efficiency. Recent years, emerging new technologies and artificial intelligence have matured to the point where systems are becoming more intelligent, and objects can even communicate to human (D’Souza et al., 2018; Sri Harsha, Chakrapani Reddy, and Prince Mary, 2017). Back- boned by smart systems, HAS embraced significant potentials towards achieving comfort, security, independent lifestyle, enhanced quality of life while taking into account envi- ronmental impact. Smart home energy efficiency services assist homeowners in reducing energy demand, whether directly (through automated energy-saving mechanisms, such as lowering the heating on hot sunny days) or indirectly (e.g., by providing the user with centralized access to data about their real-time energy usage and energy bill) (Farmani et al., 2018).

Technologies rising provides opportunities for energy management features to be feasi- ble, however, according to the view of (Ford et al., 2017), it’s not clear whether these technologies are effective, as the field new and it is still currently being developed, and how well those can help managing energy usage with efficiency. The analysis of (ibid.) explores the range of smart home technologies currently available in the market and their mature level in practical application. While more and more technologies are available,

9 Chapter 2. LITERATURE REVIEW choosing which tools to use depends greatly on the engineers point of view, usually sub- jectively. The variety of smart home ecosystem also effect its ability to actually efficiently manage energy consumption (Demeure et al., 2015), for better or worse.

When put in connection with other surrounding fields, HAS plays a role of an enabler. Supporting those with disabilities with an accessible environment encourage development of assistive technologies. Wearable devices are in favor to provide more user contextual data, especially helpful in healthcare services. Developed in Japan, LifeMinder - a "wear- able health care assistant" - is an example of application of smart technologies in health care (Chan et al., 2009; Suzuki and Doi, 2001). Smart homes and health-care start to share some interest in common and future perspective on smart home systems can evolve as a home-based health care system (Chan et al., 2009).

From a user perspective, future of smart homes will involve more in user-related benefits such as assistive environment and health-care supportive applications. Current tendency in smart homes research is mainly about location-based recognition (Mainetti, Mighali, and Patrono, 2015), cloud based and smart phone supportive scalable system (Korkmaz et al., 2015), activity recognition and modeling user behaviors with the help of machine learning algorithms (Bouchard et al., 2018; Aipperspach, Cohen, and Canny, 2010; Roy et al., 2010), or knowledge-driven approach (Chen, Nugent, and Wang, 2012).

Apart from smart homes features study, interaction with the system is worth paying at- tention. Although possibility to remote control of smart homes is known widely as the main interaction method via traditional controller, there exists other possibilities. Several studies focus on voice command recognition (Principi et al., 2015), improving voice- based control of smart homes (Chahuara, Portet, and Vacher, 2017). The idea of (Prin- cipi et al., 2015) is that acoustic signals provide handy way to monitor user activity and they also enable hand-free human-to-machine interaction. Voice-based command systems have gained popularity. (Villanueva and P. O. Droegehorn, 2018) has conducted a study into using gesture to interact with home automation, expanding the sphere of human- machine interaction. The release of gesture recognition technologies - the LEAP Motion Controller - opened new frontiers for interacting with ICT system in different means.

10 Chapter 2. LITERATURE REVIEW

2.2.2 HAS - key challenges and social barriers

Smart homes enable users to be able to control home appliances even when they are away and provide with an opportunity to save energy costs. (Marikyan, Papagiannidis, and Ala- manos, 2019) reviews the potentials and benefits of HAS adoption and categorizes them by different aspects, for example, by health-related matters, by environmental benefits or affection on financial and psychological well-being benefits. Despite its benefits and increasing popularity, there are numerous challenges in the acceptance of smart homes by society. (Balta-Ozkan et al., 2013) summarizes the important barriers of smart home adoption into seven categories:

• The ability to adapt to user lifestyle where familiar behaviors need to be fitted. • Administration matter. • Interoperability between different smart home devices that may be made by differ- ent manufacturers. • Reliability of the system. • Privacy and security matters. • Trustworthiness of the system. • Installing and maintenance costs.

We review each of the categories and analyze the causes of barriers. (Marikyan, Papa- giannidis, and Alamanos, 2019) generalize these areas into three main groups of causes: technological issues, reasons involving financial (e.g., price of devices, installation cost), ethical matters (e.g., misuse of user data, conflict of interest between HAS providers and users), legal concerns (e.g., regulations to protect user data, lack of legal means and in- structions). Knowledge gap and psychological resistance are also considered to be the reason of the refusal towards HAS widely adoption.

(Shuhaiber and Mashal, 2019) reviewed factors that influence residents’ acceptance and usage of smart home by examining users’ personal factors (e.g., awareness and trust) on smart homes acceptance and intention to use it. The study findings show that users’ atti- tude towards accepting HAS is connected to the users’ awareness, perceived enjoyment and trust. Another study held by (Shin, Park, and D. Lee, 2018) found that compatibility and perceived ease of use had positive effects on purchase intention. However, as the number of including smart homes increases speedily, personal information is becoming more and more critical to be taken care of.

11 Chapter 2. LITERATURE REVIEW

In our research, we focus on HAS fit to the user’s home, current and changing lifestyle. From one side, smart home appliances should be ubiquitous and fit to the home design and environment. However, most importantly the HAS must fit with general routines of home owners. One of the evolving areas of integrating user routines into HAS is the context-aware computing approach (Hong, Li, and Jingxiao, 2013; Youngjae Kim and Dongman Lee, 2008). The context-driven applications consider user’s current situation to provide relevant services. The next section provides definition of context-aware systems and review existing context-enriched HAS.

2.2.3 HAS - Architecture

A typical smart home architecture is composed of four components (Balta-Ozkan et al., 2013): underlying communication infrastructure; smart command and management; a connected sensor network around the house; and automation services. Smart home ser- vices are the benefits that the smart home provides to the user (for example, the ability to manage demand, the mean to remotely control the house and connected devices or auto- mated actions that will be executed based on, mostly, fixed predefined schedule), which is enabled by the smart home’s network of connected physical components and network infrastructure. Services may be categorized according to the user’s needs they target, e.g., security, health, assisted the living, communication and entertainment, convenience and comfort, and finally, energy efficiency (ibid.).

Figure 1 shows the CASAS architecture – a project conducted by Washington State Uni- versity. This architecture (Cook et al., 2013) facilitates the development and implemen- tation of future smart home technologies by offering an easy-to-install lightweight design that provides smart home capabilities out of the box with no customization or training. Sensors implanted around the home read data on the surrounding environment and trans- fer to a central controller. Data from sensors is the input of intelligent-based systems (e.g., activity recognition, action discovery, positioning service). Any reaction to the HAS or information will be transferred back to the user through this network, controlled by the central manager.

A location-aware architecture for heterogeneous Building Automation Systems proposed by (Mainetti, Mighali, and Patrono, 2015) also follows the design principles of HAS. The architecture in Figure 2 can be divided into three major components following a HAS characteristics. At the foundation is a network infrastructure with smart devices possibly

12 Chapter 2. LITERATURE REVIEW

Figure 1: CASAS smart home architecture overview. Source: CASAS: A Smart Home in a Box (Cook et al., 2013) connected by various protocols (, RFid, Wifi). On top of this foundation is the management unit where they implement business logic specified by user. And an application layer with user interface allowing user to interact with the system. These designate choices allow for the scalability and flexibility of the HAS.

2.3 User Context and Impact of User Behavior in HAS

(Yang, H. Lee, and Zo, 2017) defined the user context as "any relevant information that can be used to characterize the situation of a user". According to (ibid.), user context is comprised of three critical aspects:

• User physical location.

13 Chapter 2. LITERATURE REVIEW

Figure 2: The overall architecture of a location-aware HAS. Source: A location-aware architecture for heterogeneous Building Automa- tion Systems (Mainetti, Mighali, and Patrono, 2015)

• User surrounding subjects (e.g., guests at home, co-user, children, people nearby). • User surrounding resources.

More specifically, user’s location or user profile and the current social situation can all be considered user context belonging to the first group. Surrounding resources can be humidity level or light level. User context especially has a significant impact on the effectiveness of a HAS.

Users’ lifestyle and habits affect the energy performance of home facilities directly. Hence, in the built environment, the user plays an essential and central role. Advanced smart strategies must first adapt to user behaviors while putting effort to maintain a certain level of commitment between energy consumption and user comfort (Felix Iglesias Vázquez et al., 2011). User Context Detection thus is well evolving as a renowned research topic and used in many different applications. It is well known how to use sensors to get parameters

14 Chapter 2. LITERATURE REVIEW from the users’ environment.

This source of data embraces huge potentials in coherence with machine learning on de- tection purposes, for example, to recognize user activity using machine learning methods, to detect abnormal behavior by profiling owner, etc. Having access to this user context data, with data provided by connected sensors, smart home security services might be able to enable monitoring ability of movement inside the home. Potential intruders are thus identifiable and alerted properly (Balta-Ozkan et al., 2013).

However, regardless of the sustainable aim to reduce energy usage in a smart home, user comfort cannot be neglected. The user has been, and should always be, the central of HAS system design. Most common components in the house controlled by HAS is the HVAC system. An example of a feature in context-aware HAS system is adjusting the heating system or controlling temperature in the house. (Felix Iglesias Vázquez et al., 2011) has pointed out that the smart system tries to establish pleasant conditions by adjusting the set-point temperature according to user comfort temperatures, presence of occupancy, and behavioral predictions. This study also listed common context-aware control strategies for energy efficient HAS.

• On/Off controller – switching on devices when people arrive home and switching them off when they leave the dwelling; • Scheduled controller – establishing comfort settings during the expected or regular building usage schedule; • Combined controller – setting comfort level based on schedule but adjustable with user context; • Fuzzy controller – predicting future occupancy based on external knowledge or machine learning algorithms.

2.4 User Context and HAS Integration Enablers

HAS platform provides the development environment and necessary tools to build the bridge between user context and HAS. The center of interest here is to study abstraction or high-level information from raw sensor data.

Table 5 presents comparisons between most well-known platforms for HAS based on the following features: support for user context extension, supported protocols, ease of use in

15 Chapter 2. LITERATURE REVIEW terms of connections and configurations, documentations.

Table 5: Compare context integration feature of HAS platforms.

HAS Context-aware sup- Supported protocols Ease of use Plat- ported features forms

Home CalDav: connect to Google APIs Support almost all common Assis- WebDav calendar and protocols to connect devices, tant generate binary sensors. especially easy to connect with Google Calendars. Google Calendar Yaml format configura- Modular components simplify Event: connect to tion the connection. Google Calendars and generate binary sensors. Fitbit sensor: to expose HomeMatic, ZigBee and Programming language: data from Fitbit to Home almost all common pro- Python Assistant. tocols Google Maps: to detect Organized and well-structure presence using the un- documentations with tutorials official API of Google and supported by an active Maps Location Sharing. community

FHEM Online calendars con- eQ3 specific: Home- Support for a lot of proto- nection supported. Matic, FS20, EM1000, cols used in house automation, etc. audio/video, devices, weather services, online calendars and more. Need to define and con- Most common devices: Notify to external program, e.g. figure external services LG, Philips TV; Alexa, WhatsApp. explicitly. etc. Modular architecture, easy to add special devices. Programming language: Perl Documentation is available in English, but mostly in German.

OpenHab Google Calendar HomeMatic, Bluetooth Ability to integrate a multitude of other devices and systems. Wire, z-, wifi Has its own set of concepts, rules and scripts. Common devices: LG, Programming language: Java Philips, etc. Open source with a strong com- munity, well structured docu- mentations

16 3 RESEARCH METHODOLOGY

It is, to the authors, critical to understanding the aims of research clearly to determine and choose the appropriate approach to achieve research’s objectives. (Williams and Babbie, 2006), identified research methodology as: “systematic and orderly approach taken to- wards the collection and analysis of data so that information can be obtained from those data.” In the quest of finding a possible solution for our topic of interest, Design Science Research methodology best reflect our nature of research; thus, we follow this approach to conduct the study. In this chapter we will discuss research approach and process with details.

3.1 Design Science Research

Design Science Research (DSR) refers to the approach using "design as a research method or technique" (Vaishnavi, Kuechler, and Petter, n.d.). Figure 3, presents steps from which different tasks and studies have been conducted to achieve an incentive outcome, thus as a whole serving the overall goals. The work reported here is a practical case inspired by the study of "Design Science Research in Information System" introduced by (ibid.). The process is composed of five main stages: problem definition, conceptualization, design and development, evaluation and conclusion.

Identify problem is the starting point and motivation for the whole study process. We keep this problem definition in the central of all the following steps. After clearly define our research scope, the concept model is built upon the first perception of the targeted issue. This step can be considered as a buffer to foster the design and development of the solution. Evaluation of the designated model is the next step to validate and verify our solution. We used an iterative process of refinement and modification. Circumscription1if discovered is used to improve the design until we reach some level of satisfaction that is performance ready. A final evaluation should be conducted to evaluate our solution based on efficiency improvement and user perception factors, from which we draw conclusion

17 Chapter 3. RESEARCH METHODOLOGY

Figure 3: Design Science Research Methodology. Source: Design Science Research in Information Systems (Vaishnavi, Kuechler, and Petter, n.d.) and discussion as an endpoint of this study.

1Circumscription is discovery of constraint knowledge about theories gained through detection and anal- ysis of contradictions when things do not work according to theory (McCarthy, 1980)

18 Chapter 3. RESEARCH METHODOLOGY

3.2 Research Process

In this section, we present the main phases in the research process, including the focus and outcome of each phase. We also mention the connection of these phases, outcome of one phase can be used as income of the next phase.

Problem Identification

During this phase, we investigate the state of the art (e.g., literature review) concern- ing two fields of research: home automation and user context, existing issues as well as available solutions and implementations. It is discovered that both research fields attract high attention and quite a lot of applications. Among the cases, the most popular ways of using user data are from home integrated sensors and activity/state recognition from sensor-level data, such as motion detector, smartphone accelerator. However, a joint res- olution of interpretation from high-level user data (not directly coming from sensor level) and practical implementation in HAS is somehow missing. Our research approach starts with defining and understanding what problems we are trying to solve, thus, looking for a meaningful solution. From these findings, we identify our research scoping and establish the context where the inquiry should focus on. The output of this phase is a clearly defined research context - a "proposal" which will then be used as the input for building a concept modal of such integration. At the end of this phase, research questions and delimitation have been clearly defined to reflect our research goals, as described in the Introduction section.

Conceptualization

The Conceptualization phase immediately follows the proposal and is intimately con- nected. The idea is developed based on the awareness of our identified problem. A possi- ble outcome of this phase is a tentative design where we select user attributes for further analyzing. This conceptual model is the early stage of a system design that we will then set up and implement. This phase is important for transitioning requirements into sys- tematic descriptions. Moreover, some tentative ideas become obsolete and new concepts evolve during this stage after primitive analyzing. We also investigate and define system specifications during this phase, which set a scope for system design.

19 Chapter 3. RESEARCH METHODOLOGY

Design and Development

The Tentative Design is further developed and implemented in this phase after investing a considerate amount of effort in assessing related ideas. To make sure the proposed solution is technically possible in a specific use case, we explore different HAS platforms in term of context integration supported features to select the most suitable items for a system implementing. An abstract architecture to integrate user context into HAS is carefully designed. As part of this phase, we also develop an implementation applying the architecture within the German context. "Design and development" is usually considered the most critical phase where practical aspects of our presumptions are verified, and it also forms a premise to evaluate the efficiency of the proposed solution.

Evaluation

Once constructed, the architecture we proposed needs to be evaluated according to "cri- teria that are always implicit and frequently made explicit in the "Problem Identification" phase" (Vaishnavi, Kuechler, and Petter, n.d.). To achieve our listed research goals, we decided there is no better way to evaluate an improvement by comparing with existing solutions. Due to the nature of HAS, the scenario attributes, including user relevant at- tributes such as living condition, social standards, etc., of the installed HAS, affects its efficiency in multiple ways. As an outcome of this phase, we carried out a heuristic mea- surement in terms of energy efficiency and compared with measures of a typical German use case (Sarmento et al., 2017). Regarding user adaption aspect, we conduct a survey to evaluate user perception when it comes to integrating their privacy and willingness to adapt to such systems.

Conclusion

The conclusion phase marks a milestone of our research. We review the results deriving from the study and validate the revised theoretical base. By examining the work and verify all research goals, we also discuss the contributions of this study, future research potential and the quality of our solution in different aspects: technical, sustainability and environmental.

20 4 SYSTEM DESIGN AND DEVELOPMENT

This phase of the research focuses on defining system specification and use case, hence build up the possible system architecture. We investigate automation platforms, user con- text dimensions, and ways to integrate them into an overall structure where contextual data is efficiently leveraged. This section is thus organized in the following order to describe the process: system specification, technology stack, system architecture, and application development.

4.1 System Specification - German Use case

To verify the practical aspect of the proposed user-context enhanced smart home system, we need to define specific parameters and metric base as a foundation to implement, thus, validate system usability. The study leverage available study on the fixed model in HAS to compare upon, more precisely - German use case. In this section, we present specifications of a typical schedule according to the German lifestyle and the scenario where our implementation is built upon. This task aims to scope and expose a clear view of the referenced use case, hence provide scoping for system evaluation afterwards.

Inspired by (Sangogboye, O. Droegehorn, and Porras, 2016) study, we present require- ment specification adapted to a single-occupant apartment. Activities are scheduled based on a weekly basis. The requirements for smart home strategy are influenced by user be- haviors and user expectations from the system. As a result, HAS is expected to maintain system efficiency in term of energy usage and ensure liable level of user comfort at the same time. To simplify our scenario, we don’t consider in-house user recognition and motion detection strategies.

User requirements

• User wants to have full control over the smart home system where he/she is, whether at home or away.

21 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT

• The automation system should provide a comfortable living conditions when user is at home. • The system helps to manage the energy usage of home appliances in an efficient way.

Fixed-scheduled specification

• Occupant leaves and arrives home following a schedule during weekdays (5days/week). • House will be fully occupied during weekends (2days/week). • Occupant leaves home at 8:00 and arrives at 17:00. The heating system is expected to start heating/cooling at least 30 minutes before occupant gets home, which is at 16:30. • All lights are expected to turn on at sunset only if user is at home. • Occupant goes to sleep at 23:00, all lights are turned off after this time.

The system aims at analyzing gathered user-context data, thus, react more semantically meaningful to out of the ordinary user behaviors. For this enhanced strategy, we consider the following context-enriched user scenario.

Context-enriched scenario

• System has access to occupant’s calendars and events, including: start and end time of an event, location of an event. • User has wearable tracking devices with contextual information: activity mode, heart-rate, sleeping mode. • Location tracking is enabled from user’s device.

Context-enriched specification

• During weekdays, if user has any event scheduled, system should estimate time to arrive home from the event location and adjust the devices switching on/off automa- tion accordingly. • During weekends, for any extra activities, recalculate when occupant is at home and adapt. • Start heating/cooling system at least 30 minutes before occupant gets home, adapted to scheduled events if any. • All lights are expected to turn on at sunset only if user is at home.

22 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT

• Turn lights off at sleeping time, using more accurate sleeping state from tracking device.

User Comfort Requirements

• In-house temperature and humidity level should be maintained at a comfortable level. • Energy usage and improvement from automation information should be easily ac- cessible. • A convenient level of control over all devices at home.

4.2 Technology Stack

Before diving into the system architecture and implementation, in this section, we present a clear overview of the technology stack that has been utilized. It is essential for system development to pick the right combination of underlying tools and technologies. We leverage Home Assistant as the primary platform for development, along with smart home devices (e.g., lights, thermostat), sensors, smartphone, and wearable device. Contextual data sources such as calendar, health, location are included as part of the system and are discussed with more details in the System Architect section. Figure 4 presents the combination of technologies that have been studied throughout "System Development" phase, comprised of programming language, platform, network infrastructure setup, and software underneath.

Home Assistant

Home Assistant is an open-source home automation platform built and run from Python, considered the world’s biggest open-source home automation platform with an active and strong community of developers and users. Home Assistant provides three main modules (see Figure 5) to support smart home system: Home Control, Home Automation and Smart Home.

• Home Control, which is supported by Home Assistant Core, is responsible for col- lecting all information and controlling connected devices. Home Control plays the role of a communicating gateway between devices and automation strategy.

23 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT

Figure 4: Technology Stack.

• Home Automation triggers commands based on information transported within the system and user configurations. • Smart Home refers to the smart handler which triggers commands based on past behavior.

Figure 5 explains the full picture of how different factors fit in Home Assistant platform. User interacts with the system through a user interface and can initialize custom con- figurations, while different modules interchange information back and forth with each other using standardized data structure and set of commands. Home Assistant Core is the primary channel where smart strategy is handled, made possible by four parts: State Ma- chine, Event Bus, Service Registry, and Timer. Each entity supported by Home Assistant (e.g., devices, sensors, external services) has its state and attributes. State - the critical piece of information that links devices with the controller - is managed by State Machine, which keeps track of the states of things and fires a "state_changed" event when a state has been changed. Event Bus - the beating heart of Home Assistant facilitates the firing and listening of events. While Timer sends a "time_changed" event every second to the event bus, the Service Registry listens on the event bus for any "call_service" event and also allows external services to be registered. This structure also implies the event-driven

24 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT

Figure 5: Home Assistant Architecture. characteristic of Home Assistant, as defined in its documentation (Home Assistant, 2019)

"The Home Assistant core is event-driven. This means that everything that happens is represented as an event: a light being turned on, a motion sensor being tripped or an automation triggered. Each event has an attached context. The context can be used to identify which events have been triggered as a response to other events, which user triggered the original event and with which authentication."

Dynamic DNS and Port Forwarding

Initially, Home Assistant is installed on Hass.io and is only available within the inter- nal network. Working Home Assistant server from the local network poses no issue; however, it is inaccessible from the outside world, which, in our connected society, is

25 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT non-neglectable. To open up a remote connection to the server for development flexibil- ity, we apply dynamic DNS and port forwarding on the router to make the accessible behind NAT. This technique is made even simpler with Home Assistant native component - DuckDNS - a free dynamic DNS service that allows us to point a subdo- main under .duckdns.org at our home assistant server, more specifically, we can map the private IP address of the home assistant server to a free-of-charge .duckdns.org domain. After having a public domain, we need to change the router setting to allow external re- quests to traverse through the protected network. Port Forwarding is the technique in computer networking that allows remote nodes to connect to specific nodes (computers) or server behind LAN.

Figure 6: Network port-forwarding setup.

Figure 6 demonstrates the network setup to allow the home assistant server to be accessi- ble from outside the network. Supported by DuckDNS, we can register a free domain and map this domain to our public IP address. As a result, the home assistant server can be visited from any computer with internet connection via the registered domain, and it will point to the server standing behind NAT. This setup simplifies the developing process, and it is more likely to be a realistic setup where a user can remotely interact with the server without having to be in the same network.

Frontend Platform Services

Home Assistant comes with a powerful frontend tools to develop client application for user to control and monitor smart home system remotely. The frontend is built with Poly- mer - a web development toolbox that provides modern libraries and handy components.

26 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT

Our approach configure frontend application on top of this layer using configuration sup- ported by Home Assistant - in yaml format. The control flow is also implemented on top of this platform, every logic is set up through yaml configuration.

4.3 The Proposition

According to the research motivation that was described in the previous section, regard- less of the fact that studies have shown possible solutions to build a HAS using different technologies, sensors, and smart devices, an overall integration with user-centric con- textual data is still missing. Thus, in this section, we propose an overall architecture to integrate the actual context of users into HAS in a sound way that can benefit from con- textual data and the ability to automate energy monitoring process provided from a home automation platform. The proposed architecture is inspired by a standardized design for development and implementation of future smart home technologies (Cook et al., 2013) which enable remarkable easy-to-install features. An overview of the overall architec- ture is shown in Figure 7. The infrastructure substantially consists of four main sections: Physical Appliances, IoT Hub, Context Builder, and Reaction Dictionary.

Physical devices refer to home appliances (e.g., heater, refrigerator, ventilation controller, air conditioner, etc.), smart lightbulbs, smart meters (e.g., thermostat) and sensors (e.g., motion detector) installed in a HAS that are connected to a controller through various protocols, for instance, ZigBee, Bluetooth, Wifi, and so on. The connected devices and data from sensors are centrally managed and monitored by an IoT hub. There are quite many different platforms that support these functionalities. Each of the HAS platforms has its structure and protocol to manage connections to external devices and services. The most common method is through API and HTTP protocol.

A typical structure of a HAS platform should support a user interface for the user to inter- act with the system, including monitoring and remote controlling devices. Apart from pre- defined UI provided from the platform, most HAS platforms support external application building through API. Another vital component within an IoT hub is the scheduler. The scheduler refers to user-defined events to switch on and off devices at a specific time usu- ally based on daily, weekly, or monthly schedule and depends on the living environment. For example, the scheduled controller establishes comfort temperatures (standard-based) during the expected home usage schedule. It is common in office buildings, or even in

27 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT

Figure 7: An overall architecture of user-context integrated home au- tomation system. houses where inhabitants do not want to be bothered with or usually neglect the manual heating/cooling adjustment. According to (Felix Iglesias Vázquez et al., 2011), the en- ergy performance is generally rather weak, but comfort ratings are satisfactory provided that people are at home during the scheduled time.

Context Builder component is in charge of processing high-level data from accessible contextual user data. The output of this module can be knowledge which the designer uses to decide corresponding reactions or adaptions. Besides predefined knowledge base (built upon surveys or specific use case of a particular country, region or neighborhood), machine learning algorithms such as classification, fuzzy prediction are fit in this module to provide more meaningful knowledge out of low-level sensor data. Separating the con- textual builder to be a dependent functional module enhance flexibility and scalability. It is thus auspicious to apply different techniques and achieve more meaningful information out of the same data set.

However, the extracted information from different sources can be in various format which produces obstacles in finding a way to integrate as a consolidated system. It is critical to have a unified format of the output in which the context-enhanced system recognize

28 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT and adapt without any confusion. The nature of smart home is automated process on controlling operation mode of devices based on a set of conditions, known as a rule-based activity. A rule should contain adequate information to tell the system what to do and when to do something meaningful. Such rule appears in this form: If then

Reaction Dictionary contains a set of rules in the above format. Actions are organized corresponding to specific user context. In this design, the dictionary can be built inde- pendently, which brings the benefits of further extensions or capability to integrate into other systems. This knowledge structure is organized as a rule-base dictionary, in the form of A B, where A is context-aware conditions and B is system reaction. In the con- ! cept model, we separate this module and the Context Builder module due to the purpose of use, however, in the implementation phase, the reaction dictionary can be considered the output of this context builder as they could be closely connected in term of technical implementation.

Most of the home automation platform has strong support for implementing automation scripts following their specific instructions. Home Assistant is built upon Python, thus offers all powerful tools that Python has to offer. With current support, there is, unfortu- nately, no platform-independent way to implement smart strategy for a HAS. What these platforms support in common are multiple triggering techniques. The most common trig- gers are time-based, location-based, and event-based. All these activities happen within the IoT Hub component, where the devices should be connected and made controllable under supervision of the automated system. With the support of IoT platform, connecting multiple smart devices are doable regardless of communication protocols. The most used protocols in the market that can be mentioned are ZigBee, Bluetooth, and HomeMatic.

Follow this proposed architecture, we develop an overall smart home system where actual user context is analyzed and integrated as part of the system, forming a fully functional HAS. The implementation adapts to single-user scenario within German use case with specifications described in the previous section.

29 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT

4.4 Application Development

Application development section presents the implementation of the system design that has been introduced previously. We describe the prerequisites to set up a smart home installation, including both hardware and software parts. The second part of this section talks about specific scenarios that are implemented in detail.

4.4.1 Prerequisites

We need a few things to get started with the smart home installation, the followings are hardware and software setup suggested by Home Assistant that we use in our implemen- tation.

Hardware

3 Model B+ + Power Supply (at least 2.5A) • SanDisk SD Card 32GB. • Router and cable. • iPhone 8 with "Find My iPhone" enable and granted access to GPS location. • Smart light, switch and thermostat.

Sensors and software

• Sun sensor supported by Home Assistant built-in demo platform. • Weather sensor with data source provided by The Norwegian Meteorological Insti- tute "met.no". • Integration sensors to connect with external services.

4.4.2 Scenarios

We have implemented various scenarios which consider multiple user context dimensions. Table 6 lists all implemented scenarios in association with external services and user context dimension.

Scenario 1: Reschedule switching heater ON based on calendar event

30 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT

Table 6: Implemented user-context integrated scenarios.

Scenario User context External services

S1 - If occupant has scheduled event af- • Calendar event Google Calendar ter 5PM, turning heater ON only after • Location iCloud tracking service user gets home • Time to home Google Distance Matrix

S2 - If occupant leaves home before • Calendar event Google Calendar 8AM, turning heater OFF right after • Location iCloud tracking service user leaves • Time to home Google Distance Matrix

S3 - Calculate estimated time of arrival • Location iCloud tracking service (ETA) to home using user context at- • Travel mode Google Distance Matrix tributes: location and travel mode

S4 - Turn all lights off when user actu- ally falls to sleep using data from health • Sleeping mode Fitbit tracker device

The activity diagram of the whole flow is shown in Figure 8 - left panel. Occupant’s calendar is linked and updated at a defined frequency. The Home Assistant server creates an entity to store the nearest event as user context data - referred to as a "sensor". The calendar entity is associated with a state object, which stores essential information of the event itself, e.g., start time, end time, location, and description. The calendar state is turned ON whenever there is an ongoing event, which indicates that the user is possibly attending the event at a specific location. We extend the fixed schedule to adapt to this abnormal behavior through a smart action plan in Home Assistant, called automation.

Automation is set up to listen to any change event of calendar and act whenever all con- ditions are met. Automation and triggers are handling simultaneously, the action takes effect when any (OR condition) or all (AND condition) criteria are satisfied, other fixed schedules, if any, are uninterrupted. Figure 9 shows an influence diagram of components in Home Assistant, based on Scenario 1. In this case, state object, or sensor entity in Home Assistant term, represented by oval nodes in the diagram, indicate the inputs for the implemented automation. Rectangle nodes represent hardware devices connected to the smart home system.

Scenario 2: Reschedule switching heater OFF based on calendar event

31 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT

Figure 8: Activity diagram of the automation on thermostat based on calendar event (S1 - S2).

Figure 9: Influence diagram of Home Assistant Components.

For a fixed schedule in the context of German use case, the occupant leaves the house at 8AM, and the heater system should be turned off by then. Adapt to user context for this

32 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT scenario, smart home should turn the heater OFF if the inhabitant leaves earlier than that point, whenever there is an event detected that starts before 8 AM. We demonstrate the automation setup with an activity diagram on the right panel of Figure 8. The interaction between Home Assistant components is the same as shown in Figure 9 where calendar event, location, and time range context values have been used. To define a specific point of time, in this case, 8 AM for morning and 5 PM for afternoon scenarios, Home Assis- tant built-in component "Time range" has been used. Figure 8 also demonstrate the way multiple automation are acting independently with each other while still have interaction with shared components.

Scenario 3: Calculate estimated time of arrival (ETA) to home using location and travel mode

Smartphone and wearable device are not unfamiliar in the recent years. User’s activity mode can be detected using these modern devices. User is more aware of their activity and health state us with the tracker. We can utilize these tracked data to improve how the smart home prepare for a proper state before the user arrives home. We implement this scenario to improve the accuracy when estimating the time it may take for the occupant to get home taking into account multiple inputs: current location of the occupant, traveling mode to get home, if no traveling mode is detected, use the most frequent one as default.

Figure 10: State diagram of estimating time to arrive home based on driving mode.

Scenario 4: Turn all lights off when user actually falls to sleep

This scenario is built for improving the level of comfort where the actual time that the user falls asleep is taken into account. We use a Fitbit tracker device to sense the time occupant falls into sleep. For a fixed schedule scenario, this sleeping point is set to be 11 PM. However, in reality, this sleeping point is slightly different and depends on user habit. The original context thus should be taken into consideration. In terms of energy usage, it is significantly efficient only in some instances where the user time to sleep goes

33 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT after our scheduled time. This scenario is a demonstration for a smart strategy where a balance between user comfort and energy efficiency is carefully considered.

4.4.3 Implementation

We use Home Assistant as the smart home platform to build up the system. Smart strategy is well supported by components and automation in Home Assistant. Here we explain the main concepts in Home Assistant that have been applied

Components

Components refer to external services and third-party tools that can be installed to sup- port the connection or integration of smart devices, web services and computing utilities. Home Assistant supports 1400 components grouping into 24 categories.

Automation

Automation is the component that allow automating actions to be implemented. An au- tomation configuration consists of three different parts: a trigger, a condition and an ac- tion. For example, an automation to "turn the lights in the living room on when user arrive home after sunset" scenario is implemented as an automation inside Home Assistant, for example:

(trigger) When Occupant arrives home (condition) and it is after sunset: (action) Turn the lights in the living room ON

• Triggers define events that will trigger the automation configuration. An automation can have multiple triggers defined, in this case, the automation is executed when any of the trigger is fired. Table 7 summarized different types of triggers. • Conditions are optional tests that can limit an automation rule to only work in some specific use cases. • Third line is the action, which will be performed when the trigger rule is fired and all conditions are met. Action can be of any event types: a service call, a value update command, a notification, etc.

34 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT

Table 7: Supported trigger types in Home Assistant platform.

Trigger Type Description Event Triggers when an event is being processed. Home Assistant Triggers during starts up or shuts down state of Home Assistant. Time The time trigger is configured to run once at a specific point in time each day, with multiple ways to filter time range.

Numeric State Trigger when numeric value of an entity’s state crosses a given threshold. State Triggers when the state of a given entity or component changes. Sun Triggers when the sun is setting or rising, i.e. using the sun elevator value. Template Work by evaluating a custom rule defined by Home Assistant template on every state change for all of the recognized entities, fire if the state change causes template to render ’true’ Geolocation Geolocation triggers can trigger when an entity is appearing in or disappear- ing from a zone.

The actual implementation is presented in Figure 11 with four main modules. This struc- ture reflects how the proposed overall integration described above is implemented in a solid platform which considers multiple user context scenarios. To simplify the imple- mentation and focus in handling user context data, we utilize built-in components that Home Assistant has to provide for common sensors and actuators, for instance, switch, thermostat, and smart lights. The main goal is to observe the changes and reactions ac- cording to specific scenarios. No motion detection and activity recognition processes are applied except for contextual data gathered from sensors and actuators included in the mentioned infrastructure.

Source codes for automation are provided as Appendixes for reference. Corresponding to four of the defined scenarios, we implement rule sets (which is called automation in Home Assistant) in the system and observe the system performance and efficiency in terms of energy saving. A front-end application is also included with two authentication modes: user and admin for the purpose of configuring the system and view as a user, built to be mobile friendly. We include a couple of views on two separated authentication mode to present an overview on the look and feel.

Besides user-context focused functions, we also include functionalities for general pur- pose. These features are essential to provide a user with an overview of a smart home system. Main features are categorized into three groups based on the functionality. The

35 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT

Figure 11: Infrastructure of the user-context integrated system.

first group (presented as the first tab in the UI - Figure 13) consists of general information, e.g., weather forecast, lightning status, devices state, or room temperature. The second group includes information on devices inside the home, where the user can see and con- trol these devices remotely (Figure 14). Information related to the user profile is shown in Figure 15 belongs to the third functionality group.

Figure 12: Admin user interface view on desktop with full control.

36 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT

Figure 13: User interface for general information - admin.

Figure 14: User interface for home status - admin.

Different views for normal user mode are shown in Figure 16. Under user’s mode, the functions are limited (Figure 16a) to: overview, map, logbook, history and mailbox. Other settings and developing tools are hidden to user, thus, secure system’s integrity. Compar- ing to menu shown in Figure 12, we can see this difference. While admin have full control

37 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT

Figure 15: User interface for profile information - admin. and access to system configuration, normal user only has access to limited resources.

38 Chapter 4. SYSTEM DESIGN AND DEVELOPMENT

(a) Restricted menu - user mode. (b) Info view on mobile - user mode.

(c) Home view on mobile - user mode. (d) Profile view on mobile - user mode.

Figure 16: User interface on mobile for normal user’s view. 39 5 EFFICIENCY EVALUATION

In this chapter, we present outcomes of the whole research process and evaluate these find- ings to verify that our problems identified in section 1.2 have been explored and solved. In the second section of this chapter, we evaluate the system efficiency in terms of energy usage to validate the system has been improved using user context effectively.

5.1 Outcomes

It is important to look into the outcomes of this study to evaluate its contribution values. The direct outcome is an overall architecture to integrate user context into a smart home system, where the central manager receive actual context data and be able to react based on different preference. Implementation of such model bring to the world a proof of concept of how to fit technologies into theoretical research model. We discuss these two outcomes in the next two sections.

5.1.1 Overall architecture to integrate user context

An overall architecture to integrate user context into a home automation system is pro- posed with clear structure and communication flow between segments. By distributing elements as independent modules, we advance the flexibility and scalability of the whole system in general and of each component in particular. This architecture inherit from existing studies in the field and focus in ready-to-implement aspects of smart home in- frastructure.

As mentioned in section 4.3, a smart home system is comprised of indispensable com- ponents, which are: a connected network of sensors, actuators controlled by a central management unit and automated functional program. Extended from this skeleton come other components. Most of the existing architecture of HAS follow this structure. We can see clearly by looking at the CASAS architecture (Cook et al., 2013) mentioned above.

40 Chapter 5. EFFICIENCY EVALUATION

Applications (such as activity recognition and activity discovery) are built on top of an infrastructure of smart devices. These sensors and actuators are connected via ZigBee bridge. In the center of the architecture stands a publish/subscribe manager. All exchange of information and actions are passing through this module.

Proposing an architecture at overall and abstract level, at the same time following the principles of a HAS system help drawing a big picture of an instructed and practically motivated architecture. User context is seen not as an external data source, but rather an integral part of the system.

5.1.2 Proof of Concept

The implemented system demonstrates the practical potential of the proposed overall user context integrated architecture (presented in section 4.3) using certain technologies. In particular, the following architectural components are currently implemented and vali- dated as a distributed infrastructure: the user context extraction module, the IoT hub that connects devices and implements smart strategies considering user context, the user in- terface or system gateway for user to interact, and the adaptive semantic reactions to user contextual data.

• Context Builder outcomes a set of rule-based reactions, explained as implemented scenarios. • Smart home system put to use Home Assistant platform and context-aware services, including personal calendar events, occupant location based on device tracker, and wearable devices - also known as a fitness tracker. • Reactions of the system implicated on changing the state of devices in specific scenarios are implemented and made possible to observe through an advantageous user interface thanks to Home Assistant modernized UI support.

The primary choice of Home Assistant platform is due to its powerful development tools and fully supported modern UI, but most importantly, the ease to work with contextual components, especially services from Google Cloud Platform. Home Assistant facilitates the integration process with various built-in components. In our approach, we used two services for calculating ETA to home in the two most common modes of travel, one for driving mode and another for walking mode. Usually, the Google Distance Matrix API provides travel time for four different travel modes (driving, bicycling, transit, or

41 Chapter 5. EFFICIENCY EVALUATION walking). However, Google now requires billing to be enabled (and a valid credit card loaded) to access Google Maps APIs. The free service is limited by one entry per day. We decide to conduct two different services for two travel mode to simplify the process and also to make the system work smoothly.

Home Assistant is considered the biggest open-source home automation platform with a growing and active community. The study thus contributes to the discussion of a use case within scientific research. As a result, we demonstrate a thorough process, from network infrastructure setup to configure a remotely controllable smart home server. As an indirect extraction from this process, we also introduce a potential technology stack for such a use case. Different technologies are facilitated. Moreover, the general purpose has been kept at the core of design and development attention, which is to improve the system efficiency in terms of energy usage. From this core concept, we only investigate related scenarios.

5.2 Evaluation

Our ultimate goal is to improve the efficiency of the smart home system in terms of energy usage by adapting to the user context. As stated, home automation strategies are usually being done based on a daily or weekly basis thanks to fixed schedule mechanism offered by most of the HA platforms. Adapt meaningfully to different context of users can sig- nificantly improve the effectiveness of a system; however, in unusual conditions. This sort of behaviors are noted to be unpredictable and usually, don’t follow a periodic basis. For this matter, we carry out experiments to evaluate the implemented model bearing this concern in mind.

5.2.1 Evaluation in terms of energy usage

For HAS, the system effectiveness is reflected by the amount of energy that can be reduced with active smart strategies. Hence, we select fixed schedule smart plans as specified in section 4.1 as the comparative basis. The point of this phase is to verify the role of user context in improving efficiency. Power or energy consumption is primarily affected by the period devices are in use. By shutting down the appliances while not in use, we suf- ficiently save to-be-wasted energy. In this sense, increasing the time power-consumed

42 Chapter 5. EFFICIENCY EVALUATION devices in off or standby mode will reduce the energy usage at a certain amount. Experi- ments and observation are made based on specifications of German use case. We presents results in two main groups of appliances: heating/cooling system and lights.

(a) Heating/cooling system is turned OFF at 8AM daily. (b) Heater is turned ON at 4:30 PM daily.

Figure 17: History graph of heating/cooling system status on a fixed schedule scenario.

Switch on/off heating or cooling system by controlling the thermostat

Consider thermostat controlling, as shown in Figure 17, in fixed schedule scenario, the heating/cooling is turn on/off at a specific point of time during the day, which is 16:30 (4:30 PM) and 8:00 AM respectively. For out of ordinary circumstances, the system effi- ciency can benefit from abnormal reaction if events happen out of this normal functioning range, for example, if the occupant has an event scheduled at, for example, 7 AM, which indicates that the occupant will leave house at an actual time around 7 AM, one hour earlier. In this case, the amount of energy user can save is calculated as follow:

P_saved =(8 Actual Leaving Time) (Heating/Cooling Energy per hour) ⇤ (Actual Leaving Time < 8) (5.1)

Similar logic applied to the case where user may get home later than they use to, which leads to:

P_saved =(Actual Arrival Time 16.30) (Heating/Cooling Energy per hour) ⇤ (Actual Leaving Time > 17) (5.2)

The study only considers cases where ETA to home is after 17:00 due to the specification that heating or cooling system should be turned on at least 30 minutes before arrival for

43 Chapter 5. EFFICIENCY EVALUATION user comfort. An interesting notice from this evaluation is that the energy that can be reduced is proportional to the difference between abnormal behaviors and normal behav- iors. In another word, the calculations indicate that the more difference the user unusual behaviors, the better adaption the system can reach.

Follow the same principles, we conduct experiments in within a limit of one week to ob- serve the reaction of system, where user occurs to have events scheduled at different point of time that can affect the schedule of heating or cooling system. The event specifica- tion of test cases are shown in Table 8. According to this, we present observed results in Figure 18, Figure 19, and Figure 20 corresponding to three test cases described in the following table.

Table 8: Events extracted from user’s calendar.

Event Date Start time End time ETA to home (mins) E1 2019-06-02 07:00:00 09:00:00 - E2 2019-06-03 18:00:00 20:00:00 30 E3 2019-06-04 13:00:00 14:30:00 -

Figure 18 shows the on/off period of the heating/cooling system according to fixed sched- ule from date 01.06.2019 to 05.06.2019. Every day the heating/cooling system is turned off at 8:00 in the morning when the occupant leaves the house and turn on at 14:30, 30 minutes before the time that the occupant is supposed to be at home.

In Figure 19, we observe this process with user context integrated plan enable. In the case of E1 and E2, the time that user leaves the house and arrives at home affects the operation mode of the heating/cooling system. On the day that user leaves at 7:00, system is turned off at that point of time, instead of 8:00 as scheduled and stays off until 16:30.

And we have test case with E3, although user has event scheduled, the event does not af- fect the heating/cooling system because it actually ends before the heating/cooling system needs to be switched ON, which makes perfect sense in this case. Finally, we have the results as shown in Figure 20. The periods where appliances stays OFF longer reflects an improvement in energy consumption, in another word, we observe an improvement in the energy efficiency of the targeted smart home system.

Following the same principles, we achieve similar results in the case of controlling lights with and without considering user context. The difference in working periods of devices

44 Chapter 5. EFFICIENCY EVALUATION

Figure 18: On/off period of heating/cooling system - fixed schedule.

Figure 19: On/off period of heating/cooling system - context adapted. depends on the circumstances and is not fixed, in summary, can be calculated as:

P_saved =[(8 Actual Leaving Time) (Energy per hour) ⇤ +(Actual Arrival Time 16.30) (Energy per hour)] number_of_devices (5.3) ⇤ ⇤

Using parameters described in Table 8, we applied equation 5.3 to calculate the amount of energy can be saved in this specific scenario. In this case, the average energy consumed per hour for heating/cooling system is about 1.5 kW/h (Oasis Energy, n.d.). For German household, we assume user will have the heating system on from 16:30 until 8:00 next morning, which is equivalent to 15.5 hours/day or 15.5 7 = 108.5(hrs/week) the heating ⇤

45 Chapter 5. EFFICIENCY EVALUATION

Figure 20: Compare on/off period of heating/cooling system. system is in ON status (consuming energy). In our experiment, this ON time is:

T_heating_ON = 108.5 [(8 7)+(20 16.5)] = 104(hrs)

In normal circumstances, we assume only energy consumption during weekdays are dif- ferent because user stays at home during weekends, thus amount of energy that can be saved is: P_saved = 4.5 1.5(kW /h)=6.75(kW h) ⇤ Or in another way of expression, in this scenario, by activating user-adaptive HAS, we can save about (4.5/108.5)=4% of the energy consumption per week.

5.2.2 Evaluation in terms of carbon emission

Carbon emission reflects the impact in environmental aspects. Using Well-To-Wheels (WTW) methodology, (Moro and Lonza, 2018) has conducted a full Life Cycle Assess- ment (LCA) to estimate carbon intensity (CI) of the European countries relying on 2013 energy usage statistics. We picked up the carbon emission factor for Germany from this study, which is 558 (gCO2 /kWh) (CI of electricity consumed at household level) (ibid.). With the amount of energy saved calculated above, we get a conversion to the amount of carbon emission that can be saved on a weekly basis:

CO _saved = 6.75(kW h) 558(gCO /kW h)=3.8(kgCO ) 2 ⇤ 2 2 46 6 DISCUSSION AND SUSTAINABILITY ANALYSIS

This chapter is organized into two sections: (1) by reviewing research goals, we want to provide a summary of what has been achieved and discuss what could have done better; and (2) analyze the environmental contribution aspect of the study conducting a thorough sustainability analysis.

6.1 Discussion

We have approached to solve the problems identified in section 1.2 by proposing an over- all user context integration architecture. A prototype has also been developed to show case the practical potential of this approach. However, there is always space for improvements.

Another alternative solution could be approaching the problem from the other side of the story - user context. By focusing only on user context, study can find more ways to gather and analyze user context data, one of that can be, applying machine learning on larger data set. Useful information can be extracted from this way of problem approaching. Studies have been conducted in this area, but for most of the cases, machine learning is used for context (Vainio, Pensas, and Vanhala, 2014) and activity recognition (Mark, 2012). Harnessing the powerful tools of machine learning, we can discover behavioral pattern of users when they are away, from which prediction on how the system should react to certain cases can be well identified.

Space for improvements following this direction stands within the Context Builder mod- ule (Figure 7) where more user context dimensions can be expanded. Although not im- plemented, we had done research on different user context data, apart from location and scheduled events extracted from personal calendar. Wearable devices send data about user activity, especially if they are doing any sport. This kind of data is helpful to pre- dict the physical state of user when they get home, thus, system can adjust the level of comfort within home system. For example, if user comes back from doing sport, smart

47 Chapter 6. DISCUSSION AND SUSTAINABILITY ANALYSIS home system can adjust the room temperature to better suit the recommended level of thermal comfort based on user condition (Nicol and Humphreys, 2002). Supporting run- time adapt to user behavior will be necessary, following the research conducted by (Serral, Valderas, and Pelechano, 2010).

Modern wearable devices, or fitness tracker device like Fitbit, Apple Watch can measure more health-related matter, such as heart rate, sleep cycle, and step count. Analyzing and react to these contextual data will help the HAS significantly improve the interaction with user for their own comfort.

An interesting point worth mentioning here is to apply this model in a multi-user environ- ment. From the start, we simplified the specification to direct our focus into a big picture or overall architecture. However, the multi-occupancy living environment is different than what we have as a starting point. The difference can be about age, for example, for cer- tain circumstance, the system should react differently to children and adults. This means that the smart home system should be able to categorize its actor, to separate children from adults and react accordingly. This can cause more of an obstacle in case of dealing with children because they are sensitive subject, and more importantly, children are not equipped with smart devices like adults, thus, it is harder for the system to handle. Same issue can happen with the elderly, for which special rules should also be applied to smart home.

With almost totally different characteristics, applying such model to multi-user environ- ment could face new challenges: to accurately detect and distinguish user, to efficiently maintain user preference, to react meaningfully to various circumstances and versatile types of user.

6.2 Sustainability Analysis

In this section, we analyze the sustainability impact of our study inspired by (Duboc et al., 2019) and following special instructions written by (Becker et al., 2015). The proposed solution is fully analyzed and presented with systematic effects among five dimensions, viewed as aspects of sustainability impact: economic, technical, environmental, individ- ual and social. We look into three orders of effects in each dimension. First level is the direct benefits from the user context adaptive HAS - called immediate effect. Enabling

48 Chapter 6. DISCUSSION AND SUSTAINABILITY ANALYSIS effect includes gain arise from using the application or system over time. Effect that becomes persistent in a wider range is considered as structural effect.

Figure 21 presents a closer look of the analysis. We use arrows to express the consequen- tial connection between effects, meaning one action leads to another, forming a chain of consequences, despite of the dimension. For example, when user installs a HAS, the energy usage around the house will be better monitored, thus efficiently managed. An immediate outcome is that user can already save money from misused the utilities, this can be considered as first-level effect, or immediate effect at individual level. Over time, the user feels comfortable and sees the benefits of such systems, which leads to a certain level satisfaction that encourage the user to upgrade and improve the system, they spend more money on connected devices. We recognize such effect as enabling factor for the growth of economic in general, and for the smart home sectors particularly.

Although immediate effects are easier to recognize, as they represent what our system has to offer, it is important to realize the structural effects, which can bring long-term and permanent benefits, on larger scale. Technically speaking, the practical use of such system will eventually evolve to become an ubiquitous home automation system, with new standards and innovative technologies. For economic dimension, high demands of smart devices strengthens the smart home sector. The Internet of Thing sector has already been growing at enormous rate with massive estimated economic values (according to Business Insider Intelligence report) (Business Insider, 2019)

49 Chapter 6. DISCUSSION AND SUSTAINABILITY ANALYSIS

Figure 21: Sustainability Awareness Diagram.

50 7 CONCLUSION AND FUTURE WORK

This chapter is organized into four sections: (1) by reviewing research goals, we want to provide a summary of what has been achieved and discuss what could have done better; (2) environmental contribution aspect of the study; (3) sustainability analysis of the whole study before drawing a conclusion as well as potential future research (4).

7.1 Conclusion

The purpose of the study was to provide a sound way to leverage actual contextual user data to improve the effectiveness of the Home Automation System. Based on the scoping research, it is evident that reacting more meaningful to real user context enhance the efficiency of a HAS system in case of unusual behaviors. There exist quite many works in responding to abnormal user behaviors within HAS. However, most of them are done based on positioning and user activity recognition inside the house. This work has shown that integrating user context into smart home system improve energy efficiency if the system adapts in a meaningful way.

One of the most significant contributions of this work is that we proposed an extended ar- chitecture, in which the existing structure of a HAS is reused. A high-level contextual data structure can be built by different means, including predefined rules, machine learning, or prediction model. By separating this data structure, it increases the possibility for an external system to share user context knowledge base; thus, enlarge application potential.

The architecture has been proven possible with a proof of concept. A robust prototype provides a showcase of how to implement such an integrated system in reality, which is very significant to the context of HAS. The study utilized modern technologies and open-source smart home platform to develop the prototype. Looked back at the proposed architecture, it is rather straightforward where components are clearly separated. It may not be the ideal case in real life application but make perfect conceptual sense. User context is eventually closely involved as an integral part of the system. Sensors gather

51 Chapter 7. CONCLUSION AND FUTURE WORK information about surrounding environments and sense user activities, but behaviors are rarely justified only by this low-level source of data. By extending potential to extract knowledge from user behaviors, we enable smart home system to be more user-friendly and adaptive.

7.2 Future Work

As discussed previously, different user context dimensions should be taken into account to expand the scope of this study. Applied the architecture and the sample implementation, we should look into different types of context data, among which, health data extracted from wearable device is the most potential resource. From this source of data, we can identify the physical state of users when they get home when they get home, if the user has done any sport activity, and how much exercise they have been doing. And these analysis will decide which state of the house should be the best fit for user comfort. Water temperature can be adjusted to better fit after-activity human body, room temperature can also be set accordingly, and possibly different than a usual state. This direction of work is slightly towards adaptive to abnormal behaviors, which is an interesting and popular research area.

Although the results of our study are positive, its scope is confined within a single-user context, which somewhat restrains the use cases. Future research has plenty of space to extend from this ground. One possible direction is to extend such principles and model to a multi-user environment. This direction poses challenging in teaching the smart home to adapt to personalized context based on their preference, in other word, to differentiate each user and react to the various context of a distinguishable subject. As already men- tioned in section 6.1, dealing with multi-user environment can be taken as the next step in expanding the system. In order to achieve this goal, we need to identify different types of user and look into research of user recognition based on personalized characteristics.

Additionally, expanding the context builder module is another possibility to continue this work, where machine learning strength can be applied to learn from user behavior and develop an informative knowledge base to improve HAS energy efficiency. From this point, our rule-based dictionary can be extended. Cooperative with more user context dimensions, the smart home system is expected to contribute significant improvements for energy efficiency.

52 References

Aipperspach, Ryan, Elliot Cohen, and John Canny (2010). “Modeling Human Behavior from Simple Sensors in the Home”. In: Pervasive 6030.783, pp. 62–79. DOI: 10.1007/ 978-3-642-12654-3. Balta-Ozkan, Nazmiye, Rosemary Davidson, Martha Bicket, and Lorraine Whitmarsh (Dec. 2013). “Social barriers to the adoption of smart homes”. In: Energy Policy 63, pp. 363–374. DOI: 10.1016/j.enpol.2013.08.043. Becker, Christoph et al. (2015). “Requirements: The Key to Sustainability”. In: IEEE Softw. DOI: 10.1109/ms.2015.158. Bouchard, Bruno, Sébastien Gaboury, Kévin Bouchard, and Yannick Francillette (2018). “Modeling Human Activities Using Behaviour Trees in Smart Homes”. In: Proc. 11th PErvasive Technol. Relat. to Assist. Environ. Conf. - PETRA ’18. DOI: 10 . 1145 / 3197768.3201522. Buckman, A H, M Mayfield, and Stephen B M Beck (2014). “Smart and Sustainable Built Environment What is a Smart Building? What is a Smart Building?” In: Smart Sustain. Built Environ. Facil. Environ. Iss Facil. 310.13, pp. 92–109. Business Insider (2019). The Internet of Things Report. Tech. rep. Chahuara, Pedro, François Portet, and Michel Vacher (2017). “Context-aware decision making under uncertainty for voice-based control of smart home”. In: Expert Syst. Appl. 75, pp. 63–79. DOI: 10.1016/j.eswa.2017.01.014. Chan, Marie, Eric Campo, Daniel Estève, and Jean-Yves Fourniols (2009). “Smart homes- Current features and future perspectives”. In: Maturitas 64, pp. 90–97. DOI: 10.1016/ j.maturitas.2009.07.014. Chen, Liming, Chris D. Nugent, and Hui Wang (June 2012). “A Knowledge-Driven Ap- proach to Activity Recognition in Smart Homes”. In: IEEE Trans. Knowl. Data Eng. 24.6, pp. 961–974. DOI: 10.1109/TKDE.2011.51. Cook, Diane J., Aaron S. Crandall, Brian L. Thomas, and Narayanan C. Krishnan (July 2013). “CASAS: A Smart Home in a Box”. In: Computer (Long. Beach. Calif). 46.7, pp. 62–69. DOI: 10.1109/MC.2012.328.

53 References

D’Souza, Michelle, Nelsha Wilfred, Rochel Pereira, Thanya Rayen, and Aparna Telgote (2018). “Home automation using Internet of Things”. In: 2017 Int. Conf. Energy, Com- mun. Data Anal. Soft Comput. ICECDS 2017. DOI: 10.1109/ICECDS.2017.8389498. Demeure, Alexandre, Sybille Caffiau, Elias Elias, and Camille Roux (2015). “Building and Using Home Automation Systems: A Field Study”. In: End-User Dev. SE - 9 9083, pp. 125–140. DOI: 10.1007/978-3-319-18425-8_9. Duboc, Leticia et al. (June 2019). “Do we really know what we are building? Raising awareness of potential Sustainability Effects of Software Systems in Requirements En- gineering”. In: IEEE Int. Requir. Eng. Conf. IEEE Computer Society. Fagnant, Daniel J. and Kara Kockelman (July 2015). “Preparing a nation for autonomous vehicles: Opportunities, barriers and policy recommendations”. In: Transp. Res. Part A Policy Pract. 77, pp. 167–181. DOI: 10.1016/j.tra.2015.04.003. Farmani, Farid, Mehdi Parvizimosaed, Hassan Monsef, and Ashkan Rahimi-Kian (2018). “A conceptual model of a smart energy management system for a residential building equipped with CCHP system”. In: Int. J. Electr. Power Energy Syst. 95, pp. 523–536. DOI: 10.1016/j.ijepes.2017.09.016. Ford, Rebecca, Marco Pritoni, Angela Sanguinetti, and Beth Karlin (Oct. 2017). “Cate- gories and functionality of smart home technology for energy management”. In: Build. Environ. 123, pp. 543–554. DOI: 10.1016/j.buildenv.2017.07.020. Gartner (2012). Gartner’s 2012 Hype Cycle for Emerging Technologies Identifies "Tip- ping Point". Tech. rep. GeSI (2015). “ICT Solutions for 21 st Century Challenges”. In: Home Assistant (2019). Home Assistant Data Science. Hong, Zheng, Pan Li, and Wang Jingxiao (2013). “Context-aware scheduling algorithm in smart home system”. In: China Commun. DOI: 10.1109/CC.2013.6674219. Klimova, Alexandra (2018). “Systematic Literature Review of Using Knowledge Man- agement Systems and Processes in Green ICT and ICT for Greening”. In: Technol. Smart Futur. Cham: Springer International Publishing, pp. 329–344. DOI: 10.1007/ 978-3-319-60137-3_16. Kor, Ah-Lian, Eric Rondeau, Karl Andersson, Jari Porras, and Jean-Philippe Georges (2019). “Education in green ICT and control of smart systems : A first hand expe- rience from the International PERCCOM masters programme”. In: 12th IFAC Symp. Adv. Control Educ. ACE 2019. Korkmaz, Ilker et al. (2015). “A cloud based and Android supported scalable home au- tomation system”. In: Comput. Electr. Eng. 43, pp. 112–128. DOI: 10 . 1016 / j . compeleceng.2014.11.010.

54 References

Mainetti, Luca, Vincenzo Mighali, and Luigi Patrono (May 2015). “A location-aware ar- chitecture for heterogeneous building automation systems”. In: Proc. 2015 IFIP/IEEE Int. Symp. Integr. Netw. Manag. IM 2015. IEEE, pp. 1065–1070. DOI: 10.1109/INM. 2015.7140434. Marikyan, Davit, Savvas Papagiannidis, and Eleftherios Alamanos (2019). “A systematic review of the smart home literature: A user perspective”. In: Technol. Forecast. Soc. Change 138.August 2018, pp. 139–154. DOI: 10.1016/j.techfore.2018.08.015. Mark (2012). Classification Algorithms in Human Activity Recognition using Smartphones Mohd. Tech. rep. McCarthy, John (1980). “Circumscription-A form of non-monotonic reasoning”. In: Artif. Intell. DOI: 10.1016/0004-3702(80)90011-9. Moro, Alberto and Laura Lonza (Oct. 2018). “Electricity carbon intensity in European Member States: Impacts on GHG emissions of electric vehicles”. In: Transp. Res. Part D Transp. Environ. 64, pp. 5–14. DOI: 10.1016/j.trd.2017.07.012. Nicol, J. F. and M. A. Humphreys (July 2002). “Adaptive thermal comfort and sustainable thermal standards for buildings”. In: Energy Build. Vol. 34. 6. Elsevier, pp. 563–572. DOI: 10.1016/S0378-7788(02)00006-3. Oasis Energy (n.d.). APPLIANCE ELECTRICITY USAGE. Tech. rep. Poulson, David, C A Nicolle, and Magdalen Galley (2002). Review of the current status of research on smart homes and other domestic assistive technologies in support of the TAHI trials. Principi, Emanuele, Stefano Squartini, Roberto Bonfigli, Giacomo Ferroni, and Francesco Piazza (2015). “An integrated system for voice command recognition and emergency detection based on audio signals”. In: Expert Syst. Appl. 42.13, pp. 5668–5683. DOI: 10.1016/j.eswa.2015.02.036. Reinisch, Christian, Mario J. Kofler, Félix Iglesias, and Wolfgang Kastner (2011). “Thinkhome energy efficiency in future smart homes”. In: Eurasip J. Embed. Syst. 2011.1, p. 104617. DOI: 10.1155/2011/104617. Risteska Stojkoska, Biljana L. and Kire V. Trivodaliev (2017). “A review of Internet of Things for smart home: Challenges and solutions”. In: J. Clean. Prod. 140, pp. 1454– 1464. DOI: 10.1016/j.jclepro.2016.10.006. Roy, Patrice C., Bruno Bouchard, Abdenour Bouzouane, and Sylvain Giroux (2010). “Possibilistic Activity Recognition in Smart Homes”. In: ICAART 2010 - 2nd Int. Conf. Agents Artif. Intell. Pp. 1–6.

55 References

Sangogboye, Fisayo Caleb, Olaf Droegehorn, and Jari Porras (2016). “Analyzing the Payback Time of Investments in Building Automation”. In: Sustain. Ecol. Eng. Des. Pp. 367–381. DOI: 10.1007/978-3-319-32646-7_25. Sarmento, Henrique Reinaldo et al. (2017). “Improving Energy Efficiency of Residential Building Automation System Considering User contexts enriched by Smartphones - German Use case -”. In: Serral, Estefanía, Pedro Valderas, and Vicente Pelechano (2010). “Supporting runtime system evolution to adapt to user behaviour”. In: Lect. Notes Comput. Sci. (including Subser. Lect. Notes Artif. Intell. Lect. Notes Bioinformatics) 6051 LNCS, pp. 378–392. DOI: 10.1007/978-3-642-13094-6_30. Shin, Jungwoo, Yuri Park, and Daeho Lee (2018). “Who will be smart home users? An analysis of adoption and diffusion of smart homes”. In: Technol. Forecast. Soc. Change 134, pp. 246–253. DOI: 10.1016/j.techfore.2018.06.029. Shuhaiber, Ahmed and Ibrahim Mashal (2019). “Understanding users’ acceptance of smart homes”. In: Technol. Soc. March 2018, pp. 1–9. DOI: 10.1016/j.techsoc. 2019.01.003. Sri Harsha, S. L.S., S. Chakrapani Reddy, and S. Prince Mary (2017). “Enhanced home automation system using Internet of Things”. In: Proc. Int. Conf. IoT Soc. Mobile, Anal. Cloud, I-SMAC 2017, pp. 89–93. DOI: 10.1109/I-SMAC.2017.8058302. Suzuki, Takuji and Miwako Doi (2001). “LifeMinder”. In: LifeMinder an evidence-based wearable Healthc. Assist. New York, New York, USA: CHI ’01 Extended Abstracts on Human Factors in Computing Systems Press, pp. 127–128. DOI: 10.1145/634067. 634144. Toschi, Guilherme Mussi, Leonardo Barreto Campos, and Carlos Eduardo Cugnasca (2017). “Home automation networks: A survey”. In: Comput. Stand. Interfaces 50, pp. 42–54. DOI: 10.1016/j.csi.2016.08.008. Vainio, Antti-Matti, Harri Pensas, and Jukka Vanhala (2014). “Context recognition in a smart home”. In: Proc. 18th Int. Acad. MindTrek Conf. Media Business, Manag. Con- tent Serv. - Acad. ’14, pp. 167–170. DOI: 10.1145/2676467.2676479. Vaishnavi, Vijay, Bill Kuechler, and Stacie Petter (n.d.). DESIGN SCIENCE RESEARCH IN INFORMATION SYSTEMS. Tech. rep. Vázquez, Félix Iglesias, Wolfgang Kastner, and Mario Kofler (Jan. 2013). “Holistic smart homes for air quality and thermal comfort”. In: Intell. Decis. Technol. Ed. by Ilias Maglogiannis, Lazaros Iliadis, and Harris Papadopoulos. Vol. 7. 1, pp. 23–43. DOI: 10.3233/IDT-120149.

56 References

Vázquez, Felix Iglesias et al. (Sept. 2011). “Impact of user habits in smart home control”. In: IEEE Int. Conf. Emerg. Technol. Fact. Autom. ETFA. IEEE, pp. 1–8. DOI: 10.1109/ ETFA.2011.6059104. Villanueva, Marcel Lowell G and Prof Olaf Droegehorn (2018). “Using Gestures to In- teract with Home Automation Systems : - a Socio-Technical Study on Motion Capture Technologies for Smart Homes”. In: October. Wigginton, Michael. (June 2013). Intelligent Skins. Routledge, p. 176. DOI: 10.4324/ 9780080495446. Williams, Dorothy Giles and Earl R. Babbie (2006). “The Practice of Social Research.” In: Contemp. Sociol. DOI: 10.2307/2062956. Yang, Heetae, Hwansoo Lee, and Hangjung Zo (Feb. 2017). “User acceptance of smart home services: an extension of the theory of planned behavior”. In: Ind. Manag. Data Syst. 117.1, pp. 68–89. DOI: 10.1108/IMDS-01-2016-0017. Youngjae Kim and Dongman Lee (2008). “A personal context-aware universal remote controller for a smart home environment”. In: DOI: 10.1109/icact.2006.206274.

57 Appendix A - Home Assistant Automation: Turn on heating at 16:30

- id: " 1556388672337" alias: Turn heating/cooling on from 16:30 trigger: -at:" 16:30:00" platform: time condition: -condition:state entity_id: calendar.hassio state: " off" action: -alias:" Turn thermo mode on" service: climate.set_operation_mode data: entity_id: climate.hvac operation_mode: " auto"

58 Appendix B - Home Assistant Automation: Turn off heating at 08:00

- id: " 1556388672337" alias: Turn heating/cooling off from 08:00 trigger: -at:" 18:00:00" platform: time action: -alias:" Turn thermo mode off" service: climate.set_operation_mode data: entity_id: climate.hvac operation_mode: " off"

59 Appendix C - Working with Home Assistant Configuration Tool

Figure 22: The interface to work with Home Assistant Configuration Tool.

60 Appendix D - Setting of Home Assistant Server

Figure 23: The setting of HA server and network infrastructure.

61