Power Quality is an important topic for undergraduate electrical engineering students around the world. In addition to the theoretical contents prepared and explained by the lecturer to their students, this matter has an important practical focus. In this paper, a framework for teaching power quality in laboratories using IoT-based smart analyzers and advanced software tools is developed to provide the students the opportunity of studying real data with a high level of detail. In particular, practical lessons have been designed in such a way that the students are trained in the use of well-known commercial smart meters (like the Circutor MYeBOX 1500) or opensource systems (like the openZmeter) to acquire energy and power quality data from real world measurements and to analyze the data collected using advanced software tools (like PowerVision). The results obtained from several courses of electrical and electronic engineering show that the students acquire practical skills that allow them to reinforce their knowledge regarding power quality concepts, including harmonics, and power quality events such as voltage sag/swell, flicker, or waveform distortions. Therefore, this methodology can be applied for teaching power quality in undergraduate and graduate electrical engineering courses.