In recent years, the internet of things (IoT) represents the main core of Industry 4.0 for cyberphysic systems (CPS) in order to improve the industrial environment. Accordingly, the application of IoT and CPS has been expanded in applied electrical systems and machines. However, cybersecurity represents the main challenge of the implementation of IoT against cyber-attacks. In this regard, this paper proposes a new IoT architecture based on utilizing machine learning techniques to suppress cyber-attacks for providing reliable and secure online monitoring for the induction motor status. In particular, advanced machine learning techniques are utilized here to detect cyber-attacks and motor status with high accuracy. The proposed infrastructure validates the motor status via communication channels and the internet connection with economical cost and less effort on connecting various networks. For this purpose, the CONTACT Element platform for IoT is adopted to visualize the processed data based on machine learning techniques through a graphical dashboard. Once the cyber-attacks signal has been detected, the proposed IoT platform based on machine learning will be visualized automatically as fake data on the dashboard of the IoT platform. Different experimental scenarios with data acquisition are carried out to emphasize the performance of the suggested IoT topology. The results confirm that the proposed IoT architecture based on the machine learning technique can effectively visualize all faults of the motor status as well as the cyber-attacks on the networks. Moreover, all faults of the motor status and the fake data, due to the cyber-attacks, are successfully recognized and visualized on the dashboard of the proposed IoT platform with high accuracy and more clarified visualization, thereby contributing to enhancing the decision-making about the motor status. Furthermore, the introduced IoT architecture with Random Forest algorithm provides an effective detection for the faults on motor due to the vibration under industrial conditions with excellent accuracy of 99.03% that is significantly greater than the other machine learning algorithms. Besides, the proposed IoT has low latency to recognize the motor faults and cyber-attacks to present them in the main dashboard of the IoT platform.