An IEEE 802.15.4 Wireless Sensor Network for Energy Efficient Buildings