The Design, Implementation, and Deployment of a Smart Lighting System for Smart Buildings