The Modelica Buildings library contains a package with a model for a thermal zone that computes heat transfer through the building envelope and within a room. It considers various heat transfer phenomena of a room, including conduction, convection, short-wave and long-wave radiation. The first part of this paper describes the physical phenomena considered in the room model. The second part validates the room model by using a standard test suite provided by the American Society of Heating, Refrigerating and Air-Conditioning Engineers (ASHRAE). The third part focuses on an application where the room model is used for simulation-based controls of a window shading device to reduce building energy consumption.