Domus, the connected home Amazouz Ali, Bar Alexandre, Benoist Hugues, Gwinner Charles, Hamidi Nassim, Mahboub Mohamed, Mounsif Badr, Plane Benjamin {aamazouz, abar, hbenoist, cgwinner, nhamidi, mmahboub, bmounsif, beplane}@enseirb-matmeca.fr Abstract. Thanks to IP networks expansion, home automation is more and more popular. Once away from home, one has the possibility to monitor his house. To do so several solutions already exist on the market, using different kind of sensors and different kind of complexity. We propose a new solution called Domus. Our solution is light (the user only has to place sensors in his house), user friendly (the whole system set up is made through a clear web interface and an intelligent network) and easily adjustable to fit perfectly the user s needs (the user can choose how many sensors he needs). Domus is then explained in details in this paper. 1. Introduction Linking of appliances, monitoring and controlling devices used in a home through an intelligent network : the field of home automation surrounds all phases of smart home technology, including the highly sophisticated sensors and controls that automate temperature, lighting, security systems, and many other functions. The idea of a smart home may sounds like something out of Hollywood. However, this technology is real, and is becoming increasingly sophisticated. Nowadays, the upcoming urge of safeguarding our home, saving money and consuming less energy on our utilities while sitting back and enjoying the latest technology can be a fun experience. The aim of our project was to design an application able to supervise a home everywhere. Clients would be warned anywhere and in real-time when an abnormal situation is happening at home. Specifically, when a room s temperature gets too high, a door is opened or a motion is detected. The application requires sensors and interfaces to interact with it. Interfaces must be ergonomic and light but have to offer basic configurations. Furthermore, our solution must be embedded in a small and energyefficient device in order to be adopted by today s consumers. 2. Solution 2.1 General Architecture Our solution, called Domus, includes four main elements as shown in figure 1. The first element gathers sensors. Domus can currently be used with temperature and door opening sensors and motion detecting cameras. The second and most important element is the server. The Domus core is embedded in a very small computer called Raspberry Pi. It is implemented in Python 1 and manages all the application autonomously. Thanks to it, the user can perform basic configurations from the web interface by specifying when Domus must warn him. Finally, Domus includes an Android 2 application displaying warning notifications and offering the user the opportunity to monitor sensors status. 1 Python is a great object-oriented, interpreted, and interactive programming language. 2 Android is an operating system based on the Linux kernel, and designed primarily for touchscreen mobile devices such as smartphones and tablet computers. 1 of 6
Figure 1 - Domus architecture. 2.2 Sensors Temperature sensor. A temperature sensor is a relatively accurate digital temperature sensor which reports the temperature in Celsius degrees with a 9 to 12-bit 3 precision in a measuring range of temperature between -55 C to 125 C. The 1-Wire 4 bus protocol is used, which requires only two wires for receiving and transmitting data. Thanks to the unique 64-Bit Serial number etched into the sensor, a huge number of sensors can be used on one data bus included on the Raspberry Pi. Another feature is the ability to operate without an external power supply, indeed power is instead supplied through the 1-Wire pull up resistor. Temperature sensors are pull technologies, which means that the server has to retrieves periodically the current value of sensors. In Domus, the server retrieves the current value of the sensor every five minutes. Door opening sensor. A door opening sensor is simply a magnetic switch. If the door is closed, the two different parts of the sensor are close enough to shut the magnetic switch. Once the door is open, the magnetic switch is open as well. As temperature sensors, door opening sensors are pull technologies. The current value of opening sensors is retrieved every second by the server. IP camera. An IP camera is a type of digital video camera commonly employed for surveillance, which can send and receive data through private computer network or the Internet. One of the advantages of these cameras is the simplicity of utilization for the owner who wants to consult them with any Internet connection. IP camera functions include motion detection, screenshot capture and video recording. Domus takes only advantage of the motion sensor and the screenshot feature. Since the operating system of cameras we used is a Linux distribution, scripts have been developed and hosted on the camera to fit our needs. These scripts are executed autonomously by cameras. Whenever a motion is detected, a photo is pushed to the FTP 5 server hosted on the Raspberry Pi, and a notification is sent to the server. Unlike temperature sensors and door opening sensors, IP cameras are push technologies. The server does not have to retrieve periodically the current value since the camera sends itself a notification whenever a motion is detected. 3 This precision results in an accuracy of +/- 0.0625 C. 4 1-Wire is a device communication bus system that makes it possible to link small inexpensive devices with only two wires. 5 File Transfer Protocol (FTP) is a standard network protocol used to transfer files from one host to another host over a TCP-based network such as the internet. 2 of 6
2.3 Web Interface The web interface makes possible for the user to specify when Domus must warn him. The user has to create scenarios which are defined by a set of conditions. Conditions depend on sensor statements and could be combined. Consequently, the user will be warned when all conditions of a scenario are true. For instance, when the bathroom s temperature drops below 20 C and the bathroom s window is opened. Furthermore, the user can customize the alert message and specify a do not disturb duration between two notifications of the same scenario (see figures 2 and 3). Figure 2 Creation of a new scenario from the web interface Figure 3 Display of scenario conditions 2.4 Domus' core The server of Domus is hosted on a Raspberry Pi. A Raspberry Pi is a small and cheap computer. Beyond its size and its price, the Raspberry Pi has a really low energy consumption and its operating system, a Debian distribution, is open and free. These several reasons make the Raspberry Pi the optimal computer for our solution. This tiny computer is an important part of Domus, since each single sensor is linked to it (see figure 4). Simultaneously with Domus server, it hosts a MySQL 6 database server for saving sensor and scenario data and a FTP server for saving pictures taken by cameras. Domus core is the thinking part of the system, implemented in Python and regrouping four engines. It performs tasks from sensor data retrieving to real-time user warning. Indeed, periodically or spontaneously (see push/pull technologies in 2.2) a new value is detected by a sensor, retrieved by the retrieving engine and the database is updated. Technically, all database requests are executed from the Data Access Object (DAO) which provides some specific data operations without exposing details of the database. Then the decision engine takes the lead by browsing conditions of each scenario. It compares the new sensor value to the one set on the condition. If all the conditions are true, the scenario created by the user is violated. The user has then to be warned. To do so, the notification engine is called. In order to avoid notification flooding, the notification engine considers the time since the last notification has been sent before sending a new one. If this time is longer than the do not disturb duration set by the user (see web interface in 2.3), a new notification is sent. This message is sent to an external server called Parse. Parse is a remote host connected to the 6 MySQL is the world s second most widely used open-source relational database management system. 3 of 6
Google Cloud Messaging 7 network which formats and forwards notifications to the user s android device. Additionally, a web server is deployed in the Domus core. It uses the REST 8 (REpresentational State Transfer) architecture which is based on the HTTP 9 protocol (HyperText Transfer Protocol) to communicate with the web interface and the android application. Thanks to HTTP requests sent to this server, those interfaces can retrieve or save data in the database. Figure 4 - Domus core architecture. 7 Google Cloud Messaging (GCM) is a service that helps developers send data from servers to their Android applications on Android devices. 8 REST is a style of software architecture for distributed systems such as the World Wide Web. REST has emerged as a predominant web API design model. 9 HTTP is an application-level protocol for distributed, collaborative, hypermedia information systems. It is a generic, stateless, protocol which can be used for many tasks beyond its use for hypertext, such as name servers and distributed object management systems, through extension of its request methods, error codes and headers. 4 of 6
2.5 Android Application The Android application Domus developed for tablet is the last entity in home automation cycle life. Indeed, once scenarios are well configured, the user will only interact with the application installed on his tablet. This application is connected to the Domus server by identifying with an IP address 10 and a password (see figure 5). It offers two main functionalities to the user. The first one is the reception of an alert message whenever a scenario is violated. The second functionality is the visualization in real time of home sensors values. Current values of sensors and screenshots of cameras are reachable on the tablet (see figures 6 and 7). Figure 5 Domus application authentication view Figure 6 Domus application camera screenshot view Figure 7 Domus application sensor value view 10 An Internet Protocol address (IP address) is a numerical label assigned to each device participating in a computer network that uses the Internet Protocol for communication. 5 of 6
3. Assessment To operate properly Domus requires at least one sensor and an Android tablet. However, Domus is very easy to install, the user only has to place sensors in the house and link them to the Raspberry Pi. Cameras can be connected wireless to Domus using a Wireless router 11 linked to the tiny computer. Moreover, thanks to the Raspberry Pi, Domus is an energy-efficient and goodlooking solution which can be easily adopted by today s consumers. In addition Domus is designed so that the only access points to users, namely the web interface and the Android application, are graphical interfaces. This makes the solution very user friendly and pleasant to use. Technically, Domus core is built with independent engines that achieve a predefined task. Thus improving Domus with new feature developments is possible without breaking other engines. 4. Conclusion Domus is then a solution for home monitoring. But it is also a software architecture well thought and developed from scratch. Out of the box, sensors we use are not smart. Domus lets to make smart these sensors. Moreover, Domus has been designed to be easily used by any kind of user. Even if, at this stage of the project, Domus is working and provides advanced features, the project can keep growing. The tablet application is only available for android devices, it would be a good idea to give to ios users the opportunity to try Domus. Another good improvement would be to have the possibility to use other kind of sensors, such as brightness and humidity sensors. And finally, IP cameras provide interesting capabilities we didn t use, such as a flashlight or a microphone. Acknowledgements We would like to thank Mr Marc Playart, Mr David Bromberg and Mr Laurent Réveillère from LaBRI 12 for helping us to identify the problem, to understand issues and for their academic guidance regarding this project. We are also grateful to all the Enseirb-Matmeca staff members for their help and support, and in particular to Mr Philippe Moniez for advising us to administer the network of our workspace. Finally, we want to express our sincere thanks to Mr Laurent Ricard for all his advice on the project management. 11 A wireless router is a device that performs the functions of a router but also includes the functions of a wireless access point. 12 The LaBRI is a research unit associated with the CNRS, the University of Bordeaux 1, the IPB and the University of Bordeaux Segalen. 6 of 6