Set input_datetime with rotary button

Hello, I’m trying to make a physical display with rotary-button to use as a alarm clock.
Anyone experienced in setting the alarmtime by turning the rotary button?
looking for something like this:\

  • long press: switch from displaying time to set-alarmtime hrs
  • turn up/down to change hrs accordingly
  • short press change to minutes
  • turn up/down to set the minutes
  • long press to set the alarmtime and return to normal time display

Using a Wemos d1 mini with a MAX7219 4x8x8 matrix led display and a rotary button. ESPhome.