With the affordable Internet of Things (IoT) devices, the number of smart classrooms are increasing. There are researches on how to incorporate the IoT technology into the pedagogy. We put the emphasis on classroom automation which enables the teacher to flexibly configure the smart devices without coding. It is achieved by a framework on top of the physical IoT network. In the framework, the automation process is modeled as a state transition engine. The teacher only needs to signal the engine to take a few system state snapshots as the preferences. Once the preference model is derived by the learning process, an event would trigger the engine to compute the suggested system states from this model. Then the automation process invokes the predefined actions to reach the target system states. The framework allows the engineer to provide the basic functions to configure the system, while keeping the user intervention low at providing the training data. In addition to describing the example applications of the framework, a simple use case is also simulated to demonstrate how to design a learning mechanism for this framework.