A float switch of a simple dirty water pump. I had milled it open and took a photo. You can find identical switches at sewage, sump or submersible pumps. 
<p>In this position the pump is switched on. The ball slips, according to the position of the switch by its own weight in one or the other position. As a result of this the black lever moves the little red pin of the micro switch (the black rectangular box).
</p>
I believe i opened the back side of the switch. But it doesn't really matter because all functional parts are symmetric.
<a href="//commons.wikimedia.org/wiki/User:Martin_Meise" title="User:Martin Meise">Martin Meise</a>
CC BY 3.0
<span class="int-own-work" lang="en">Own work</span>