The mankind's home has evolved as humanity itself and through history, humanity has observed the safety and comfort of their homes. The adaptation of homes to the modern times, is now involved in a technological environment and constant innovation, especially in the control of appliances, safety, pleasure, the monitoring of electrical consumption, etc. These factors have allowed the integration of homes with IoT environments in what is known as smart home. In this work, an IoT smart sensor of electrical consumption in smart homes is presented which is capable to analyze the power consumption using mobile devices through a wireless connection. The smart meter was designed using a cyber-physical system based on the ESP32 micro-controller in which an embedded Web application is executed that shows the electrical consumption of electrical devices. The aim of this technological IoT smart device is to help to detect the phantom consumption of electrical energy in a smart home environment in order to promote the energy saving. The results obtained show that this kind of IoT technology contributes to decrease the economic expense for home owners and also allows to observe and analyze the electrical energy consumption of different electrical devices using mobile devices.