The crisis of energy supplies has led to the need for sustainability in technology, especially in the Internet of Things (IoT) paradigm. One solution is the integration of passive technologies like Energy Harvesting (EH) into IoT systems, which reduces the amount of battery replacement. However, integrating EH technologies within IoT systems is challenging, and it requires adaptations at different layers of the IoT protocol stack, especially at the Medium Access Control (MAC) layer due to its energy-hungry features. Since Wi-Fi is a widely used wireless technology in IoT systems, in this paper, we perform an extensive set of simulations in a dense solar-based energy-harvesting Wi-Fi network in an e-Health environment. We introduce optimization algorithms, which benefit from the Reinforcement Learning (RL) methods to efficiently adjust to the complexity and dynamic behaviour of the network. We assume the concept of Access Point (AP) coordination to demonstrate the feasibility of the upcoming Wi-Fi amendment IEEE 802.11bn (Wi-Fi 8). This paper shows that the proposed algorithms reduce the network's energy consumption by up to 25% compared to legacy Wi-Fi while maintaining the required Quality of Service (QoS) for e-Health applications. Moreover, by considering the specific adjustment of MAC layer parameters, up to 37% of the energy of the network can be conserved, which illustrates the viability of reducing the dimensions of solar cells, while concurrently augmenting the flexibility of this EH technique for deployment within the IoT devices. We anticipate this research will shed light on new possibilities for IoT energy harvesting integration, particularly in contexts with restricted QoS environments such as passive sensing and e-Healthcare.