Sustainable Energy Management in Smart Homes Using IoT and Machine Learning Techniques