## 4 Results
### Sensor Network Performance  
The energy-saving algorithm implemented in the home monitoring sensor system exploits the proactive and reactive nature of the nodes. Such algorithm is based on the fact that if a node has more alerts due to significant measurement parameter changes, it will enter into a proactive monitoring operation. This benefits the network because the node is more vigilant. Every time, it will monitor the parameters because something may not work correctly at home for the rest of the person. On the other hand, when a node is in reactive mode, it spends less power because its monitoring is based on need. This is fostered because the node does not present intermittent attention alerts, and the follow-up of its monitoring parameters is relatively average. Based on Algorithm 1, the system presents an energy-saving concerning the regular operation of the wireless sensor network. For this result, we consider the system's use for one hour, and when we apply the algorithm, we observe that the use of the sensor batteries is reduced. This is only an added value to the system because its principal value is monitoring the conditions of the house to give recommendations based on sleep. Table 7 compares the energy consumption of two different system schemes. The first row of the table shows the energy for the system without the energy consumption algorithm, which is 5.82 W/h. The second row of the table shows the energy for the system with the energy consumption algorithm, which is 5.13 W/h. The table shows that the system with an energy consumption algorithm has a lower energy increment than the system without an energy consumption algorithm. This means that intelligently switching between proactive and reactive states of the nodes represents energy savings in the monitoring system. Resilience WSNs refers to the network's ability to maintain its functionality and performance even in the face of various challenges, disturbances, or failures. These challenges can include node failures, communication link disruptions, environmental changes, or malicious attacks. A resilient WSN can adapt to changes and recover quickly from disruptions, ensuring the continuous and reliable operation of the network. The concept of resilience in WSNs is crucial because these networks are often deployed in dynamic and harsh environments where failures or disruptions are common. For example, in environmental monitoring applications, WSNs may be deployed in remote and inaccessible locations where nodes may fail due to harsh weather conditions or energy depletion. The ability of a network to return to its stable state after facing a disruption is known as \"time to recovery\" or \"time to convergence\". It measures the duration it takes for the network to recover its normal functioning and reach a stable state after a failure or disturbance. A shorter time to recovery indicates a more resilient network that can quickly adapt to changes and restore its operations. Figure 2 shows the distribution of the grid resilience with and without the energy algorithm. Thanks to the user's recommendations, the network should present fewer sudden changes in the logical topology. The logical topology is based on giving priority to nodes under proactive nature and less priority to nodes under reactive nature. We observe that under the energy algorithm, the network is 8% more resilient than when the algorithm was implemented. This situation may be because the network is adapting the nature of its nodes, and the recommendations given to the user are optimizing the person's habits. This is reflected in the fact that we have increasingly fewer alerts given by the system, and the person's sleep may tend to improve. \begin{table}
\begin{tabular}{c c} \hline \hline
**System Outline** & **Energy (W/h)** \\ \hline Without energy consumption algorithm & 5.82 \\ \hline With energy consumption algorithm & 5.13 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Energy consumption comparison.