**7. Practical aspects and implementation considerations for IoT and smart home**

Smart home has three components: hardware, software and communication protocols. It has a wide variety of applications for the digital consumer. Some of the areas of home automation led IoT enabled connectivity, such as: lighting control, gardening, safety and security, air quality, water-quality monitoring, voice assistants, switches, locks, energy and water meters.

Advanced smart home components include: IoT sensors, gateways, protocols, firmware, cloud computing, databases, middleware and gateways. IoT cloud can be divided into a platform-as-a-service (PaaS) and infrastructure-as-a-service (IaaS). **Figure 4** demonstrates the main components of the proposed advanced smart home and the connection and data flow among its components.

The smart home application updates the home database in the cloud to allow remote people access it and get the latest status of the home. A typical IoT platform contains: device security and authentication, message brokers and message queuing, device administration, protocols, data collection, visualization, analysis capabilities, integration with other web services, scalability, APIs for real-time information flow and open source libraries. IoT sensors for home automation are known by their sensing capabilities, such as: temperature, lux, water level, air composition, surveillance video cameras, voice/sound, pressure, humidity, accelerometers, infrared, vibrations and ultrasonic. Some of the most commonly used smart home sensors are temperature sensors, most are digital sensors, but some are analog and can be extremely accurate. Lux sensors measure the luminosity. Water level ultrasonic sensors.

Float level sensors offer a more precise measurement capability to IoT developers. Air composition sensors are used by developers to measure specific components in the air: CO monitoring, hydrogen gas levels measuring, nitrogen oxide measure, hazardous gas levels. Most of them have a heating time, which means that it requires a certain time before presenting accurate values. It relies on detecting gas

**Figure 4.** *Advanced smart home composition.*

components on a surface only after the surface is heated enough, values start to show up. Video cameras for surveillance and analytics. A range of cameras, with a high-speed connection. Using Raspberry Pi processor is recommended as its camera module is very efficient due to its flex connector, connected directly to the board.

Sound detectors are widely used for monitoring purposes, detecting sounds and acting accordingly. Some can even detect ultra-low levels of noise, and fine tune among various noise levels.

Humidity sensors sense the humidity levels in the air for smart homes. Its accuracy and precision depend on the sensor design and placement. Certain sensors like the DHT22, built for rapid prototyping, will always perform poorly when compared to high-quality sensors like HIH6100. For open spaces, the distribution around the sensor is expected to be uniform requiring fewer corrective actions for the right calibration.

Smart home communication protocols: bluetooth, Wi-Fi, or GSM. Bluetooth smart or low energy wireless protocols with mesh capabilities and data encryption algorithms. Zigbee is mesh networked, low power radio frequency-based protocol for IoT. X10 protocol that utilizes powerline wiring for signaling and control. Insteon, wireless and wireline communication. Z-wave specializes in secured home automation. UPB, uses existing power lines. Thread, a royalty-free protocol for smart home automation. ANT, an ultra-low-power protocol for building lowpowered sensors with a mesh distribution capability. The preferred protocols are bluetooth low energy, Z-wave, Zigbee, and thread. Considerations for incorporating a gateway may include: cloud connectivity, supported protocols, customization complexity and prototyping support. Home control is composed of the following: state machine, event bus, service log and timer.

Modularity: enables the bundle concept, runtime dynamics, software components can be managed at runtime, service orientation, manage dependencies among bundles, life cycle layer: controls the life cycle of the bundles, service layers: defines a dynamic model of communication between various modules, actual services: this is the application layer. Security layer: optional, leverages Java 2 security architecture and manages permissions from different modules.

OpenHAB is a framework, combining home automation and IoT gateway for smart homes. Its features: rules engine, logging mechanism and UI abstraction. Automation rules that focus on time, mood, or ambiance, easy configuration, common supported hardware:

Domoticz architecture: very few people know about the architecture of Domoticz, making it extremely difficult to build applications on it without taking unnecessary risks in building the product itself. For example, the entire design of general architecture feels a little weird when you look at the concept of a sensor to control to an actuator. Building advanced applications with Domoticz can be done using OO based languages.

Deployment of blockchain into home networks can easily be done with Raspberry Pi. A blockchain secured layer between devices and gateways can be implemented without a massive revamp of the existing code base. Blockchain is a technology that will play a role in the future to reassure them with revolutionary and new business models like dynamic renting for Airbnb.

#### **8. Smart home and IoT examples**

We can find in the literature and practical reports, many implementations of various integrations among part of the main three building blocks, smart home, IoT and cloud computing. For example, refer to [12**–**14]. In this section we outline three implementations, which clearly demonstrate the need and the benefits of interconnecting

**35**

**Figure 5.**

*Smart Home Systems Based on Internet of Things DOI: http://dx.doi.org/10.5772/intechopen.84894*

**8.1 Discovery of water leaks and its prevention**

means the house is considered as an IoT.

combining smart home and IoT.

activated due to the detected smoke alert.

*Advanced smart home implementations chart.*

**8.2 Smoke detectors**

numbers in **Figure 5**.

