Auto-Commissioning And Resource Allocation Based Control Of Smart Lights