The invention is directed to a medical device comprised of at least one device part that is electrically operated and can be switched between an idle state and an operating state and a method of controlling such device. A control unit is provided which switches an electrically operated device part from the operating state to the idle state. Alternatively or in addition, a person detector and a control unit are provided, wherein a control unit switches the device part to the operating state in case the person detector detects the presence of a person at a distance from the device. Alternatively or in addition, an operating control is provided for manually switching the device from the operating state to the idle state.