or integrating all three components, as illustrated in **Figure 5**. Each component is numbered, 1–6. In the left side, we describe for each implementation, the sequence of messages/commands among components, from left to right and from bottom up. Take for example the third implementation, a control task constantly runing at the home server (2) discovers the fact that all residents left home and automatically, initiates actuators to shut down all IoT appliances (3), then it issues messages to the relevant users/residents, updating them about the situation and the applied actions it took (6). The use of (i) in the implementations explanation, corresponds to the circled

First step is deploying water sensors under every reasonable potential leak source and an automated master water valve sensor for the whole house, which now

In case the water sensor detects a leak of water (3), it sends an event to the hub (2), which triggers the "turn valve off" application. The home control application then sends a "turn off" command to all IoT (3) appliances defined as sensitive to water stopping and then sends the "turn off" command to the main water valve (1). An update message is sent via the messaging system to these appearing in the notification list (6). This setup helps defending against scenarios where the source of the water is from the house plumbing. The underlying configuration assumes an integration via messages and commands between the smart home and the IoT control system. It demonstrates the dependency and the resulting benefits of

Most houses already have the typical collection of smoke detectors (1), but there is no bridge to send data from the sensor to a smart home hub. Connecting these sensors to a smart home app (2), enables a comprehensive smoke detection system. It is further expanded to notify the elevator sensor to block the use of it due to fire condition (1), and so, it is even further expanded to any IoT sensor (3), who may be

In [5] they designed a wireless sensor network for early detection of house fires.

They simulated a fire in a smart home using the fire dynamics simulator and a language program. The simulation results showed that the system detects fire early. *Smart Home Systems Based on Internet of Things DOI: http://dx.doi.org/10.5772/intechopen.84894*

*Internet of Things (IoT) for Automated and Smart Applications*

state machine, event bus, service log and timer.

ture and manages permissions from different modules.

and new business models like dynamic renting for Airbnb.

among various noise levels.

mon supported hardware:

using OO based languages.

**8. Smart home and IoT examples**

components on a surface only after the surface is heated enough, values start to show up. Video cameras for surveillance and analytics. A range of cameras, with a high-speed connection. Using Raspberry Pi processor is recommended as its camera module is very efficient due to its flex connector, connected directly to the board. Sound detectors are widely used for monitoring purposes, detecting sounds and acting accordingly. Some can even detect ultra-low levels of noise, and fine tune

Humidity sensors sense the humidity levels in the air for smart homes. Its accuracy and precision depend on the sensor design and placement. Certain sensors like the DHT22, built for rapid prototyping, will always perform poorly when compared to high-quality sensors like HIH6100. For open spaces, the distribution around the sensor is expected to be uniform requiring fewer corrective actions for the right calibration. Smart home communication protocols: bluetooth, Wi-Fi, or GSM. Bluetooth smart or low energy wireless protocols with mesh capabilities and data encryption algorithms. Zigbee is mesh networked, low power radio frequency-based protocol for IoT. X10 protocol that utilizes powerline wiring for signaling and control. Insteon, wireless and wireline communication. Z-wave specializes in secured home automation. UPB, uses existing power lines. Thread, a royalty-free protocol for smart home automation. ANT, an ultra-low-power protocol for building lowpowered sensors with a mesh distribution capability. The preferred protocols are bluetooth low energy, Z-wave, Zigbee, and thread. Considerations for incorporating a gateway may include: cloud connectivity, supported protocols, customization complexity and prototyping support. Home control is composed of the following:

Modularity: enables the bundle concept, runtime dynamics, software components can be managed at runtime, service orientation, manage dependencies among bundles, life cycle layer: controls the life cycle of the bundles, service layers: defines a dynamic model of communication between various modules, actual services: this is the application layer. Security layer: optional, leverages Java 2 security architec-

OpenHAB is a framework, combining home automation and IoT gateway for smart homes. Its features: rules engine, logging mechanism and UI abstraction. Automation rules that focus on time, mood, or ambiance, easy configuration, com-

Domoticz architecture: very few people know about the architecture of Domoticz, making it extremely difficult to build applications on it without taking unnecessary risks in building the product itself. For example, the entire design of general architecture feels a little weird when you look at the concept of a sensor to control to an actuator. Building advanced applications with Domoticz can be done

Deployment of blockchain into home networks can easily be done with Raspberry Pi. A blockchain secured layer between devices and gateways can be implemented without a massive revamp of the existing code base. Blockchain is a technology that will play a role in the future to reassure them with revolutionary

We can find in the literature and practical reports, many implementations of various integrations among part of the main three building blocks, smart home, IoT and cloud computing. For example, refer to [12**–**14]. In this section we outline three implementations, which clearly demonstrate the need and the benefits of interconnecting

**34**

or integrating all three components, as illustrated in **Figure 5**. Each component is numbered, 1–6. In the left side, we describe for each implementation, the sequence of messages/commands among components, from left to right and from bottom up. Take for example the third implementation, a control task constantly runing at the home server (2) discovers the fact that all residents left home and automatically, initiates actuators to shut down all IoT appliances (3), then it issues messages to the relevant users/residents, updating them about the situation and the applied actions it took (6).

The use of (i) in the implementations explanation, corresponds to the circled numbers in **Figure 5**.
