This paper puts the spotlight on the home/building area network of the smart grid. The IEEE 802.15.4 standard provides the core infrastructure for collecting data from customers' premises and forwarding it to the operations as well as service providers. An integrated physical (PHY) and medium access control (MAC) layer analytical model is introduced for half-duplex IEEE 802.15.4 networks. The PHY layer propagation channel is modeled as the composite path-loss K distribution while accommodating groundwave propagation, multipath fading, and shadowing. The MAC layer model caters for the unslotted carrier sense multiple access with collision avoidance (CSMA/CA) of IEEE 802.15.4 with unsaturated traffic conditions. Closed-form expressions are derived for the probability density function (PDF) of the instantaneous received power and the average outage probability. The packet success probability without and with capture effect is thoroughly studied for several environments as well as propagation scenarios. The correctness of all analytical results is validated through simulations.