A luminaire (120-k) for illuminating a space, the luminaire (120-k) comprising: at least one light source (121-k) for providing light output for said space; a sensor for measuring an environmental characteristic at a location of the luminaire (120-k); a control portion (111-k) for controlling one or more aspects of the light output of the at least one light source (121-k) in accordance with a predefined lighting control logic, the control portion (111-k) further arranged to: collect, during a learning period, learning data that is descriptive of a relationship between sensor values measured by said sensor and corresponding operational states of the luminaire (120-k), and derive, after the learning period based on said learning data, a calibration model for compensating for an offset occurring in the sensor values measured by said sensor due to the operational state of the luminaire (120-k), characterized in that said sensor is a temperature sensor for measuring an ambient temperature at the location of the luminaire (120-k), wherein deriving said calibration model comprises deriving at least one temperature offset curve that models a change in temperature measured by said sensor as a function of the operational state of the luminaire (120-k), and wherein said offset defines a deviation from the ambient temperature at the location of the luminaire (120-k) due to heat originating from operation of the at least one light source (121-k). at least one light source (121-k) for providing light output for said space; a sensor for measuring an environmental characteristic at a location of the luminaire (120-k); a control portion (111-k) for controlling one or more aspects of the light output of the at least one light source (121-k) in accordance with a predefined lighting control logic, the control portion (111-k) further arranged to: collect, during a learning period, learning data that is descriptive of a relationship between sensor values measured by said sensor and corresponding operational states of the luminaire (120-k), and derive, after the learning period based on said learning data, a calibration model for compensating for an offset occurring in the sensor values measured by said sensor due to the operational state of the luminaire (120-k), characterized in that said sensor is a temperature sensor for measuring an ambient temperature at the location of the luminaire (120-k), wherein deriving said calibration model comprises deriving at least one temperature offset curve that models a change in temperature measured by said sensor as a function of the operational state of the luminaire (120-k), and wherein said offset defines a deviation from the ambient temperature at the location of the luminaire (120-k) due to heat originating from operation of the at least one light source (121-k). collect, during a learning period, learning data that is descriptive of a relationship between sensor values measured by said sensor and corresponding operational states of the luminaire (120-k), and derive, after the learning period based on said learning data, a calibration model for compensating for an offset occurring in the sensor values measured by said sensor due to the operational state of the luminaire (120-k), characterized in that said sensor is a temperature sensor for measuring an ambient temperature at the location of the luminaire (120-k), wherein deriving said calibration model comprises deriving at least one temperature offset curve that models a change in temperature measured by said sensor as a function of the operational state of the luminaire (120-k), and wherein said offset defines a deviation from the ambient temperature at the location of the luminaire (120-k) due to heat originating from operation of the at least one light source (121-k).