1Smart homes

A smart home is a residence that uses internet-connected devices for remote monitoring and management of various appliances and systems (e.g. heating, lighting).

Smart home technology is often called home automation or domotics. The main areas for home automation are security, comfort and energy efficiency. Owner can control it usually using his smartphone or other networked device. The first general purpose home automation network protocol was X10, which uses power lines for control signal transmission. These signals convey commands to corresponding devices, controlling how and when they should operate (e.g. turn on at a specific time). Today’s home automation network protocols ale mostly covered by the Internet of things (IoT) protocols as Zigbee, Z-Wave, LoRaWan, SigFox, NB-IoT, etc. as well as WiFi and Bluetooth. Many companies including Amazon, Apple and Google have released their own smart home products and home automation platforms as Amazon Echo, Apple HomeKit and Google Home. Newly built homes are often constructed with smart home infrastructure in place. Older homes, on the other hand, can be retrofitted with smart technologies.

Fig. 1 Smart home and illustration of some of its representative technologies

Smart home technologies have widely entered the domestic space touching nearly every aspect of life. Some representative technologies among them are:

- Smart TV - they connect to the Internet to access content through applications, such as on-demand video and music. Some smart TVs also include voice or gesture recognition.
- Smart Lighting systems - the devices are not one able to be controlled remotely and customized, they can e.g. detect when occupants are in the room and adjust lighting as needed, regulate themselves based on daylight availability, etc.
- Smart Thermostats - allow e.g. to schedule, monitor and remotely control home temperatures. Thy can also learn homeowners' behaviors and automatically and adapt to provide residents more comfort.
- Smart Locks and garage-door openers can e.g. detect when residents are near and unlock.
- Smart security cameras can e.g. monitor the homes when the owners are away or on vacation.
- Smart motion sensors can identify the difference between residents, visitors, pets and burglars, and can notify authorities if suspicious behavior is detected.
- Smart coffee makers can brew a fresh cup e.g. at scheduled time
- Smart refrigerators can keep track of expiration dates and make shopping lists
- Smart electricity plug - can e.g. sense an electric surge and turn off
- Smart water maters can detect failures or freezing pipes and turn off the water to avoid a flood.

Smart home can offer many benefits, among them are following:

- Peace of mind - remote monitoring feature allows users to monitor their homes, countering dangers such as a forgotten coffee maker left on or a front door left unlocked.
- Elderly - remote monitoring can help seniors to remain at home comfortably and safely, rather than moving to a nursing home or requiring 24/7 home care.
- Comfort and user preferences - smart homes can accommodate user preferences. E.g. as soon as you arrive home, your garage door will open, the lights will go on, the fireplace will roar and your favorite tunes will start playing on your smart speakers.
- Efficiency - smart home automation helps to improve efficiency, for electricity, water and other resources, e.g. by using.
- Smart heating / cooling - automation can learn to perform the necessary heating / cooling just in time e.g. house is cooled down by the time the owner arrives home from work.
- Smart irrigation system - the lawn will only be watered when needed and with the exact amount of water necessary.

However, smart home systems have struggled to become mainstream, in part due to their drawbacks, which are e.g. as follows:

- Perceived complexity. Some people have difficulty with technology or will give up on it with the first annoyance. Smart home manufacturers and alliances are working on reducing complexity and improving the user experience to make it enjoyable and beneficial for users of all types and technical levels.
- Interoperability. For home automation systems to be truly effective, devices must be interoperable regardless of who manufactured them, using the same protocol or, at least, complementary ones. As it is such a nascent market, there is no gold standard for home automation yet. However, standard alliances are partnering with manufacturers and protocols to ensure interoperability and a seamless user experience.
- Smart home security. If hackers are able to infiltrate a smart device, they could potentially turn off the lights and alarms and unlock the doors, leaving a home defenseless to a break-in. Further, hackers could potentially access the homeowner's network, leading to worse attacks or data exfiltration.
- Data privacy. It is about the privacy of the data shared by their smart home devices. While smart home device and platform manufacturers may collect consumer data to better tailor their products or offer new and improved services to customers, trust and transparency are critical to manufacturers building trust with the users of their smart products.

A smart home is not set of disparate smart devices and appliances, but ones that work together to create a remotely controllable network. All devices are controlled by a master home automation controller, often called a smart home hub.

