Welcome to the Fourm.
as a new member, we would ask you to read How To Use This Forum.
#7 about positing code. how to use this forum is found at the top of every forum.
as for your distance problem.
empty the machine completely.
pour in exactly 1 litre of cold water.
measure the height of the water.
pour in exactly 1 more litre of cold water
measure the height of the water.
repeat with hot water.
you could pour in 1/10 litre and recored the level for each 1/10 litre.
then you would know distance is equal to litres.