  This paper presents an approach for energy-neutral Internet of Things (IoT)
scenarios where the IoT devices (IoTDs) rely entirely on their energy
harvesting capabilities to sustain operation. We use a Markov chain to
represent the operation and transmission states of the IoTDs, a modulated
Poisson process to model their energy harvesting process, and a discrete-time
Markov chain to model their battery state. The aim is to efficiently manage the
duty cycling of the IoTDs, so as to prolong their battery life and reduce
instances of low-energy availability. We propose a duty-cycling management
based on K- nearest neighbors, aiming to strike a trade-off between energy
efficiency and detection accuracy. This is done by incorporating spatial and
temporal correlations among IoTDs' activity, as well as their energy harvesting
capabilities. We also allow the base station to wake up specific IoTDs if more
information about an event is needed upon initial detection. Our proposed
scheme shows significant improvements in energy savings and performance, with
up to 11 times lower misdetection probability and 50\% lower energy consumption
for high-density scenarios compared to a random duty cycling benchmark.
