Various factors play a part in the energy consumption of a building : its physical properties, the equipment installed for its functioning (the heating, ventilation and air-conditioning system, auxiliary production of electricity or hot water), the outdoor environment and the behaviour of its occupants. While software tool designers have made great progress in the simulation of the first three factors, for the latter they have generally relied on fixed profiles of typical occupant presence and associated implications of their presence. As a result the randomness linked to occupants, i.e. the differences in behaviour between occupants and the variation in time of each behaviour, plays an ever more important role in the discrepancy between the simulated and real performances of buildings. This is most relevant in estimating the peak demand of energy (for heating, cooling, electrical appliances, etc.) which in turn influences the choice of technology and the size of the equipment installed to service the building. To fill this gap we have developed a family of stochastic models able to simulate the presence of occupants and their interactions with the building and the equipment present. A central model of occupant presence, based on an inhomogeneous Markov chain, produces a time series of the number of occupants within a predefined zone of a building. Given a weekly profile of the probability of presence, simplified parameters relating to the periods of long absence and the mobility of the person to be simulated, it has proven itself capable of reproducing that person's patterns of occupancy (times of first arrival, of last departure and periods of intermediate absence and presence) to a good degree of accuracy. Its output is used as an input for models for the simulation of the behaviour of occupants regarding the use of appliances in general, the use of lighting devices, the opening of windows and the production of waste. The appliance model adopts a detailed bottom-up approach, simulating each appliance with a black-box algorithm based on the probability of switching it on and the distribution of the duration and power of its use, whereas the interaction of the occupant with windows is determined by randomly changing environmental stimuli and the related thresholds of comfort randomly selected for each occupant. When integrated within a building simulation tool, these stochastic models will provide realistic profiles of the electricity and water consumed, the wastewater and solid waste produced and the heat emitted or rejected, both directly or indirectly by the occupant.