An optical sensor device having an optical sensor for monitoring a monitored zone, comprising - a detection device for observing a detection zone comprising the monitored zone, said detection device comprising a transmission device for transmitting transmission light into the detection zone and a receiver for receiving light reflected back or remitted back from the detection zone though an object located therein or transmitted through the detection zone; - at least one test object, separate from the object to be detected, within the detection zone of the optical sensor; and - a memory in which the position of the test object is stored such that the position of the test object determined on the sweeping over of the detection zone by the transmission light can be compared with the position of the test object stored in the memory, said optical sensor device being characterized by: - a degree of reflection or remission of the test object which corresponds to a multiple of a minimal degree of reflection or remission, preferably to a multiple of 2%, wherein the multiple is calculated using a multiplication factor which corresponds to the square of the ratio of the distance of the test object from the detection device and to the maximum extent of the monitored zone; and - a device (20, 22, 26; 20, 22, 28; 20, 30, 32, 34; 46) for avoiding and/or eliminating a contamination of the at least one test object to maintain a predefined remission property or reflection property of the test object, said device (i) comprising a movement device, preferably an ultrasound generator, for moving the at least one test object in order to remove contamination which has occurred; or (ii) comprising a housing, preferably a tube, surrounding the at least one test object; and a passage for applying a ram pressure, preferably a ram air pressure, to the interior of the housing; or (ii) comprising a device for rinsing the at least one test object with a liquid, preferably water, or with a gas, preferably air. - a detection device for observing a detection zone comprising the monitored zone, said detection device comprising a transmission device for transmitting transmission light into the detection zone and a receiver for receiving light reflected back or remitted back from the detection zone though an object located therein or transmitted through the detection zone; - at least one test object, separate from the object to be detected, within the detection zone of the optical sensor; and - a memory in which the position of the test object is stored such that the position of the test object determined on the sweeping over of the detection zone by the transmission light can be compared with the position of the test object stored in the memory, - a degree of reflection or remission of the test object which corresponds to a multiple of a minimal degree of reflection or remission, preferably to a multiple of 2%, wherein the multiple is calculated using a multiplication factor which corresponds to the square of the ratio of the distance of the test object from the detection device and to the maximum extent of the monitored zone; and - a device (20, 22, 26; 20, 22, 28; 20, 30, 32, 34; 46) for avoiding and/or eliminating a contamination of the at least one test object to maintain a predefined remission property or reflection property of the test object, said device (i) comprising a movement device, preferably an ultrasound generator, for moving the at least one test object in order to remove contamination which has occurred; or (ii) comprising a housing, preferably a tube, surrounding the at least one test object; and a passage for applying a ram pressure, preferably a ram air pressure, to the interior of the housing; or (ii) comprising a device for rinsing the at least one test object with a liquid, preferably water, or with a gas, preferably air. (i) comprising a movement device, preferably an ultrasound generator, for moving the at least one test object in order to remove contamination which has occurred; or (ii) comprising a housing, preferably a tube, surrounding the at least one test object; and a passage for applying a ram pressure, preferably a ram air pressure, to the interior of the housing; or (ii) comprising a device for rinsing the at least one test object with a liquid, preferably water, or with a gas, preferably air.