Dynamic modelling and optimal control of an embedded-piping floor heating system is explored. The physical system consists of a single zone with serpentine tubes embedded in the floor slab. A gas-fired boiler supplies hot water in the tubes. The input energy to the boiler and the mass flow rate of hot water circulating in the tubes is modulated. A numerical solution to the 24-hour optimal control problem, taking into consideration the capacity constraints of the floor heating system, is found. Results show that, by proper choice of objective function, the energy input to the boiler can be minimized while maintaining good zone temperature control. The implementation of the optimal trajectories using PI controllers is also shown.