Change 2 separate switches into a shutter/ screen control

Hi There

i have two switches (relay) to control the screens (rolling shutters) at ESPHOME
One switch for up and one for down, like this

image
The switch have to be active during up or down. when not active the screen stops

But i could like something like this
image
How can i combine them , this a template covers ?

The screen does not have any sensors that it is up or down