Energy Dynamics of Green IoT Nodes with Time-Varying Energy Harvesting, Leakage, and Consumption Patterns