{'fraction_non_alphanumeric': 0.034552845528455285, 'fraction_numerical': 0.005013550135501355, 'mean_word_length': 5.059523809523809, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Transparent home Sensors/Actuators layer for Health &Well-being services

Risks factor leading to type 2 diabetes and cardiovascular diseases can be reduced by a preventive care infrastructure able to modify the habits toward healthier lifestyles, including more exercise, a better diet and a reduced stress. Accessing the home space is important not only to monitor indoor environment quality (IEQ) but also to provide relevant user's feedback and engage users towards a healthy life style. This paper present a new preventive care infrastructure composed of a distributed infrastructure for heterogeneous devices in the home local area network (named xAAL) in conjunction with a machine to machine protocol (MQTT) to external health & well-being services. Finally, end-user tests were performed in the Experiment'HAAL living lab in order to test sensors and feedbacks.


Introduction
Noncommunicable diseases (NCD), for instance diabetes, cardiovascular or respiratory are the leading cause of mortality in the world, representing 60% of all deaths according to the program chronic diseases and health promotion of the World Health Organization [13]. Modifying the habits toward healthier lifestyles, including more exercise, a better diet and reduced stress is associated with the reduced risk of diseases such as type 2 diabetes and cardiovascular diseases. In this context, the PREventive Care Infrastructure based On Ubiquitous Sensing (PRECIOUS [4]) project targets to develop a preventive care system to promote healthy lifestyles with specific focus on the following risk factors: environmental, socio-psychological and physiological. The PRECIOUS 1 system proposes services to end users: monitoring of the home environment factors (e.g., air quality), gathering data from "health & well-being" devices (e.g., body weight scale) and sending feedbacks through multimodal interfaces. In this paper, we focus on the user context related to environmental factors and how we can gather long-term data in the home user space. Particularly, we discuss an infrastructure and a new protocol to seamlessly integrate home automation devices and data in a health & well-being care system. Moreover, we also address user feedbacks in the home environment to support health & well-being recommendation on different user interfaces.
1 This project has received funding from the European Union's Seventh Framework Programme for research, technological development and demonstration under grant agreement no 611366.

Related works
The indoor environment quality (IEQ) is most of the time studied from an occupant comfort perspective and/or to reduce energy consumption of buildings [11,14]. Nevertheless, Kim et al. in [9] proposed a system to measure, visualize and learn about indoor air quality. The study showed that the inAir system motivates user to improve their indoor air quality. This means that visualization of data related to home comfort needs to be considered in order to engage user change habits. Then, Kim et al. in [10,8], presented a sensor network infrastructure for real time monitoring of several gases. The contribution is focused on data acquisition and sensor network infrastructure. The authors show that real-time monitoring is necessary as well as the use of pre-processing algorithm on data to reduce temporary errors. Interoperability issues related to different protocols using by sensors is not addressed. Furthermore, the integration in a smart home and health infrastructure is not considered.
Different vertical domains are present in the home environment: personal health devices, home automation devices, entertainment devices, etc. Recent works about IoT domain architecture proposed horizontal interoperability between vertical silos: eHealth, home automation, agriculture, etc. One can cite the HYDRA [1], IOT-A [2] or BUTLER [6] European projects. There is also a recent effort to standardize machine to machine (M2M) communication with the OneM2M initiative. Gateways between constrained network, e.g. BAN/PAN, HAN and WAN are still needed. Even if protocols like CoAP or MQTT are dedicated to small devices, there is still a gap because of device: power consumption, memory foot print, etc.

System description
The user context awareness (UCA) at home should be a key objective of a system trying to assist user in its daily life. We defined the following environmental variables: thermal comfort (temperature and humidity), noise quality, light quality. To achieve the UCA, a transparent sensors/actuators layer using xAAL [12] has been proposed to fight interoperability issues in the home automation domain. xAAL allows to seamlessly integrate TAN/BAN/PAN/LAN devices from different protocols. The xAAL infrastructure offers access with WAN interfaces (WAN-IF) to use MQTT M2M communication as shown Figure 1. MQTT is lightweight enough to be used on different communication links such as 3G/4G (cellular), Fiber, ADSL. Then, thanks to the selected M2M protocol, sensors data are exported and stored in a database to be used by health & well-being service. Data are processed and, according to a rules engine, user feedbacks will be sent to home. Basically, those feedbacks can take the form of messages, notifications, or devices actions at home (according to user's preferences).

Home Area Network and External Services
Context acquisition xAAL [12,5] is an open-source distributed infrastructure for heterogeneous ambient devices. The communication between devices is realized by a lightweight event-based messaging protocol working on the so-called xAAL bus. Devices are described by a schema, which provides a first level of semantic. IEQ variables are then related to the following schemas: "thermometer.basic", "hygrometer.basic", "luxmeter.basic", "loudness.basic". xAAL allows us to reuse traditional home automation devices (e.g., thermometer, luxmeter, soundmeter, Tv, etc.) to set up a pervasive health system. Data are automatically associated by the xAAL system to the location of sensors in various rooms (e.g. bedroom, living room).
From Home Area Network to Wide Area Network xAAL and external health services are inter-connected with the MQTT protocol. It is a lightweight protocol dedicated to M2M communications and is now an open standard [3]. It is based on a publish/subscribe model and TCP/IP. The home gateway publishes relevant home data to the external health services. It allows to move the management of data storage & analytics over long term and unstructured data in the cloud. According to the MQTT architecture, a broker is needed between publisher & subscriber. This allows multiple publishers to communicate to multiple subscribers in so-called topics. However, this is an additional component to administrate. But, robust open-source implementations exist today.
The infrastructure Figure 1 is composed by the following components: -xAAL-MQTT relay: a component of the home gateway which publishes sensor data to the cloud; -MQTT Broker: dispatches published data to the corresponding subscribers; -MQTT-logger: a component of the external home service that subscribes to data sent by the smart home and stores them to the health service database.
MQTT only defines a transport layer. Transported messages can be freely defined between publisher and subscriber. So, xAAL messages with sensor data are transformed to fit with the messaging protocol of the health service, and then are published to the uplink topic of the broker. It should be noticed that the user has full access to the home gateway and control/select data sent to the cloud service.
From Wide Area Network to Home Area Network A preventive healthcare system should consider the user feedback. This offers a way to engage and motivate users toward a healthy life style. The home gateway subscribes to the downlink topic of the broker. Figure 1 is composed by the following components: -MQTT-actuator: a component of the external home service which publishes feedback to home; -MQTT Broker: the same broker is used to dispatches published messages to subscribers; -MQTT-xAAL relay: a component of the home gateway that subscribes to feedback and sends xAAL commands.
From the Home Area Network to the Attention of the User Feedbacks are sent to home over MQTT in the form of JSON messages. Then, they are dispatched to the right actuators according to user preferences and home capabilities. The xAAL infrastructure provides multimodal interaction between home, health systems, and the user. The scenarios addressed in our study consider different kind of users from young to elderly people, from individual to family units, with different needs/wishes/habits regarding uses of devices. The following notifications media are currently available: "Lamp blinking", "Lamp color", "Haptic / Motor vibration", "Message on smartphone" (textual & voice message), "Text message on desktop computer", "Text message on Tv". The definition of each notification depends of the home capabilities. Thanks to xAAL and its discovery mechanism, the health service gateway (at home) is aware of home capabilities. Finally, users can define the appropriate notification type according to their preferences and current home actuators.

Security & Privacy
xAAL Firstly, xAAL is working on the local area network (LAN) and is protected by the mechanism that still exists to protect user LAN network. Secondly, with the version 0.5 a security layer has been added to the xAAL protocol [5]. Basically, it is based on a pre-shared private key, Poly1305/Chacha20 algorithm, a timestamp to avoid replay attack. The protocol version, the targets addresses and the timestamp are public. Only the payload is ciphered by the Poly1305/Chacha20 algorithm with "targets" for additional data and a "timestamp" playing the role of nonce.
MQTT Section 5 of the OASIS MQTT v3.1.1 standard is dedicated to security (for guidance only, non-normative). Four security levels (or profiles) are described: Level 4: Unsecured; Level 3: Base Secured; Level 2: Industry Secured (Base + Industry customizations), Level 1: Cyber Critical Secured. According to guides of the OASIS MQTT security subcommittee, we will match the level 2 security profile. Indeed, TLS provides authentication, integrity and privacy. Moreover, the TLS client authentication will be used in addition to the MQTT client authentication (username/password).

Implementation & Discussion
This paper describes an infrastructure aiming to ensure engagement and midlong term adherence to health & well-being service. The idea is to collect environment parameters at home, to send them to a decision engine, and then to provide feedback and recommendations to users, in a smart and confident way. xAAL has been deployed and tested [5] in the Experiment'HAAL living lab. Now xAAL includes support for the following home automation technologies: KNX, Zwave, Oregon Scientific, Delta Dore. A dedicated xAAL device have been developed which embed multiple sensors: a Raspberry Pi model B with a grovepi shield, a digital light sensor, a loudness sensor and a vibration motor for notifications. For the temperature and humidity sensor, we reused a "classical" sensor dedicated to a weather station (Oregon Scientific THGR810). This use case particularly shows all the opportunity offered by xAAL to integrate and re-use "classical" home automation sensors/actuators for health application.
xAAL is enough flexible to allow several kind of users feedback in order to target their needs, their preferences, a handicap, the specificity of their ages and their wishes. The following xAAL notifications have been implemented: blink a lamp and/or color lamp, Tv (HTTP protocol according to HbbTV standards), laptop (Use Mac Osx or Gnome notification center), Android smartphone (text & voice), noise with a vibration motor. This offers many alternatives compared to smartphone-centric solutions.
The home gateway offers to users the possibility control on data they accept to share: temperature, humidity, body weight, notifications, etc. The gateway is the place for processing a first level of data fusion, adding a context (e.g., localisation) before to send them to the cloud service. The location information is symbolic and defined by a tag, e.g. bedroom. On the other side, the home gateway dispatches feedbacks to rendering devices (smartphone, Tv, lamp, etc.) according to user preferences: the time of the day, the type of device, etc. Feedbacks are predefined messages, with internationalisation (I18n) to fit user language for use cases involving text and voice messages.
In terms of ethics, security & privacy, the external services in the cloud cannot access directly the home devices. What enter at home are just informative notifications whose rendering is controlled by the user, not direct commands for home devices.
From a technical point of view, xAAL allows us to add new low level protocols and devices, such as promising EnOcean or Zwave, thanks to independent software components translating messages to xAAL. Indeed, the integration of low level protocol is done by the xAAL bus itself. Moreover, with the schema modelling, a lamp is a lamp whatever the underlaying protocol. This new lamp is transparent for the health service, developers and users.
Finally, xAAL is an event bus and the association with a pub/sub pattern remains a good combination. The fact that messages between the house and cloud services are not standardized could be a drawback. But new health & well-being services providers are free to design their own gateway to be installed at the patient's home. They can define their own topics and message format.

Conclusions & Future Work
This paper proposed an infrastructure using xAAL and MQTT in order to offer the possibility to use home automation sensors/actuators in future health and well-being services. It offers access to home environment data in order to have a better understanding of the user context, i.e environmental factors such as thermal comfort, noise and luminosity levels. But, it also gives capabilities to developer of health applications to integrate feedbacks in order to engage users and help them to change their behaviour [7]. Healthcare systems need to use existing standards and MQTT combined with xAAL appears to be a well adapted candidate for M2M communication between home automation networks and external health & well-being services.
As future work, end-user tests will be conducted in the Experiment'HAAL living lab according to the Wizard-of-Oz principles. The objective is to collect user recommendations regarding acceptance on the overall functionalities, interfaces, data visualization & consultation, ethics & privacy.