A lighting device comprising: at least one light source for providing a light output; and means for providing dimming of said light output by means of a present dimming mode to provide a dimmed light output, wherein the dimming of said light output is perceptible to human eyes; said lighting device further comprising means for embedding a code in said dimmed light output to allow extraction of the code embedded in the dimmed light output, said means for embedding a code being arranged for controlling an instantaneous dimmed light output of said dimmed light output wherein the integrated value of said dimmed light output during a time period T is modulated to embed said code characterized in that: the present dimming mode is selected by the lighting device from a multiple of dimming modes, wherein each dimming mode is associated with a different respective predetermined dimming method from a multiple of different dimming methods employable by the lighting device, said multiple of different dimming methods comprising at least two of amplitude-modulation dimming, pulse-width modulated dimming and pulse density modulation dimming; wherein the embedded code in the light output allows extraction of the embedded code regardless of the dimming mode and dimming method employed; and wherein a modulation method employed in the embedding of the code is selected in response to the dimming method associated with the selected dimming mode. at least one light source for providing a light output; and means for providing dimming of said light output by means of a present dimming mode to provide a dimmed light output, wherein the dimming of said light output is perceptible to human eyes; said lighting device further comprising means for embedding a code in said dimmed light output to allow extraction of the code embedded in the dimmed light output, said means for embedding a code being arranged for controlling an instantaneous dimmed light output of said dimmed light output wherein the integrated value of said dimmed light output during a time period T is modulated to embed said code characterized in that: the present dimming mode is selected by the lighting device from a multiple of dimming modes, wherein each dimming mode is associated with a different respective predetermined dimming method from a multiple of different dimming methods employable by the lighting device, said multiple of different dimming methods comprising at least two of amplitude-modulation dimming, pulse-width modulated dimming and pulse density modulation dimming; wherein the embedded code in the light output allows extraction of the embedded code regardless of the dimming mode and dimming method employed; and wherein a modulation method employed in the embedding of the code is selected in response to the dimming method associated with the selected dimming mode. the present dimming mode is selected by the lighting device from a multiple of dimming modes, wherein each dimming mode is associated with a different respective predetermined dimming method from a multiple of different dimming methods employable by the lighting device, said multiple of different dimming methods comprising at least two of amplitude-modulation dimming, pulse-width modulated dimming and pulse density modulation dimming; wherein the embedded code in the light output allows extraction of the embedded code regardless of the dimming mode and dimming method employed; and wherein a modulation method employed in the embedding of the code is selected in response to the dimming method associated with the selected dimming mode.