Roborock Automation with xiaomi mi integration help please

Hi
I’m trying to write some automations for my Roborock but I keep hitting errors:

alias: test vacuum after dinner
description: Mon-Thu 19:15 vacuum kitchen x2
trigger:
  - platform: time
    at: "19:15:00"
condition:
  - condition: time
    weekday:
      - mon
      - tue
      - wed
      - thu
action:
  - service: vacuum.send_command
    data:
      repeats: 2
      command: app_segment_clean
      params: 20
      set_fan_speed: Standard
    target:
      entity_id: vacuum.roborock_s5
mode: single

param 20 is the id for the kitchen; I want it to vacuum twice; I want the fan set to standard.
When I test this I get

Error: extra keys not allowed @ data['repeats']

When I remove repeats I get the same error for fan_speed.
Am I not able to set all these parameters in one go?

I think your formatting is incorrect. It should look something like this:

service: vacuum.send_command
data:
  command: app_segment_clean
  params:
    - segments:
        - 20
      repeat: 2
target:
  entity_id: vacuum.roborock_s5

For the fan speed you might have to have a separate vacuum send command for that.

Thank you so much, it worked!
I really don’t know when I’m going to get the hang of YAML layouts.
For future reference, I tried this for as a separate command for setting fan speed - it didn’t work:

service: vacuum.send_command
data:
  command: set_fan_speed
  params: Silent
target:
  entity_id: vacuum.roborock_s5
alias: set fan speed silent

so I read the documentation again and went through the GUI calling a service, and got this which did work:

service: vacuum.set_fan_speed
target:
  entity_id: vacuum.roborock_s5
data:
  fan_speed: Silent

I’ve only had my roborock for about a month but in my quest to automate it I found this post to be helpful for changing the various modes. Even though it was for the S7 the values so far to seem to be the same for the S8. Hope this is helpful for you as well.

Thanks for that.
I’m trying to select the number of repeats from the dashboard but unfortunately I haven’t managed to get it to work:

type: custom:button-card
tap_action:
  action: call-service
  service: vacuum.send_command
  data:
    command: app_segment_clean
    params:
      - segments:
          - 19
        repeats: '[{{ states("input_number.vacuum_repeats") | int }}]'
  target:
    entity_id: vacuum.roborock_s5

I’ve tried with repeat and repeats and also with

'[{{ states("input_number.vacuum_repeats") | int }}]'

as well as

'{{ states("input_number.vacuum_repeats") | int }}'

I don’t know what I’m doing wrong but I can’t seem to pass in the number - (I’ve tried it both with and without int as well!