The wide-ranging implementation of the digital Internet of Things (IoT) system in recent years has contributed to the development of smart cities. In real-world time, smart cities are designed to encourage simplicity and quality of life in developed areas. A smart city’s network traffic from loT networks is increasingly growing and posing new cybersecurity problems, because these loT devices are linked to sensors that are directly connected to large cloud servers. The researchers need to refine new methods for identifying compromised loT machines to prevent such cyberattacks. In the smart networks, traditional protection strategies are cumbersome to implement because of complexity in communication systems, vendor regulations, requirements, technology and location-specific resources. To address these difficulties, we used a Probabilistic Timed Automaton (PTA) to model the operating actions of smart devices and introduced novel Time Dependent Anomaly Detection Systems (TDADS) utilizing the operational behaviour of smart home environment. Simulations to test our concept are performed in real time. It is clear from the simulation findings that our TDADS achieves effective usage of resources and robust packet transport. © 2021, The Author(s), under exclusive licence to Springer-Verlag GmbH, DE part of Springer Nature.