Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
An optic float switch is certainly possible, but I would expect them to be expensive. No, wait! It is enough to dip the polished end of the fiber into the water on the high level, that would certainly change the reflection at the end of the fiber.