Time-Dependent Analysis of the Interaction Between Energy Harvesting, Leakage, and Consumption Processes in a Green IoT Device