The initial idea was to stick a VL53L0X TOF distance sensor to the reservoir lid and get the water level from there.
Didn't work out. Not enough light reflected from the water surface lead to super flaky readings. What did work out in the end is this ...
1/2 inch PVC pipe, spray-painted black on the inside. Inside a white styrofoam `floater`.
The sensor was hot-glued to a piece of acrylic, which was mounted to one end of the PVC pipe. Hot glue for waterproofing the electronics. If it looks stupid but it works, it's not stupid ;)
Here's the water-level sensor, the PH-probe and the 1-wire temp. sensor in the reservoir.
The brown color of the water is due to using coconut coir as a growing medium. So far, this doesn't seem to have any negative effect on the plants.
Readings are a bit noisy (+- 1 mm) but seem to be stable and accurate. The large dips happen when water is pumped from the reservoir into the dutch buckets, flooding the system. There is a bit of delay until all the water has drained back into the reservoir.