Roborock Integration with Q Revo Vacuum / Mop - Segment cleaning

May I ask how “vacuum only” and “mop only” automations should look like?
Which of the parameters need to be set for “vacuum, but not mopping” mode?

alias: Run Vacuum-only 
sequence:
  - service: vacuum.send_command
    data_template:
      command: set_mop_mode????
      params: 300???? 
    target:
      entity_id: vacuum.roborock_s8_pro_ultra

  - service: vacuum.send_command
    data_template:
      command: app_segment_clean
      params:
        - segments:
            - 16
            - 17
          repeat: 2
    target:
      entity_id: vacuum.roborock_s8_pro_ultra
mode: single
icon: mdi:robot-vacuum

So I just realized I may not have posted back here but I did solve the problem. It just wasn’t intuitive, and someone pointed me in the right direction. See example below. The key piece was setting the mob intensity to off “select.roborock_q_revo_bed_mop_intensity”

alias: Action - Spot Clean Litter after Raking
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.primary_rake_status
    to: raking
condition:
  - condition: device
    device_id: 976d6012174bdfadc3b28a966561f617
    domain: vacuum
    entity_id: a378de65d7ee5456288691d97997c6f8
    type: is_docked
  - condition: time
    after: "09:00:00"
    before: "22:30:00"
action:
  - service: select.select_option
    data:
      option: "off"
    target:
      entity_id: select.roborock_q_revo_bed_mop_intensity
  - service: vacuum.send_command
    data:
      command: app_segment_clean
      params:
        - segments:
            - 17
          repeat: 1
    target:
      entity_id: vacuum.roborock_q_revo_bed
    enabled: true
mode: single

How can I find the correct room id’s with the Q Revo? What is described in Xiaomi Miio - Home Assistant doesn’t work eith the Roborock app.

Check out the " HOW CAN I CLEAN A SPECIFIC ROOM" section of the this link: https://www.home-assistant.io/integrations/roborock/

Hi,
Could you please elaborate on how the camera was created and how you tset this up exactly? I have the qrevo but am struggling enormously with the xiaomi-lovelace-card

For me it worked out of the box.

If you view the Q Revo on the HA UI > Integrations section you should see the entity. Something like roborock_q_revo_floor_name.

Have you setup the map on the Roborock app?

1 Like

I’ve also been wondering how people are getting the room IDs. I have the Q Revo, and when I go to services, roborock.get_maps is not an available action type… Map loads nicely on my main screen, but no details about specific room IDs.

I am getting all the room ID’s. However I am not able to start cleaning with the Call Service.

This is the code I’ve used, both in a script an in an automation. Neither will start the cleaning.

service: vacuum.send_command
data:
  command: app_segment_clean
  params:
    segments:
      - 16
      - 21
    repeat: 1
target:
  entity_id: vacuum.r2_q2

From developer tools I get this:

vacuum.r2_q2:
  maps:
    - flag: 0
      name: ""
      rooms:
        "16": Living room
        "17": Kitchen
        "18": Corridor1
        "19": Dining room
        "20": Corridor
        "21": Hall
    - flag: 1
      name: ""
      rooms:
        "16": Bedroom
        "17": Corridor
        "18": Bathroom
        "19": Sauna
        "20": Master bedroom
        "21": Shower
    - flag: 2
      name: ""
      rooms: {}

I have multiple level house so multiple maps.

I don’t understand why it’s not working. I have the Roborock integration installed.

Did you try loading the floor level first?

service: vacuum.send_command
target:
  entity_id: vacuum.r2_q2
data:
  command: load_multi_map
  params: 0

Neither load_multi_map or recover_map did anything. But somehow I managed to start cleaning with this:

service: vacuum.send_command
data:
  entity_id: vacuum.r2_q2
  command: app_segment_clean
  params: [17] 

I still have to figure out how to incorporate multiple rooms and repeats.

But thank you for the reply :slight_smile:

Seperate rooms by comma. Try this

service: vacuum.send_command
target:
  entity_id: vacuum.r2_q2
data:
  command: app_segment_clean
  params:
    - segments: [16,21]
      repeat: 1

