Has anyone tried to put an HC-SR04 in a tube.

I have found you need a nice clean water surface, no froth or muck, as it will not reflect the signal back.

You could put a hard, loose-fitting float in the tube to avoid this, maybe.
You'd probably have to put a filter on the tube to avoid debris entering and jamming the float.
Limescale could also be a problem.

Maybe a U-bend to isolate the sensor?