Background Smart home-enabled smart cities require low-latency data processing, precise energy forecasting, and strong risk prediction to guarantee efficient energy use and secure system functionality. Traditional cloud-centric IoT architectures face issues such as high latency, excessive energy consumption, and limited real-time threat detection. To tackle these problems, this research presents a fog-cloud-IoT-based framework aimed at improving energy efficiency, security, and operational reliability within smart home settings. Methods This study introduces a Cost-Effective Risk Prediction and Energy Management in Fog-Cloud-IoT (CREFCI) model. The architecture employs a Raspberry Pi 4 fog node for local data processing and communication, tracks user preferences and device statuses locally, ensures network security through Suricata IDS/IPS, and keeps a synchronized duplicate database in the IoT cloud for analytics and user interaction via Android and Web APIs. Interoperability among Zig bee, Z-Wave, and Wi-Fi protocols is facilitated through JSON/XML data transformation, energy demand is predicted using ANN-based learning, and risk scores are calculated through likelihood-impact analysis. Results Experimental assessments reveal that the CREFCI model achieves 75% accuracy in energy prediction, surpassing existing models by 13% for the highest predictions and doubling accuracy for the third-highest probability estimates. The model decreases mean absolute error (MAE) by 50% and enhances accuracy in lower-ranked predictions by 40–44%. Energy consumption is significantly lowered by 50–80%, using only 0.3–0.5 kWh compared to 1.0–1.7 kWh in competing methods. Furthermore, average latency is reduced by 40–60%, underscoring the effectiveness of fog-based processing. Conclusions The CREFCI model successfully integrates fog computing, cloud analytics, ensemble learning, and risk assessment to improve energy efficiency, prediction accuracy, and security in smart home IoT systems. By reducing latency reducing energy consumption, and providing real-time risk prediction, CREFCI offers a scalable and cost-effective solution for next-generation fog–cloud–IoT smart city infrastructures.
Rashid et al. (Wed,) studied this question.