The thermal model of dwellings is the basis for flexible energy management of smart homes, where heating load is a big part of demand. It can also be operated as virtual energy storage to enable flexibility. However, constrained by data measurements and learning methods, the accuracy of existing thermal models is unsatisfying due to time-varying disturbances. This paper, based on the edge computing system, develops a dark-grey box method for dwelling thermal modelling. This darkgrey box method has high accuracy for: i) containing a thermal model integrated with time-varying features, and ii) utilising both physical and machine-learning models to learn the thermal features of dwellings. The proposed modelling method is demonstrated on a real room, enabled by an Internet of Things (IoT) platform. Results illustrate its feasibility and accuracy, and also reveal the data-size dependency of different feature-learning methods, providing valuable insights in selecting appropriate feature-learning methods in practice. This work provides more accurate thermal modelling, thus enabling more efficient energy use and management and helping reduce energy bills.