Nowadays, the load monitoring system is an important element in smart buildings to reduce energy consumption. Nonintrusive load monitoring (NILM) is utilized to determine the power consumption of each appliance in smart homes. The main problem of NILM is how to separate each appliance's power from the signal of aggregated consumption. In this regard, this paper presents a combination between particle swarm optimization (PSO) and artificial neural networks (ANNs) to identify electrical appliances for demand‐side management. ANN is applied in NILM as a load identification task, and PSO is used to train the ANN algorithm. This combination enhances the NILM technique's accuracy, which is further verified by experiments on different datasets like Reference Energy Disaggregation Dataset, UK Domestic Appliance‐Level ElectricityUK‐DALE, and Indian data for Ambient Water and electricity Sensing. The high accuracy of the proposed algorithm is verified by comparisons with state of the art methods. Compared with other approaches, the total mean absolute error has decreased from 39.3566 to 18.607. Also, the normalized root mean square error (NRMSE) method has been used to compare the measured and predicted results. The NRMSE is in the range of 1.719%–16.514%, which means perfect consistency. This demonstrates the effectiveness of the proposed approach for home energy management. Furthermore, customer behavior has been studied, considering energy costs during day hours.