Random Position for Cover

Hi, I´m trying to set the position of a cover from a random integer number but I´m not able to.
This is what I´m trying:

device_id: ----
domain: cover
entity_id: ----
type: set_position
position: (range(1, 20)|random|int)

And this is what I receive when trying to save my automation:

Message malformed: value must be one of [‘close’, ‘close_tilt’, ‘open’, ‘open_tilt’, ‘stop’] for dictionary value @ data[‘type’]

What am I doing wrong?

service: cover.set_cover_position
data:
  position: >
    {{ range(1,20) | random | int }}
target:
  entity_id: cover.your_cover_entity_name

i’m using entity id’s instead of device id because of this:

but if you really want to stay with device_id, you can still use the position template