A building automation framework