I upgraded the mechanical sensor of my DIY IKEA SmartDesk to ultrasonic rangefinder to set it's height from the floor automatically which greatly improved its usability!
I removed the original magnetic limit-switch and replaced it with ultrasonic PING-sensor that could measure the actual height from the floor.