An energy management system for a smart office environment