Implementation of an integrated indoor environment and energy management system