Hi Peter, would you like to share all the project for the Qrevo?
I try to follow the thread, but i’m such a noob.
Thx Leo.


I am currently working on the Qrevo visualization it is not finished yet

type: custom:xiaomi-vacuum-map-card
map_source:
  camera: image.roborock_qrevo_s_eg
  crop:
    top: 120
    bottom: 90
    left: 10
    right: 80
calibration_source:
  calibration_points:
    - vacuum:
        x: 25500
        'y': 25500
      map:
        x: 165
        'y': 305
    - vacuum:
        x: 26500
        'y': 25500
      map:
        x: 185
        'y': 305
    - vacuum:
        x: 25500
        'y': 26500
      map:
        x: 165
        'y': 285
entity: vacuum.roborock_qrevo_s
vacuum_platform: default
two_finger_pan: false
map_locked: true
tiles:
  - tile_id: status
    entity: sensor.roborock_qrevo_s_status
    label: Status
    icon: mdi:robot-vacuum
    translations:
      starting: Starte
      charger disconnected: Ladegerät getrennt
      idle: Inaktiv
      remote control active: Fernsteuerung aktiv
      cleaning: Säubern
      returning home: Kehre zur Ladestation zurück
      manual mode: Manueller Modus
      charging: Lade
      charging problem: Lade-Problem
      paused: Pause
      spot cleaning: Spot-Reinigung
      error: Fehler
      shutting down: Herunterfahren
      updating: Aktualisiere
      docking: Andocken
      going to target: Fahre zum Ziel
      zoned cleaning: Zonen-Reinigung
      emptying the bin: Leere den Staubbehälter
      charging complete: Ladung vollständig
      device offline: Gerät offline
  - tile_id: battery_level
    entity: vacuum.roborock_qrevo_s
    label: Batterie
    attribute: battery_level
    icon: mdi:battery-charging-100
    unit: '%'
  - tile_id: fan_speed
    entity: vacuum.roborock_qrevo_s
    label: Lüftergeschwindigkeit
    attribute: fan_speed
    icon: mdi:fan
    translations:
      'off': Aus
      quiet: Leise
      balanced: Standard
      turbo: Turbo
      max: Max
      custom: Benutzerdef.
      max_plus: Vollgas
  - tile_id: sensor_dirty_left
    label: Sensoren verbleibend
    unit: h
    multiplier: 0.0002777777777777778
    hold_action:
      action: call-service
      service: vacuum.send_command
      confirmation: true
      service_data:
        command: reset_consumable
        params: sensor_dirty_time
        entity_id: vacuum.roborock_qrevo_s
    entity: sensor.roborock_qrevo_s_verbleibende_sensorzeit
    icon: mdi:eye-outline
    precision: 0
    translations: {}
  - tile_id: filter_left
    label: Filter verbleibend
    unit: h
    multiplier: 0.0002777777777777778
    hold_action:
      action: call-service
      service: vacuum.send_command
      confirmation: true
      service_data:
        command: reset_consumable
        params: filter_work_time
        entity_id: vacuum.roborock_qrevo_s
    entity: sensor.roborock_qrevo_s_verbleibende_filterzeit
    icon: mdi:air-filter
    precision: 0
    translations: {}
  - tile_id: main_brush_left
    label: Hauptbürste verbleibend
    unit: h
    multiplier: 0.0002777777777777778
    hold_action:
      action: call-service
      service: vacuum.send_command
      confirmation: true
      service_data:
        command: reset_consumable
        params: main_brush_work_time
        entity_id: vacuum.roborock_qrevo_s
    entity: sensor.roborock_qrevo_s_verbleibende_zeit_der_hauptburste
    icon: mdi:brush
    precision: 0
    translations: {}
  - tile_id: side_brush_left
    label: Seitenbürste verbleibend
    unit: h
    multiplier: 0.0002777777777777778
    hold_action:
      action: call-service
      service: vacuum.send_command
      confirmation: true
      service_data:
        command: reset_consumable
        params: side_brush_work_time
        entity_id: vacuum.roborock_qrevo_s
    entity: sensor.roborock_qrevo_s_verbleibende_zeit_der_seitenburste
    icon: mdi:brush
    precision: 0
    translations: {}
  - tile_id: mob_try_left
    label: Mob trocknen verbleibend
    unit: min
    multiplier: 0.0166666667
    hold_action:
      action: call-service
      service: vacuum.send_command
      confirmation: true
      service_data:
        command: reset_consumable
        params: side_brush_work_time
        entity_id: vacuum.roborock_qrevo_s
    entity: sensor.roborock_qrevo_s_verbleibende_zeit_zum_trocknen_des_mopps
    icon: mdi:brush
    precision: 0
    translations: {}
