DOI: 10.3390/automation7050148 ISSN: 2673-4052

Eliminating Cold Start in Smart Home Lighting Control via Digital Twin-Trained Q-Learning

Tomáš Sladčík, Hashim Habiballa

Smart home lighting systems are commonly based on static rule-based automations that cannot be effectively adjusted to changing daylight conditions and room-specific optical characteristics. Although reinforcement learning can provide adaptive control, learning directly in an occupied home can require disruptive exploratory actions during the cold-start period. This study aims to develop a lightweight cloud-independent controller that provides adaptive illuminance regulation without online reinforcement learning exploration. A room-specific empirical simulation environment based on preprocessed natural illuminance measurements was used to train a tabular Q-learning policy offline for 2500 episodes. The controller uses a compact 5×2×7 Q-table that maps discretized illuminance error and occupancy to relative brightness adjustments. During deployment, the learned policy is used only when occupancy is detected, whereas a deterministic 30-percentage-point brightness ramp-down rule is applied in the unoccupied state. The controller was implemented in Node-RED within Home Assistant on a Raspberry Pi 5 and connected to a BH1750 illuminance sensor and a Philips Hue bulb. In the evaluated simulated under-illuminated scenarios, the learned policy reached the 25 ± 2 lx target band within at most five control steps and avoided the initial exploratory behavior observed in Q-learning trained from scratch. Although the proportional rule-based baseline achieved lower MAE and RMSE in the evaluated simulations, the proposed method provides an interpretable, locally executable policy that eliminates online cold-start exploration and can be retrained for a specific lighting environment.