The smart home hub is a hardware device that acts as the central point of the smart home system and is able to sense, process data and communicate wirelessly. It combines all of the disparate apps into a single smart home app that can be controlled remotely by homeowners. The most known hubs usually have voice-activated systems, contain virtual assistants that learn and personalize the smart home to the residents' preferences and patterns. They contain machine learning algorithms allowing home automation applications to adapt to their environments. Examples of smart home hubs include:

- Amazon Echo. Speech interface provides Alexa.
- Google Home. It serves too as the music and entertainment hub that manages other speakers and TVs via Google Cast. Speech interface provides Google Assistant. It is capable to control the compatible devices.
- HomePod. Speech interface provides Siri. It can control the Apple HomeKit platform. It is capable to control the HomeKit compatible devices. The AppleTV can also be used as local HomeKit.

Fig. 2 Examples of Smart home hubs (from left to right - Google Home, HomePod, Amazon Echo)

For reasonable automation the central unit (hub) needs the set of sensors to control the actuators. The scenarios can be complex and condition, where the particular action is performed can be combined from multiple sensors and conditions. The sensors include:

- outer conditions monitoring (temperature, pressure, humidity, ...),
- inner conditions (temperature, pressure, CO2, ...),
- flood detection,
- movement detection,
- door/window open/close detection,
- resources consumption (heating, water, electricity, gas, ...).

As the actuators there are also many options, among others:

- electricity switches (on/off),
- window open/close control,
- water valve control,
- blinds control,
- heating/cooling/air conditioning/air humidifier/etc.,
- lighting (external, internal, ...),
- alarms, notifications, ...,
- alarm,
- notifications,
- air filtration, humidity, etc.

Some smart home systems can be created from scratch, for example, using a Raspberry Pi or other prototyping board. Others can be purchased as a bundled smart home kit - also known as a smart home platform - that contains the pieces needed to start a home automation project. There are also many open source software systems for smart home automation as [1], [2], [3]:

- OpenHAB (OH) [4] - It has large user community, huge number of supported devices and integrations. It is written in Java, runs also on the Raspberry Pi and is designed to be device-agnostic. OH includes iOS and Android apps for device control, as well as design tools. It is licensed under Eclipse Public License.
- Home assistant (HA) [5] - It is easily deployable on any machine that can run Python 3 and it integrates with a large number of open source as well as commercial offerings. It is licensed under MIT license and supports
  - integration with amazon Alexa,
  - integration with Google Assistant.
- Calaos - Calaos is designed as a full-stack home automation platform, including a server application, touchscreen interface, web application, native mobile applications for iOS and Android, and a preconfigured Linux operating system to run underneath. It is licensed under GPLv3.
- Domoticz - It has a wide library of supported devices, large number of additional third-party integrations, it is designed with an HTML5 frontend and represents a lightweight home automation system (e.g. can run on Raspberry Pi). It is licensed under GPLv3
- MisterHouse - It uses Perl scripts, responds to voice commands, and runs on variety of devices including Linux, macOS, and Windows. It is licensed under GPLv2.
- OpenMotics - It includes hardware and software under open source licenses. It is primarily designed for easy retrofitting, focuses on a hardwired solution. It is licensed under GPLv2.

It seems that the most used solutions are AH and OH [6]. When comparing them, the OH seems to be a great choice for the experienced users (especially coders) as the complicated built-in tools give you superpowers to customize and tinker with the routines. All other users, however, should go for HA as a more consumer friendly product creating a comprehensive smart home eco-system.

While every smart home is a smart building, not every smart building is a smart home. Enterprise, commercial, industrial and residential buildings of all shapes and sizes - including offices, skyscrapers, apartment buildings, and multi-tenant offices and residences - are deploying IoT technologies to improve building efficiency, reduce energy costs and environmental impact, and ensure security, as well as improve occupant satisfaction. Many of the same smart technologies used in the smart home are deployed in smart buildings, including lighting, energy, heating and air conditioning, and security and building access systems.

For example, a smart building can reduce energy costs using sensors that detect how many occupants are in a room. The temperature can automatically adjust, putting cool air on if sensors detect a full conference room, or turning the heat down if everyone in the office has gone home for the day. Smart buildings can also connect to the smart grid. Here, smart building components and the electric grid can "talk" and "listen" to each other. With this technology, energy distribution can be managed efficiently, maintenance can be handled proactively and power outages can be responded to more quickly.

Beyond these benefits, smart building can provide building owners and managers the benefit of predictive maintenance.

Janitors, for example, can refill restroom supplies when sensors monitoring the soap or paper towel dispensers indicate low. Or maintenance and failures can be predicted on building refrigeration, elevators and lighting systems.