{'fraction_non_alphanumeric': 0.03398926654740608, 'fraction_numerical': 0.014978320851399291, 'mean_word_length': 4.791395961369623, '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}}
Autonomic Management of Power Consumption with IoT and Fog Computing

We introduce a system for Autonomic Management of Power Consumption in setups that involve Internet of Things (IoT) and Fog Computing. The Central IoT (CIoT) is a Fog Computing based solution to provide advanced orchestration mechanisms to manage dynamic duty cycles for extra energy savings. The solution works by adjusting Home (H) and Away (A) cycles based on contextual information, like environmental conditions, user behavior, behavior variation, regulations on energy and network resources utilization, among others. Performance analysis through a proof of concept present average energy savings of 58.4%, reaching up to 61.51% when augmenting with a scheduling system and variable long sleep cycles (LS). However, there is no linear relation increasing LS time and more savings. The significance of this research is to promote autonomic management as a solution to develop more energy efficient buildings and smarter cities, towards sustainable goals.


Introduction
Home Energy Management Systems (HEMS) are popularly used to monitor energy consumption,identify deviations, and promote optimization of energy utilization. These solutions are usually built by integrating data collected from sensors, user behaviour, environmental information, Micro-Grid networks, Heating Ventilation Air Conditioning (HVAC), renewable energy sources, and other data sources and historical information to to subsidize strategies for energy preservation. Examples include in popular products like Google Nest Learning Thermostat, EcoBee Smart Thermostat, and others.
We devised a solution to optimize energy consumption by promoting adjustments to regulate energy utilization on a regular basis. The Central IoT (CIoT) is a Fog Computing based solution to provide advanced orchestration mechanisms to manage dynamic duty cycles for extra energy savings. The solution works based on IoT devices able to identify periods of time when residents are at home (state H) or away (state A). The method works by adjusting H and A cycles based on contextual information, like environmental conditions, user behavior, behavior variation, regulations on energy and network resources utilization, among others. We foresee application scenarios around e.g. smart homes, smart cities, smart agriculture, intelligent fire alarms, intelligent traffic lights, and others.
We are taking into consideration the challenges and demands for meeting real-time system requirements, guaranteeing large scale system network stability, and a lightweight management protocol. These solutions will be useful in scenarios such as traffic management in smart cities [1], smart greenhouses in agriculture [2,3], intelligent fire alarms in smart homes [4], for instance. The key contributions of this paper in-clude: 1. A proposal for an advanced orchestration mechanism for IoT devices in Fog Computing environment aiming to optimize power consumption.

A proof-of-concept implementation of large scale
IoT environments and analysis of the results. 3. An analysis of the state-of-the-art weighting the contribution in perspective.
The paper is structured as follows. Section 2 details the proposal. Section 3 present the experiments implemented to validate the proposal. Then, Section 4 analyse the results. Section 5 describe some background and related work and the paper concludes with a summary of our findings and future work.  Fig. 1 depicts the proposed solution architecture encompassing 3 layers: IoT devices, Fog layer, and Cloud layer. The central module is responsible for managing a local application with a web and database servers, as well as controlling communications with IoT devices. We consider two possible distribution scenarios:

Proposal
1. Fog Configuration, where the radio coordinator module is embedded with a Fog device and communicate directly with IoT devices.

2.
Mist Configurations, where the radio coordinator node is connected as a Mist layer to a Fog serial USB port, such as using a ZigBee protocol.
Let us think of a illustrative use scenario as fire alarm system that automatically updates its own sensors' based on the current state -i.e. Regular Operation, Emergency Operation, Away Mode -and provided user schedule.
In a Fog Configuration, the fire alarm system application can be accessed either locally or through the Internet, along with estimated energy utilization by the devices. The average packet size contain 25 bytes.
The Fog server controls the fire alarm IoT devices by altering the sleep time values, turning the device's alarm and sensors on and off. The control messages provide four functions and their respective options, with the first field representing which type of control to modify, and the second field defining the possible values of the control type.
In a Mist configuration, the ZigBee coordinator receives data from IoT nodes, compresses the data packets, and forwards them to the Fog element. Here, the average packet size of 10 bytes, including: Fire Alarm Identifier byte (0x11) hex value, 2 bytes of source address, and 7 bytes of sensors values.Reducing the source address from the ZigBee packet causes the Mist node to maintain an address translation table for communication between the Fog  and IoT devices. With the Mist layer device, the Fog system no longer communicate directly with the IoT device. The control frames are sent from the Fog node to the Mist node, so, CIoT generates a packet with an initial identifying byte (0x11) hex value, followed by two bytes of IoT address destination. Next, the control frame is added to the control packet and forwarded to the Fog device's serial port. The Mist device then builds and forwards the ZigBee packet to the IoT device.
The IoT devices are managed through a web application, exemplified in Fig. 2. Type "a" messages are generated when the alarm button is pressed, with two options: "L" to turn on the device alarm and "D" to turn off. Type "b" messages alter the sleep time with an input value between 0 and 3, altering the device's duty cycle. Power consumption and cost estimates are updated automatically.

Experiments
We propose two experiments to estimate the energy savings for these configurations: (i) we estimate the energy consumption of the networked devices by varying the sleep time in a household environment, and (ii) we expand the scenario to a condominium context with multiple households. In both experiments, we use a powered fire alarm IoT node device, depicted in Fig.3.
The IoT device is composed of a 8-bit Microcontroller (MC), an antenna module (ZigBee), air (DHT11), Gas (MQ-2) and flames sensors, sound (buzzer) and light (LED) actuators. To determine the IoT's fire alarm duty cycle, we limited the Reg- ular operation active cycle, to the sensors longest response time (RT), being the Air sensor module's RT of 2s, while gas and flames sensors' RT is 1s.
The radio module connects to the microcontroller using only 2 wires, for transmitting (TX) and receiving (RX) data, with a serial UART half-duplex communication interface. Radio modules with different protocols, such as WiFi, Bluetooth, and LoRa, could also be used with the UART interface. In this configuration, the radio module and microcontroller communication, is limited at default baud rate of 115200bps.  Table 1 presents the performance metrics for Regular Operation as provided by the manufacturer, whereas table 2 depicts the metrics for Emergency Mode when the device is in constant watch sending one packet per second to the Fog Computing infrastructure. In both cases, the metrics are provided in milliAmperes (mA).
During Regular active cycle, we consider that the The duty cycle energy consumption EC for each networked device can be expressed as the Eq.1, where Cs i is the power utilization and RT i is the response time for each of the n device's modules: The energy consumption or a fire alarm node operating in Regular Operation with duty cycles of 2 seconds can be calculated as below, based on the metrics provided in table 1: Hence, in a configuration where fire alarms operate with 9V, the Total Power Consumption T W C for each cycle can be calculated as: Correspondingly, we calculate the consumption per day, month and year for different variations of sleep time T in table 3. Therefore, we conclude that each fire alarm device will consume about 8.4 kWh/year if operating in Regular Mode without sleep time (T=0). However, by setting up a regular sleep time of 3s (T=3), the device will consume 3.38 kWh/year, representing an optimization in power consumption by 59.99% whilst still complying with regulations.
Moreover, we analyze the consumption and savings for different variations of EC emergency mode scenarios. We estimate the device's emergency mode energy consumption with Eq. 1 and table 2, with a duty cycle of 1 second, resulting in EC emergency = 0.065mA. Therefore, while operating in Regular mode with T=3, we estimate savings when device operates in Emergency mode for 1%, 2%, 5% and 10% of the time. With devices operating in Emergency mode for 1% of the time, maximum energy savings will result in 58.25%, or 1.74% lower than sole use of Regular mode with T=3.

Extended Scenario
Let us consider the context of an apartment building complex, where fire alarm devices connect to a centralized monitoring node in a Fog Computing configuration. In this context, some systems will be shared by multiple residences, such as emergency alarm systems, access control, security, and consumption management of water and electricity.
Moreover, there will be some level of collaboration: e.g. if a fire is detected in an apartment, the monitoring node will broadcast to all units to activate their audible and visual alarms, thus informing all neighboring residents about the state of emergency. To enable the collaboration features, in a configuration where the duty cycle is 2s, radio will remain listening for 1.9992s to received broadcast communication, being the remainder time the window for transmission.  Let us consider a building complex with 10 buildings and 30 apartments per building, totaling 300 apartments, with 1 fire alarm device per apartment, thus 300 IoT devices, as depicted in Fig. 4

Results
In this section, we analyze the fire alarm system's IoT network performance, considering a hierarchical tree configuration, using Queuing Theory. In this setting, each IoT device uses its ZigBee antenna to forward information to a centralized ZigBee Coordinator node in the Fog, creating a processing bottleneck at the antenna-to-microcontroller serial connection in the system. In Sampaio and Motoyama [2,3], an analysis of a large-scale sensor network system is applied to agricultural greenhouses. The results indicated that system scalability is possible, with support for thousands of sensor nodes. However, the parameters considered determined a 5-minute interval between packet sendings, as well as an average queue system time, in the coordinator, of 2 seconds.
Let us consider that each IoT node will send one packet per duty cycle, of two seconds when T equals 0, and five seconds when T equals 3. When scaling the network to 300 IoT nodes, the delay time related to the transmission between the antennas, should also consider packets collision and re-transmission delay due to the network density (D). In this paper, we focus our analysis on the processing the total IoT Zig-Bee packets input flux at coordinator λ C (lambda), being the packets that will effectively arrive at the coordinator's antenna queue, can be considered a Poisson distribution. Thus, we find the average packets per second, show in Eq. 4 : In this case, the Fog ZigBee antenna communicates via UART (U) serial port, with a speed limit in bits per second (bps) of U = 115200bps. The considered ZigBee average packet size is P = 25 bytes or 200 bits. The service rate µ C (mu), at output of coordinator, is the serial port connection speed U divided by average packet size P: The load ρ (rho), in Eq. 6, is defined in general as the ratio between incoming packet rate λ, and output packet rate µ.
Each packet average time spent in the system is E{T }, considering the waiting time added with packet service time [2]. We now calculate the condominium E{T } multiplying by λ C in Eq. 7: Thus, as the load ρ C at coordinator C rises, the packet average time spent in the queue will also rise. Fig. 5 displays a curve graph of average waiting time at coordinator E{T C } with λ C variation. With T = 0, input flux is λ C = 150 pct/s, ρ C = 0.26, resulting in 352ms average waiting time. Variation of T will alter λ C , E{T C } and ρ C , shown in table 6.
By varying all IoT alarm devices' sleep time T from 0 to 3 seconds in table 6, it will alter average packets input λ C from 150 to 60 packets per second, decreasing average waiting time E{T C } from 352 to 116 milliseconds, and decrease ρ C occupancy level from 0.260 to 0.104. Thus, as λ C decreases it results in higher savings.  We also consider the fire alarm IoT devices to be managed remotely, thus, CIoT is responsible for generating the devices' controls and emergency messages, considered as Feedback packets. In this case we use Jackson's theorem, from Queuing Theory, to calculate E{T C }. This theorem establishes that in a network of queues with feedback, having negative exponential service, and an input flux from outside source, each queue can be treated as an M/M/m independent queue.
Consequently, we estimate energy savings considering a reserve for feedback packets named λF C . The Fog system queue is shown in Fig. 6. For example, with 0.01µ C as feedback, it alters the receiving packets processing rate to 0.99µ C = 570 pct/s. With 0.99µ C and T=0, E{T C } will be 356ms, resulting in an estimated delay difference of 4ms, and with T=3 the difference is 1ms. The packet network average waiting time E{T C } must then be considered within the IoT duty cycle and its 3 seconds sleep limit. We then add the condominium E{T C } with T, resulting in the sleep Total Time (TT) to maximize condominium energy savings, shown in Eq. 8.

Network performance analysis with Mist
In this Section, the system analysis is performed with addition of a Mist layer. In this new configuration, the Mist node device, composed of an Arduino and a ZigBee antenna, is the ZigBee coordinator node, with average waiting time E{T C }. Packets are then reduced in the Mist node and forwarded to the Fog, this being the Mist to Fog queue, with average waiting time E{T M }. In queue networks, Burke's theorem states that the exit of each queue, in tandem with Poisson entry and negative exponential service, is also Poisson, and can be considered as independent M/M/m queues.
With Mist and Fog queues in tandem, IoT packets leaving the Mist node will also be considered Poisson upon arriving at Fog. By treating both queues as independent, the total average time E{T CM } will be the sum of the Mist queue E{T C } and the Fog queue E{T M }, being simplified to one queue.
IoT packets are received by the Mist node, with a maximum average rate of λ C = 150 pct/s and processing rate of µ C . Each packet is reduced and forwarded to the Fog node, with maximum rate λ M = 150 pct/s, and average packet size of 10 bytes. The processing rate considered at Fog node is also 115200bps, thus µ M = 1440 pct/s. These queues are then reduced into one queue with input λ CM = 150pct/s with packet size of 35 bytes, and µ CM = 411 pct/s. Lastly, we consider the Fog to Mist queue for feedback control packets, that are 5 bytes long with λ F M . The Mist node microcontroller will process the control packets, and forward to antenna the ZigBee packets that are 25 bytes long as λ F C , thus, total feedback λ F M C average packet size will be 30 bytes.
Accordingly, we redo the estimate savings calculations for E{T CM } with and without feedback. Results are presented in table 8. In the case without feedback, maximum T allowed is T=2.82s, resulting in 58.5% savings, or 0.5% less than without the Mist layer.
In the smart condominium fire alarm system, with the Mist layer and feedback 0.01µ CM , λ F M C will be 4 pcts/s. IoT devices have an estimated maximum energy savings of 58.4%, considering its working cycle with maximum T=2.81 sleep time, and average waiting time E{T}=181ms for packets queue processing delay, when scaling to 300 devices.
Results in table 7 and 8, show maximum savings with and without feedback and Mist layer, estimating about 5% difference when adding a Mist layer. We must then consider additional ways to save energy.

Autonomic dynamic duty cycle with Home Scheduling System
Now, we consider that IoT devices are in standard operating mode at times of the day that the residents are in the apartments. The standard operating mode follows the 5-second limit, being 2 seconds active and 3 seconds sleep limit to inform a local emergency fire state, thus alerting inhabitants in time to act or flee.
For periods when residents are not at home, we then allow T values to be higher than the initial 3 seconds limit, being defined as Long Sleep (LS) state, while also disregarding the system's queue delay time.
Considering a long sleep of 4 seconds, in a total duty cycle of 6 seconds, and with 10 cycles per minute, the one second difference above sleep limit T=3, would make little difference for residents' safety if they are away from the premises. With 2 seconds active and 10 seconds sleeping, the LS cycle would be 12 seconds, and in one minute, there would be 5 cycles, thus allowing for more significant device energy savings. If the IoT device detects an emergency fire state while the resident is out, an automatic message is sent from the Fog server to the resident's phone.
For the 300 apartments in the condominium, each resident may have different daily schedules for leaving and returning home, such as going to work, school, gym or any recurring activities. To determine when the apartments are empty, we then propose and develop a scheduling system, where each user registers its own schedules with the apartment number, exit and entry times, as well as which days of week it should run, shown in Fig. 7.
Therefore, we estimate daily IoT energy consumption considering users' time schedules to determine when residents are at Home (H) or Away (A). In each schedule, exit (ex) and entry (en) times are informed, and its daily difference are the times when residents are away, in Eq. 9. Thus, the times residents are home, in Eq. 10, is the difference of A from the rest of the day: To estimate the condominium IoT fire alarm devices energy savings difference, with Long Sleep (LS), we then simulate schedules for n = 300 apartments, arranged into 5 groups. In each group the apartments have the same average times for exiting and returning home, defined in table 9.
Each of the apartments from group 1 have two different schedules. In the first schedule the resident will leave the apartment at 8:00 in the morning, and will return at 11:30am, being away from home for three and a half hours. In the second schedule the resident will leave at 12:30pm and return at 06:00pm (18:00), being away from home for five and a half hours, totaling A = 9 : 30 hours away.
Then, A and H times of each group are calculated with Eqs. 9 and 10. Time results are divided by 24hrs to calculate A and H daily percentages, shown in table 9.
Hence, the estimated condominium daily energy savings E, with Mist layer, for n apartments, is the sum of times residents are at home, multiplied by maximum estimated T savings in table 8, and times the residents are away from home, multiplied by LS Savings in table ??, shown in Eq. 11.
To demonstrate calculations numerically, residents We then calculate proportional A(%) for each group, with results indicating that group 1 is responsible for 53.65% of TA, being the group with the highest weight. Group 5 is the group with least apartments, 20, but its A% of 9.04% is higher than group 3 with 30 apartments and A% of 7.91%. To calculate the total condominium energy savings, we multiply E of n groups g by its respective A%, and sum its results, shown in Eq. 13.  We also calculated the consumption differences when varying sleep time T=2.81, and long sleep LS times, in table 11. The difference in energy consumption between T=0 and T=2.81 is 58.4%, or up to 1481.5 kW per year. When comparing savings of T=2.81 with LS=4, results in 3.11% extra savings, being 220W per day, 6.57 kW per month or 78.88 kW per year. With LS=8 the condominium is able to save up to 8.12%, or 205.94 kW per year. However, increasing LS time does not result in proportional extra savings, for example, with LS=28 seconds its estimated ES is 13.14%, and with LS=58 seconds the ES is 14.40%. The 30 seconds difference between LS=28 and LS=58 only resulted in a 1.26% efficiency gain.

Related Work
We acknowledge some related work around the utilization of Fog Computing in Smart Environments and position our work in areas where further research is needed.
Existing IoT-based energy management projects focus on radio data transmission in order to increase efficiency. Our argument is that energy efficiency is attained by orchestrating controlling radio, microcontroller, and sensors/actuators modules during active mode, as well as turning off unnecessary modules during sleep mode. This feature is overlooked in current solutions, as analyzed above.
Ghidini and Das [5,6] introduced E 2 home to calculate multiple homes' energy consumption, by reading the energy meter information from Smart Meter Texas (SMT) Web site. E 2 home displayed high energy usage patterns, for times residents were at home or away, where residents' locations were determined from Android smartphones. To achieve energy savings, the user had to analyze the energy consumption history, and take actions to adjust their behavior, to minimize wasteful consumption.
Bhilare and Mali [7] developed an AMS IoT device connected to the home energy meter, and relay modules connected to a light, a fan, and an airconditioner, being able to manage appliances and energy consumption individually. The user was able to set in the system, a home energy meter threshold, to inform residents if the consumption limit had been exceeded, thus, user was responsible to take action in order to minimize energy waste.
Ku, Park and Choi [8] realized an IoT energy management platform, using microgrid, for a community of 110 homes. In this solution, each home was controlled by a Hub device, which interconnected with the management office center server. Each hub, controlled the home microgrid, connected to electricity and gas meters, lights control, and Heating Ventilation and Air Conditioning (HVAC). Outlets are also connected to the microgrid, to individually manage household appliances. Management office was responsible to analyze each home's energy usage history and trends, and feedback information to help residents reduce energy wastage.
Chen, Azhari, and Leu [9], proposed a Fog and IoT electrical consumption monitoring system, with the use of ZigBee smart sockets, for a smart home. Home outlets were considered as IoT nodes which allowed energy monitoring of appliances connected to them. A system performance evaluation was carried out, for a period of 15 minutes, in order to compare the latency time when using a local Fog server, and a Cloud server. The observed latency, when using only the Cloud, varied between 700ms and 2s, while, when sending data to be processed locally by Fog, the latency time was below 10ms. This approach can effectively address the data amount issues and reduce the response latency to secure the safety for the family members in real-time processing needed situations.
The system introduced by Agyeman, Al-Waisi and Hoxha [10] consisted of a microgrid managed by an IoT device with a non-invasive current sensor, and multiple relays, acting as smart outlets. The IoT device was responsible for managing the household appliances by switching them on and off. The current sensor read each appliances' electricity consumption, and forwarded data to a Fog device through an Ethernet connection. To help residents reduce energy consumption, authors also uses threshold notification if consumption budget is exceeded.
Hijawi, Gastli, Hamila, Ellabban and Unal [11] proposed a large scale IoT energy management system for a school building, with the use of smart WiFi outlets. The system considered each outlet as an individual IoT smart meter unit, with current sensor and relay modules. IoT data was forwarded to be stored in a Cloud server, where individual energy consumption history was displayed. To achieve efficient energy usage, user was responsible to send power control commands to the IoT units, at different times of the day, based on the data monitored and retrieved from the server over time.
Beaudaux, Gallais & Noël [12] produced a Heterogeneous radio preamble-sampling MAC duty-cycling, for energy-efficient Internet of Things deployments. In such protocols, nodes cyclically activated its radio to sample the channel for incoming messages, being referred to as Low-Power-Listening or LPL. For most existing solutions, LPL is homogeneous for network nodes, thus, it is proposed a strategy was pro-posed where different LPL configurations cohabited in a single Network of Things, corresponding to each node's role in the network, for dense large scale networks. Performance was evaluated through simulation, where results showed an average energy reduction of 61%, with a drawback of higher loss-rate and network delay.
Jayakumar, Raha and Raghunathan [13] promoted an ultra-Low power sleep mode, with SRAM data retention for embedded microcontrollers, named Hypnos. The paper focused on microcontroller's energy consumption while in idle mode. Hypnos considered that the on-chip SRAM is capable of 100% data retention, even at much lower supply voltage than regular operating voltage. Thus, performing extreme voltage scaling, when the microcontroller was in idle mode, resulted in decreasing idle power consumption by 75%, when compared to conventional implementation.
In Kolios, Ellinas, PanayIoTou, Polycarpou [14], authors developed an Energy Efficient Event-Based Networking for IoT, considering the minimum number of triggering events necessary to achieve the desired tracking accuracy and/or to guarantee control stability, in order to achieve the maximum networkwide energy efficiency. Energy savings was achieved by allowing communication circuitry to wake up only when particular events took place. The solution was tested through simulations, varying the number of receiving nodes and triggering events. the results indicated that, when the transmit time duration was in the order of a few hundred milliseconds to seconds, a gain of more than 50% was observed compared to the nominal solution, and with lower transmission time, higher savings could be achieved.
In Lu, Kim, Xhafa, Zhou and Tsai [15], authors presented a method to reach 10-years of battery life for Industrial Internet of Things (IIoT), using a platform called the I3Mote. Authors measured the radio wake-up time, being responsible for around 20% of packet transmission. Consequently, it was considered to use a faster start-up crystal oscillator to accelerate active/sleep transition for radio, sensors, and power-up times. On the network side, it is proposed to use Time Slotted Channel Hopping (TSCH) protocol, where the network coordinator sent periodic beacons and scheduled timeslots transmission among nodes. Each node shared a schedule, allowing it to know in advance when to turn on or off its radio. Thus, by increasing duty cycle to 500 seconds, 11.5 years battery lifespan could be achieved.
Al-Janabi and Al-Raweshidy [16] proposed a hybrid time division multiple access (TDMA)-carrier sense multiple access, with a collision avoidance mechanism (CSMA/CA) MAC protocol, called HSW-802.15.4, for large scale with high density IoT networks. The scheduling sleeping technique was adjusted according to high collision or channel failure conditions, determining the group of devices that were active per timeslot. The proposed protocol efficiently utilized the energy of the nodes and dynamically adapted the sleep/wake-up periods according to the variance in the network loads. Simulation results showed that HSW-802.15.4 can efficiently utilize the radio energy up to 60%.
Sampaio, Jesus, Boing and Westphall [4] developed a HEMS and a real time fire alarm system, with Fog and battery powered IoT device. The IoT device had temperature, gas/smoke, and flame sensors, to monitor the environment conditions, and a Zig-Bee antenna to send data to the Fog server. The Fog EMS remotely managed the IoT device altering its sleep time, considering the fire alarm real time restriction, thus, altering its duty cycle and energy consumption. Battery lifespans were calculated with duty cycle variation, and emergency state. With a maximum sleep duty cycle of 3 seconds, it was possible to reduce up to 59.99% of IoT energy consumption.
Perković, Damjanović,Šolić, Patrono and Rodrigues [17] reviewed strategies for reducing the consumption of Low Power Wide Area Networks (LP-WAN) battery-powered devices. The authors developed a battery powered IoT device, with an Arduino Pro Mini, low power environment sensors, and a Lo-RaWAN radio, for smart environments with large distance connection from IoT to the gateway node. To minimize the device's energy consumption, all LEDs and voltage regulator were removed from the main board. Another strategy for energy savings was the use of Low-Power library for Arduino, named deep sleep, that could reduce microcontroller sleep con-sumption below 1µA. The IoT device was developed with an RTC module, responsible for waking up the device from very long deep sleep cycles of 20 minutes.
Amirinasab, Shamshirband, Chronopoulos, Mosavi and Nabipour [18] designed a lightweight clear channel assessment (LW-CCA), as an extension of ContikiMAC, a low power radio duty cycling protocol available in Contiki OS based on the low power listening (LPL) mechanism. LW-CCA reduces the percentage of Radio Duty-Cycles in false WakeUps and idle listening, by using dynamic received signal strength indicators (RSSI) status check time. Simulation results showed that LW-CCA reduced about 8% energy consumption in nodes, while maintaining up to 99% of the packet delivery rate (PDR).
We conclude that modes of the existing EMS solutions focused on a combination between data from energy meters, individual appliances, and historical data analysis. By configuring energy consumption thresholds, residents could receive automatic information messages as recommendations to decide on corrective actions. However, existing approaches still rely heavily on user affirmative action in order to obtain energy savings. Hence, there is an opportunity to contribute with solutions able to manage IoT device operations by controlling individual modules, thus defining IoT duty cycles.

Conclusions
We concluded that there is a significant opportunity for energy saving by properly balancing the demand for quality of service and sleep time. Our tests indicate energy savings of 61.51% when Long Sleep (LS) is set to the standard of 4 seconds. The increase of LS setting does not have a proportional relation to increase savings. If we set LS to 58 seconds, it leads to an extra energy savings of 14.4%.
The proposed Central IoT (CIoT) provides an innovative view for a Autonomic IoT energy management system based on Fog and Mist Computing. The solution performs IoT device power management, with consumption estimate calculations in kWh, correlating variations of environment (temperature, smoke and flames), network load, and residents behavioral information for home occupation (daily schedules), realizing autonomic adjustments to regulate energy utilization.
This proposal is relevant for large scale IoT energy consumption environments as well as for energy generation and distribution planning, as it is possible to estimate the fluctuation in demand based on the configured sleep times in large IoT deployments.
In future work, we intend to add a condominium IoT home access control with RFID subsystem, in order to obtain more precise information about resident's exit and entry times, and other forms of parameter provisioning [19]. We will also look into security issues and intend to investigate the use of Intrusion Detection [20,21,22] and others to safeguard the IoT control environment. Finally, we seek to include methods of Computational Intelligence, Machine Learning, and Distributed AI [23,24] to estimate calculations, considering parameters RFIDbased presence identification, exit and entry times, environment conditions, the average waiting queue time variation, and others.