Currently, deployed Internet of Things (IoT) technology acts as a passive observer of the environment that sends data to a remote location. Developing and deploying future IoT applications will need re-tasking this one-way behaviour in a reliable manner. A novel computationally tractable optimization technique that can accept cross-layer resource configurations and focus on network enhancement with longevity should be created for the smart home, one of the heterogeneous IoT applications. This study shows different smart home architectures in static and mobile environments, taking into account some of the challenges like orchestration, mobility, and range in IoT. For network communication, routing protocol over 6LoWPAN (RPL) is used. The goal of the work is to optimize the communication network in both static and mobile environment. To attain the goal, this paper proposes an algorithm that improves the path selection by modifying the existing objective functions of RPL. The proposed smart home architectures are analysed and compared based on different parameters such as packet reception ratio, network overhead, throughput, average latency, and total energy consumption. Even when some of the devices in the smart home are mobile, the modified smart home-optimized path (MSHOP) is found to achieve a packet reception ratio of 99.93%, minimum latency of 0.9 s, and the highest total energy usage in the network of 3373 millijoules. In conclusion, proposed MSHOP outperforms all existing smart home architectures when considering network efficiency, time, and usability.