Motor on a roller blind - ESPHome version?

Where should this snippet be located? I have asked my question more specific here:

I can’t get it to work “that” way (to control the slider form within homeassistant)