icons:
  - icon: mdi:play
    conditions:
      - entity: vacuum.roborock_qrevo_s
        value_not: cleaning
      - entity: vacuum.roborock_qrevo_s
        value_not: error
      - entity: vacuum.roborock_qrevo_s
        value_not: returning
    tooltip: Start
    tap_action:
      action: call-service
      service: vacuum.start
      service_data:
        entity_id: vacuum.roborock_qrevo_s
  - icon: mdi:pause
    conditions:
      - entity: vacuum.roborock_qrevo_s
        value_not: docked
      - entity: vacuum.roborock_qrevo_s
        value_not: idle
      - entity: vacuum.roborock_qrevo_s
        value_not: error
      - entity: vacuum.roborock_qrevo_s
        value_not: paused
    tooltip: Pause
    tap_action:
      action: call-service
      service: vacuum.pause
      service_data:
        entity_id: vacuum.roborock_qrevo_s
  - icon: mdi:stop
    conditions:
      - entity: vacuum.roborock_qrevo_s
        value_not: docked
      - entity: vacuum.roborock_qrevo_s
        value_not: idle
      - entity: vacuum.roborock_qrevo_s
        value_not: error
      - entity: vacuum.roborock_qrevo_s
        value_not: paused
    tooltip: Stop
    tap_action:
      action: call-service
      service: vacuum.stop
      service_data:
        entity_id: vacuum.roborock_qrevo_s
  - icon: mdi:home-map-marker
    conditions:
      - entity: vacuum.roborock_qrevo_s
        value_not: docked
      - entity: vacuum.roborock_qrevo_s
        value_not: returning
    tooltip: Return to base
    tap_action:
      action: call-service
      service: vacuum.return_to_base
      service_data:
        entity_id: vacuum.roborock_qrevo_s
  - icon: mdi:target-variant
    conditions:
      - entity: vacuum.roborock_qrevo_s
        value_not: docked
      - entity: vacuum.roborock_qrevo_s
        value_not: error
      - entity: vacuum.roborock_qrevo_s
        value_not: cleaning
      - entity: vacuum.roborock_qrevo_s
        value_not: returning
    tooltip: Clean spot
    tap_action:
      action: call-service
      service: vacuum.clean_spot
      service_data:
        entity_id: vacuum.roborock_qrevo_s
  - icon: mdi:map-marker
    tooltip: Locate
    tap_action:
      action: call-service
      service: vacuum.locate
      service_data:
        entity_id: vacuum.roborock_qrevo_s
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: 'off'
    conditions:
      - entity: vacuum.roborock_qrevo_s
        attribute: fan_speed
        value: 'off'
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.roborock_qrevo_s
        fan_speed: 'off'
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: quiet
    conditions:
      - entity: vacuum.roborock_qrevo_s
        attribute: fan_speed
        value: quiet
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.roborock_qrevo_s
        fan_speed: quiet
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: balanced
    conditions:
      - entity: vacuum.roborock_qrevo_s
        attribute: fan_speed
        value: balanced
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.roborock_qrevo_s
        fan_speed: balanced
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: Turbo
    conditions:
      - entity: vacuum.roborock_qrevo_s
        attribute: fan_speed
        value: turbo
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.roborock_qrevo_s
        fan_speed: turbo
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: max
    conditions:
      - entity: vacuum.roborock_qrevo_s
        attribute: fan_speed
        value: max
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.roborock_qrevo_s
        fan_speed: max
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: custom
    conditions:
      - entity: vacuum.roborock_qrevo_s
        attribute: fan_speed
        value: custom
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.roborock_qrevo_s
        fan_speed: custom
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: max_plus
    conditions:
      - entity: vacuum.roborock_qrevo_s
        attribute: fan_speed
        value: max_plus
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.roborock_qrevo_s
        fan_speed: max_plus
  - icon: mdi:fan-alert
    conditions:
      - entity: vacuum.roborock_qrevo_s
        attribute: fan_speed
        value_not: 'off'
      - entity: vacuum.roborock_qrevo_s
        attribute: fan_speed
        value_not: quiet
      - entity: vacuum.roborock_qrevo_s
        attribute: fan_speed
        value_not: balanced
      - entity: vacuum.roborock_qrevo_s
        attribute: fan_speed
        value_not: turbo
      - entity: vacuum.roborock_qrevo_s
        attribute: fan_speed
        value_not: max
      - entity: vacuum.roborock_qrevo_s
        attribute: fan_speed
        value_not: custom
      - entity: vacuum.roborock_qrevo_s
        attribute: fan_speed
        value_not: max_plus
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.roborock_qrevo_s
        fan_speed: 'off'
