Enhancement of a low-cost intelligent device for improving energy efficiency in building