Internet of things contains the hefty number of devices communicating with each other; give rise to the problem of spectrum scarcity. Cognitive radio has emerged as the promising solution to this problem. Spectrum sensing is the important function of cognitive radio and energy detector is the most popular technique used for spectrum sensing. In this paper, the performance of energy detector (ED) over α–η–μ fading channel has been analyzed. The analytical expressions for average probability of detection and average area under the receiver operating characteristics curve (AUC) are derived for the generalized fading channel in terms of the bivariate Fox H-function. The closed-form mathematical expressions for the average probability of detection for cooperative spectrum sensing as well as square law selection diversity reception are derived. The implication of the system parameters on the performance of ED is studied in terms of complimentary receiver operating characteristics and AUC. It is shown that the performance of ED can be improved when cooperation and diversity are employed. The derived results are generic and can be directly used for the performance analysis of η–μ and α–μ fading channels and their special cases. Monte-Carlo simulations are incorporated for validating the accuracy of the derived results.