I'm using a distance sensor with tasmota to measure ... retrieving the info via MQTT ... works great
see here