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?