Minimizing the energy consumption is one of the main challenges in internet of things (IoT) networks. Recently, the IEEE 802.11ah standard has been released as a new low-power Wi-Fi solution. It has several features, such as restricted access window (RAW) and target wake time (TWT), that promise to improve energy consumption. Specifically, in this article we study how to reduce the energy consumption thanks to RAW and TWT. In order to do this, we first present an analytical model that calculates the average energy consumption during a RAW slot. We compare these results to the IEEE 802.11ah simulator that we have extended for this scope with an energy life-cycle model for RAW and TWT. Then we study the energy consumption under different conditions using RAW. Finally, we evaluate the energy consumption using TWT. In the results, we show that the presented model has a maximum deviation from the simulations of 10% in case of capture effect (CE) and 7% without it. RAW always performs better than carrier-sense multiple access with collision avoidance (CSMA/CA) when the traffic is higher and the usage of more slots has showed to have better energy efficiency, of up to the 76%, although also significantly increasing the latency. We will show how TWT outperforms pure RAW, by over 100%, when the transmission time is over 5 min.