Towards Energy Smart Homes : Algorithms Technologies and Applications