map_modes:
  - template: vacuum_clean_segment
    predefined_selections:
      - id: '19'
        icon:
          name: mdi:toilet
          x: 22500
          'y': 30900
        label:
          text: WC
          x: 22500
          'y': 31000
          offset_y: 30
        outline:
          - - 21900
            - 30000
          - - 23000
            - 30000
          - - 23000
            - 31400
          - - 21900
            - 31400
      - id: '18'
        icon:
          name: mdi:tortoise
          x: 19000
          'y': 32500
        label:
          text: Vorraum
          x: 19000
          'y': 32500
          offset_y: 30
        outline:
          - - 18200
            - 31100
          - - 20400
            - 31100
          - - 20400
            - 31500
          - - 25500
            - 31500
          - - 25500
            - 32400
          - - 19500
            - 32400
          - - 19500
            - 34000
          - - 18200
            - 34000
      - id: '16'
        icon:
          name: mdi:silverware-fork-knife
          x: 21500
          'y': 34500
        label:
          text: Küche
          x: 21500
          'y': 34500
          offset_y: 30
        outline:
          - - 20000
            - 32500
          - - 23000
            - 32500
          - - 23000
            - 36000
          - - 20000
            - 36000
      - id: '20'
        icon:
          name: mdi:bathtub-outline
          x: 23600
          'y': 29300
        label:
          text: Bad
          x: 23600
          'y': 29300
          offset_y: 30
        outline:
          - - 22400
            - 28100
          - - 24690
            - 28100
          - - 24690
            - 31400
          - - 23200
            - 31400
          - - 23200
            - 29800
          - - 22400
            - 29800
      - id: '21'
        icon:
          name: mdi:food
          x: 21100
          'y': 30000
        label:
          text: Speis
          x: 21100
          'y': 30000
          offset_y: 30
        outline:
          - - 20600
            - 28500
          - - 21600
            - 28500
          - - 21600
            - 31400
          - - 20600
            - 31400
      - id: '17'
        icon:
          name: mdi:stove
          x: 23650
          'y': 35200
        label:
          text: Küche Herd
          x: 23650
          'y': 35200
          offset_y: 30
        outline:
          - - 23200
            - 33700
          - - 24200
            - 33700
          - - 24200
            - 36500
          - - 23200
            - 36500
      - id: '23'
        icon:
          name: mdi:bed
          x: 27500
          'y': 30000
        label:
          text: Wohnzimmer Bett
          x: 27500
          'y': 30000
          offset_y: 30
        outline:
          - - 25500
            - 28600
          - - 29250
            - 28600
          - - 29250
            - 31200
          - - 25500
            - 31200
      - id: '22'
        icon:
          name: mdi:sofa
          x: 27500
          'y': 33800
        label:
          text: Wohnzimmer TV
          x: 27500
          'y': 33800
          offset_y: 30
        outline:
          - - 25500
            - 31200
          - - 29250
            - 31200
          - - 29250
            - 35900
          - - 25500
            - 35900

2 Likes

this is awesome. Please keep me posted!!