Ha, I just built something like this with a Raspberry Pi for fun. My standing desk (a Conset) only had a up/down button so I used a RPi + relay hat + distance sensor + screen/buttons to allow height presets as well as control via Homebridge:
Not exactly cost effective, but it was a fun way to learn about relays.