A method for determining a position of a blocking element in a valve comprising an operating device configured so that said blocking element moves between an open and a closed position in dependency of the direction in which said operating device is rotated, said method comprising the steps of: • connecting at least a reference part or a sensor of a sensor system to said operating device, so that said sensor system detects the rotation angle of said operating device and the rotational direction of said rotations, • calibrating said sensor system by ∘ rotating said operating device in a first direction until said blocking element reaches a first reference position in which said blocking element is in a fully closed or a fully open position, ∘ storing said first reference position as said fully closed or said fully open position in a memory, ∘ rotating said operating device in a second direction opposite said first direction until said blocking element performs a calibration stroke and reaches a second reference position of said fully closed or fully open position, ∘ storing said second reference position as said fully closed or said fully open position in said memory, ∘ rotating said operating device in said first direction again until said blocking element performs a first additional stroke and reaches said first reference position again and verifying correct calibration if the detected rotation angle of said calibration stroke is substantially the same as the detected rotation angle of said first additional stroke, • rotating said operating device while detecting said rotation angle of said operating device and said rotational direction of said rotations by means of said sensor system, and • determining the position of said blocking element based on said detected rotation angle and said detected rotational direction in relation to said first reference position and said second reference position. • connecting at least a reference part or a sensor of a sensor system to said operating device, so that said sensor system detects the rotation angle of said operating device and the rotational direction of said rotations, • calibrating said sensor system by ∘ rotating said operating device in a first direction until said blocking element reaches a first reference position in which said blocking element is in a fully closed or a fully open position, ∘ storing said first reference position as said fully closed or said fully open position in a memory, ∘ rotating said operating device in a second direction opposite said first direction until said blocking element performs a calibration stroke and reaches a second reference position of said fully closed or fully open position, ∘ storing said second reference position as said fully closed or said fully open position in said memory, ∘ rotating said operating device in said first direction again until said blocking element performs a first additional stroke and reaches said first reference position again and verifying correct calibration if the detected rotation angle of said calibration stroke is substantially the same as the detected rotation angle of said first additional stroke, ∘ rotating said operating device in a first direction until said blocking element reaches a first reference position in which said blocking element is in a fully closed or a fully open position, ∘ storing said first reference position as said fully closed or said fully open position in a memory, ∘ rotating said operating device in a second direction opposite said first direction until said blocking element performs a calibration stroke and reaches a second reference position of said fully closed or fully open position, ∘ storing said second reference position as said fully closed or said fully open position in said memory, ∘ rotating said operating device in said first direction again until said blocking element performs a first additional stroke and reaches said first reference position again and verifying correct calibration if the detected rotation angle of said calibration stroke is substantially the same as the detected rotation angle of said first additional stroke, • rotating said operating device while detecting said rotation angle of said operating device and said rotational direction of said rotations by means of said sensor system, and • determining the position of said blocking element based on said detected rotation angle and said detected rotational direction in relation to said first reference position and said second reference position.