Yes, works a treat.
https://community.home-assistant.io/t/water-tank-level-and-water-volume-with-esphome/