We propose a self-commissioning, user-adaptive blinds and electric lighting controller for small office rooms. Self-commissioning, in this context, means that the controller builds an internal representation of the room, in particular of the room's daylighting characteristics, automatically and without user input. By user-adaptive, we mean that the illuminances the controller will seek to maintain are derived from a statistical analysis of the user's behaviour on the manually overridable blinds and electric lighting. Self-commission and user-adaptation are implemented by two decoupled software elements. The first element is a method for modeling the daylighting illuminance on arbitrary locations in the office room, when the windows are shaded by one or two venetian blinds (though the method can be generalized to an arbitrary number and kinds of window shadings). It uses the past history of illuminance distributions in the office room for a similar scene configuration, and models the current illuminance on a given point as a linear combination of outdoor global and diffuse irradiance. The second element is an algorithm for the estimation of the user's visual discomfort probability. It is a function of the current illuminance distribution in that office room, and of the past history of the user's interactions with the blinds' and lighting controls. A bayesian formalism is applied to infer the probability that any illuminance distribution should be considered by the user as visually uncomfortable. We describe how these elements have been integrated in a blinds and electric lighting controller. That controller runs today on an office room of the experimental LESO building and we present the results of the algorithm's adaptation to the preferences of that room's user. We have also assessed that controller's performance on computer-simulated virtual office rooms. We have let the controller run for one year simulated time on six different combinations of office room location (Rome and Brussels) and orientation (north, west and south). These simulations have let us evaluate the energy savings made possible with such a controller, and the improvement of the user's visual comfort.