Xiaomi Vacuum Roborock - DND on/off script?

I am trying to create Do Not Disturb on/off scripts for my Roborock vacuum. Is there a way to change the Do Not Disturb mode through scripts or automations?

I am trying to do something like this, but it obviously doesn‘t work that way:

vacuum_dnd_on:
  sequence:
    - service: vacuum.send_command
      data:
        entity_id: vacuum.xiaomi_vacuum_cleaner
        command: do_not_disturb
        params: ['on']

vacuum_dnd_off:
  sequence:
    - service: vacuum.send_command
      data:
        entity_id: vacuum.xiaomi_vacuum_cleaner
        command: do_not_disturb
        params: ['off']

And these are all the attributes that hassio shows me when I go into developer tools:


fan_speed_list:
  - Silent
  - Standard
  - Medium
  - Turbo
  - Gentle
battery_level: 100
battery_icon: 'mdi:battery-charging-100'
fan_speed: Silent
do_not_disturb: 'off'
do_not_disturb_start: '07:00:00'
do_not_disturb_end: '06:59:00'
cleaning_time: 71
cleaned_area: 42
cleaning_count: 635
total_cleaned_area: 7622
total_cleaning_time: 8515
main_brush_left: 284
side_brush_left: 184
filter_left: 134
sensor_dirty_left: 14
status: Charging
clean_start: '2020-08-07T12:15:08'
clean_stop: '2020-08-07T13:27:13'
friendly_name: Xiaomi Vacuum cleaner
supported_features: 14204

In the app on my phone I have a switch to turn DND off and on manually, I want to achieve the same thing in Home Assistant.

Any idea how to do this?

Did you ever figure out how to do this? I’d love to use it so that I can avoid emptying the bin when trying to get my son down for a nap

I haven’t been able to figure out to control the dnd switch, but everything else is controllable, so it is better to make timed automations inside Home Assistant rather than in the Roborock/Xiaomi app. For example you can tell the vacuum to clean a specific room in Home Assistant, which you could trigger by an automation that has a specific condition on it, like a manual switch (with an input_boolean number) you can achieve similar things. So you can have a switch through Home Assistant that you can manually turn off/on everytime you don’t want timed automations to trigger.