## 1 Introduction  
In recent years, with the introduction of the Internet of Things (IoT), the research and the implementation of home automation are getting more popular [1], because the IoT holds promise for making homes smarter. A smart home is a residential dwelling equipped with sensors and possibly actuators to collect data and send controls according to occupants' activities and expectations. Home automation (HA) refers to the mechanization and automatic control of various residential activities. Typically, HA provides a centralized control of electrical appliances, such as air conditioners, lighting and security systems and even a home theater. Adding intelligence to the home environment, it would be possible to obtain excellent levels of comfort, and another feature taken into account is the energy savings. It is necessary to highlight that an important role is also played by consumers, because, as shown in [2], the reduction of energy consumption can be obtained by only providing the consumption profile of appliances to the consumers and accordingly helping them to change their behavior. This approach, known as demand-side management (DSM) [3], based on bi-directional communication is enabled by the smart grid in order to smooth the load curve of the traditional grid. As a consequence, DSM programs influence the behavior of the consumers regarding electricity consumption because the DSM technique mainly relies on matching present generation values with demand by controlling the energy consumption of appliances and optimizing their operation at the user side. For instance, a practical usage can be the shifting of \"wet appliances\" from peak time to off-peak time. In literature are shown other approaches based on Time-of-Use (TOU) [4] pricing. The consumers, knowing a priori the energy price, could chose the best time to switch on or off the home appliances in order to improve (reducing) the energy cost. However, the integration of several electrical devices in the household is an open challenge because of the absence of an inexpensive and standardized communication protocol between them [5], even thanks to the introduction and the use of renewable energy [6]. Wireless Networks (WNs) are getting more integrated to our daily lives, recently in smart homes WNs are using to increase the inhabitant comfort [7] and they can receive the user feedbacks in order to meet the itself comfort. Several wireless technologies, such as Bluetooth Low Energy (BLE) [8], IEEE 802.15.4/ZigBee [9] and IEEE 802.11/Wi-Fi [10], have been proposed in order to embed various levels of intelligence for smart homes. In fact, in this research field, several literature works have been presented. For instance, the authors of [11] introduce a prototype that allows users to visually define the behavior of a WN in a smart home. The prototype includes relevant system features, such as an IoT-enabled sensor and actuator network, a user-friendly programming interface, a support for device and resource discovery and over-the-air code generation and deployment. A management system based on a WN for home automation and wellness is proposed by [12]. This system allows the consumers to control and to manage both the daily activity of home appliances and the home climate characteristics with a consequent reduction of energy consumption. The proposed system has good modularity and configurability characteristics with very low power consumption. The authors of [13] propose a fuzzy logic approach utilizing a wireless network and smart grid incentives in order to reduce the residential load demand. Simulation results show that the their proposed approach reduced the residential load demand without jeopardizing occupants' thermal comfort based on the information received from sensors, the grid and the occupants' preferences. Consideringthat the current energy grid is evolving into a smart grid, where consumers can directly reach and control their consumption, WNs can take part in domestic energy management systems, as well.