Motorized desk + programmable controller

Hello,
i have motorized desk, but controller is simple - while pressing button its goes up/down.

Was wondering if its possible to upgrade it with something more sophisticated ie memory (height), or during specific interval move it up or down.
The former functionality i can achieve with simple zigbee relay - i believe… but not sure how to measure for how long relay has to be on to change the proper height.

Thank you!

If it’s commercial product, I expect it has limit switches to switch off the motor when arriving to max/min height. So starting from one of those known positions you can simply use relatively common device, a clock, to measure time vs height…