IEEE 802.11ah is a sub-1 GHz standard designed to meet the requirements of future machine-to-machine (M2M) communications. The standard should be able to support use cases for the M2M communications with thousands of stations capable of generating both periodic and aperiodic traffic for a single access point. In some cases, like environmental and agricultural monitoring. the nodes are typically powered by battery or through energy harvesting. For this application it is important for the communication to be energy efficient. IEEE 802.11ah introduces new energy saving mechanisms and a novel channel access mechanism to achieve this objective even for networks with a large nodes number. This work proposes a mathematical model to compute the energy consumption of an IEEE 802.11ah network.