In the Internet of Things (IoT), thousands of devices can be deployed to acquire data from the environment and provide service to several applications in different fields. In many cases, it is desirable that devices are self-sustainable in terms of energy. Therefore,the research community is exploring the possibility of employing battery-less devices, where the energy is derived solely from external and/or environmental sources, such as solar panels. In this work, we propose an ns-3 model of a (super) capacitor, which can be used as the storage of the harvested energy in a battery-less IoT device, and add the support for the intermittent behavior of devices, turning off/on according to their energy level. To exemplify the use of the model, we apply it to a LoRaWAN node, and compare the simulation outcomes with results in the literature obtained with mathematical analysis, confirming the accuracy of the implementation. Then, we show the importance of analyzing the interaction between energy availability and communication performance, paving the way for more accurate and realistic simulations in the field. The implemented code is made available as open source.