Float
A float floating on a fluid changes ist vertical position in proportion to the level.
A permanent magnet integrated in the float generates a constant magnetic field, thus causing a reed contact in this field to switch.
Installation example: float