The invention relates to a system (100) for automating adjustment or adaptation of devices (141-143) such as light, computer programs and positioning of devices used during patient examination. The patient examination is performed by use of a scanner system where the patient is lying on a bed (102) which can be moved into a scanner zone of the scanner where the scanning can be performed and away from the scanner zone. The automated control is achieved by detecting the position of the bed and using the detected position for adjusting or adapting the state, i.e. the function or working of one or more devices (141-143).