Roborock S7MaxV - HA Integration

How did you add the map/card?

1 Like

Last update of GitHub - humbertogontijo/homeassistant-roborock

2 Likes

Does Humberto’s roborock HA integration allow setting up automations in HA such that you could have a roborock vacuum a specific room on a zigbee button press? Thanks.

1 Like

Yes, it is possible. The integration offers a service to do this. The screenshot below cleans my kitchen. To get the segment IDs, download and install the Xiaomi Vacuum Map card and generate the room configuration. That will tell you which ID each room has you generated in the Roborock app.

Also have a look at https://github.com/humbertogontijo/homeassistant-roborock/discussions/40 which explains how to adapt the vacuum card to work with this integration.

However, notice that at the moment, it seems the current version (I am on 0.0.3) has an issue that the entity stops updating after a while, and only a restart of HA seems to fix. It is apparently being worked on (Bug: Entity still not updating ¡ Issue #41 ¡ humbertogontijo/homeassistant-roborock ¡ GitHub). The service calls still works even when the entity stops updating.

2 Likes

I would also like to create automation when i need to refill the water tank and empty the dirty water tank.
Do you know which attribute point me to this ?

The current roborock HACS integration doesn’t pull the maintenance data yet. You’d have to use the MiHome app/integration for the time being

Stupid question, but I never entered an email address when starting the Mi Home app. What do I use for Cloud username when setting up the integration?

Yes you can do this based on the dock error status attribute. 38 means the clean water tank is empty (or removed), while 39 means the dirty water tank is full (or removed).

Also have a look at the github discussion where we are trying to figure out the meaning of all the status flags.

Yes thank you I can confirm this myself now also.
I noticed that after filling the water the alarm (RED LED on the tank) disappeared but the attribute remains the same.
I have seen in the discussion you linked that this issue is mentioned that it will only update after clean is started .
any way to go around this ?
any plan to update a fix for that ?

Which map card are you using? Can you select rooms to clean?

Install the hacs integration. camera from the bot is installed automatically. My Config:

Next to that card, you can also use the Xiaomi vacuum map card. If you are not afraid of some yaml coding, you can do very nifty things with this card. It is fully compatible with the roborock integration.

After installation, add it and click on “generate static config” and then on “generate room configuration”.

You can then select individual rooms. You can also do this for multiple floors with additional presets. You would have to first swap to a different floor and regenerate the room config. It is a bit of work, but once setup, you can add buttons to switch to a different floor and select the rooms belonging to this floor.

Notice that at the moment, the roborock integration does not yet reload the map when you change floors, but the room selection does work and once you move it to the new floor, the map will update once it starts cleaning.

If you want, you can add buttons for setting up the mop as well using the correct service calls.

For reference, below is my code for multiple floors.

type: custom:xiaomi-vacuum-map-card
preset_name: Beneden
conditions:
  - entity: vacuum.roborock_s7_maxv
    attribute: map_status
    value: 3
map_source:
  camera: camera.roborock_s7_maxv_map
  crop:
    top: 200
    right: 160
    left: 290
    bottom: 260
calibration_source:
  camera: true
entity: vacuum.roborock_s7_maxv
vacuum_platform: send_command
map_locked: false
map_modes:
  - name: Zone cleanup
    icon: mdi:select-drag
    run_immediately: false
    coordinates_rounding: true
    selection_type: MANUAL_RECTANGLE
    max_selections: 5
    repeats_type: INTERNAL
    max_repeats: 3
    service_call_schema:
      service: vacuum.send_command
      service_data:
        command: app_zoned_clean
        params: '[[selection]]'
        entity_id: '[[entity_id]]'
    predefined_selections: []
    variables: {}
  - name: Pin & Go
    icon: mdi:map-marker-plus
    run_immediately: false
    coordinates_rounding: true
    selection_type: MANUAL_POINT
    max_selections: 999
    repeats_type: NONE
    max_repeats: 1
    service_call_schema:
      service: vacuum.send_command
      service_data:
        command: app_goto_target
        params: '[[selection]]'
        entity_id: '[[entity_id]]'
    predefined_selections: []
    variables: {}
  - name: Rooms
    icon: mdi:floor-plan
    run_immediately: false
    coordinates_rounding: true
    selection_type: ROOM
    max_selections: 999
    repeats_type: REPEAT
    max_repeats: 3
    service_call_schema:
      service: vacuum.send_command
      service_data:
        command: app_segment_clean
        params: '[[selection]]'
        entity_id: '[[entity_id]]'
    predefined_selections:
      - id: 16
        icon:
          name: mdi:broom
          x: 22725
          'y': 23550
        label:
          text: Living
          x: 22725
          'y': 23550
          offset_y: 35
        outline:
          - - 19600
            - 19600
          - - 25850
            - 19600
          - - 25850
            - 27500
          - - 19600
            - 27500
      - id: 17
        icon:
          name: mdi:broom
          x: 17850
          'y': 21125
        label:
          text: Buiten
          x: 17850
          'y': 21125
          offset_y: 35
        outline:
          - - 16150
            - 19550
          - - 19550
            - 19550
          - - 19550
            - 22700
          - - 16150
            - 22700
      - id: 18
        icon:
          name: mdi:broom
          x: 25950
          'y': 23675
        label:
          text: Gang
          x: 25950
          'y': 23675
          offset_y: 35
        outline:
          - - 24000
            - 22600
          - - 27900
            - 22600
          - - 27900
            - 24750
          - - 24000
            - 24750
      - id: 19
        icon:
          name: mdi:broom
          x: 25750
          'y': 21325
        label:
          text: Keuken
          x: 25750
          'y': 21325
          offset_y: 35
        outline:
          - - 24000
            - 20150
          - - 27500
            - 20150
          - - 27500
            - 22500
          - - 24000
            - 22500
    variables: {}
tiles:
  - tile_id: status
    entity: vacuum.roborock_s7_maxv
    label: Status
    icon: mdi:robot-vacuum
  - tile_id: battery_level
    entity: vacuum.roborock_s7_maxv
    label: Battery
    attribute: battery_level
    icon: mdi:battery-90
    unit: '%'
  - tile_id: cleaning_time
    entity: sensor.roborock_s7_maxv_current_clean_duration
    label: Cleaning
    multiplier: 0.016667
    precision: 0
    icon: mdi:clock
    unit: ' min'
icons:
  - icon: mdi:play
    conditions:
      - entity: vacuum.roborock_s7_maxv
        value_not: cleaning
      - entity: vacuum.roborock_s7_maxv
        value_not: error
      - entity: vacuum.roborock_s7_maxv
        value_not: returning
    tooltip: Start
    tap_action:
      action: call-service
      service: vacuum.start
      service_data:
        entity_id: vacuum.roborock_s7_maxv
  - icon: mdi:pause
    conditions:
      - entity: vacuum.roborock_s7_maxv
        value_not: docked
      - entity: vacuum.roborock_s7_maxv
        value_not: idle
      - entity: vacuum.roborock_s7_maxv
        value_not: error
      - entity: vacuum.roborock_s7_maxv
        value_not: paused
    tooltip: Pause
    tap_action:
      action: call-service
      service: vacuum.pause
      service_data:
        entity_id: vacuum.roborock_s7_maxv
  - icon: mdi:stop
    conditions:
      - entity: vacuum.roborock_s7_maxv
        value_not: docked
      - entity: vacuum.roborock_s7_maxv
        value_not: idle
      - entity: vacuum.roborock_s7_maxv
        value_not: error
      - entity: vacuum.roborock_s7_maxv
        value_not: paused
    tooltip: Stop
    tap_action:
      action: call-service
      service: vacuum.stop
      service_data:
        entity_id: vacuum.roborock_s7_maxv
  - icon: mdi:home-map-marker
    conditions:
      - entity: vacuum.roborock_s7_maxv
        value_not: docked
      - entity: vacuum.roborock_s7_maxv
        value_not: returning
    tooltip: Return to base
    tap_action:
      action: call-service
      service: vacuum.return_to_base
      service_data:
        entity_id: vacuum.roborock_s7_maxv
  - icon: mdi:target-variant
    conditions:
      - entity: vacuum.roborock_s7_maxv
        value_not: docked
      - entity: vacuum.roborock_s7_maxv
        value_not: error
      - entity: vacuum.roborock_s7_maxv
        value_not: cleaning
      - entity: vacuum.roborock_s7_maxv
        value_not: returning
    tooltip: Clean spot
    tap_action:
      action: call-service
      service: vacuum.clean_spot
      service_data:
        entity_id: vacuum.roborock_s7_maxv
  - icon: mdi:home-floor-1
    tooltip: Gelijkvloers
    tap_action:
      action: call-service
      service: vacuum.send_command
      service_data:
        entity_id: vacuum.roborock_s7_maxv
        command: load_multi_map
        params: 1
  - icon: mdi:home-floor-2
    tooltip: Boven
    tap_action:
      action: call-service
      service: vacuum.send_command
      service_data:
        entity_id: vacuum.roborock_s7_maxv
        command: load_multi_map
        params: 2
two_finger_pan: true
additional_presets:
  - preset_name: Gelijkvloers
    conditions:
      - entity: vacuum.roborock_s7_maxv
        attribute: map_status
        value: 7
    activate_on_switch: false
    activate:
      service: vacuum.send_command
      service_data:
        entity_id: vacuum.roborock_s7_maxv
        command: load_multi_map
        params: 1
    map_source:
      camera: camera.roborock_s7_maxv_map
    calibration_source:
      camera: true
    entity: vacuum.roborock_s7_maxv
    vacuum_platform: send_command
    map_locked: false
    map_modes:
      - name: Zone cleanup
        icon: mdi:select-drag
        run_immediately: false
        coordinates_rounding: true
        selection_type: MANUAL_RECTANGLE
        max_selections: 5
        repeats_type: INTERNAL
        max_repeats: 3
        service_call_schema:
          service: vacuum.send_command
          service_data:
            command: app_zoned_clean
            params: '[[selection]]'
            entity_id: '[[entity_id]]'
        predefined_selections: []
        variables: {}
      - name: Pin & Go
        icon: mdi:map-marker-plus
        run_immediately: false
        coordinates_rounding: true
        selection_type: MANUAL_POINT
        max_selections: 999
        repeats_type: NONE
        max_repeats: 1
        service_call_schema:
          service: vacuum.send_command
          service_data:
            command: app_goto_target
            params: '[[selection]]'
            entity_id: '[[entity_id]]'
        predefined_selections: []
        variables: {}
      - template: vacuum_clean_segment
        predefined_selections:
          - id: 16
            icon:
              name: mdi:bed-double
              x: 20700
              'y': 29075
            label:
              text: Bedroom
              x: 20700
              'y': 29075
              offset_y: 35
            outline:
              - - 19100
                - 25050
              - - 22300
                - 25050
              - - 22300
                - 33100
              - - 19100
                - 33100
          - id: 17
            icon:
              name: mdi:broom
              x: 24950
              'y': 26325
            label:
              text: Room 17
              x: 24950
              'y': 26325
              offset_y: 35
            outline:
              - - 22350
                - 25100
              - - 27550
                - 25100
              - - 27550
                - 27550
              - - 22350
                - 27550
          - id: 18
            icon:
              name: mdi:toilet
              x: 22900
              'y': 27900
            label:
              text: WC
              x: 22900
              'y': 27900
              offset_y: 35
            outline:
              - - 22450
                - 26100
              - - 23350
                - 26100
              - - 23350
                - 29700
              - - 22450
                - 29700
          - id: 19
            icon:
              name: mdi:monitor
              x: 25425
              'y': 28625
            label:
              text: Office
              x: 25425
              'y': 28625
              offset_y: 35
            outline:
              - - 23500
                - 27300
              - - 27350
                - 27300
              - - 27350
                - 29950
              - - 23500
                - 29950
        variables: {}
    tiles:
      - tile_id: status
        entity: vacuum.roborock_s7_maxv
        label: Status
        icon: mdi:robot-vacuum
      - tile_id: battery_level
        entity: vacuum.roborock_s7_maxv
        label: Battery
        attribute: battery_level
        icon: mdi:battery-90
        unit: '%'
      - tile_id: cleaning_time
        entity: sensor.roborock_s7_maxv_current_clean_duration
        label: Cleaning
        multiplier: 0.016667
        precision: 0
        icon: mdi:clock
        unit: ' min'
    icons:
      - icon: mdi:play
        conditions:
          - entity: vacuum.roborock_s7_maxv
            value_not: cleaning
          - entity: vacuum.roborock_s7_maxv
            value_not: error
          - entity: vacuum.roborock_s7_maxv
            value_not: returning
        tooltip: Start
        tap_action:
          action: call-service
          service: vacuum.start
          service_data:
            entity_id: vacuum.roborock_s7_maxv
      - icon: mdi:pause
        conditions:
          - entity: vacuum.roborock_s7_maxv
            value_not: docked
          - entity: vacuum.roborock_s7_maxv
            value_not: idle
          - entity: vacuum.roborock_s7_maxv
            value_not: error
          - entity: vacuum.roborock_s7_maxv
            value_not: paused
        tooltip: Pause
        tap_action:
          action: call-service
          service: vacuum.pause
          service_data:
            entity_id: vacuum.roborock_s7_maxv
      - icon: mdi:stop
        conditions:
          - entity: vacuum.roborock_s7_maxv
            value_not: docked
          - entity: vacuum.roborock_s7_maxv
            value_not: idle
          - entity: vacuum.roborock_s7_maxv
            value_not: error
          - entity: vacuum.roborock_s7_maxv
            value_not: paused
        tooltip: Stop
        tap_action:
          action: call-service
          service: vacuum.stop
          service_data:
            entity_id: vacuum.roborock_s7_maxv
      - icon: mdi:home-map-marker
        conditions:
          - entity: vacuum.roborock_s7_maxv
            value_not: docked
          - entity: vacuum.roborock_s7_maxv
            value_not: returning
        tooltip: Return to base
        tap_action:
          action: call-service
          service: vacuum.return_to_base
          service_data:
            entity_id: vacuum.roborock_s7_maxv
      - icon: mdi:target-variant
        conditions:
          - entity: vacuum.roborock_s7_maxv
            value_not: docked
          - entity: vacuum.roborock_s7_maxv
            value_not: error
          - entity: vacuum.roborock_s7_maxv
            value_not: cleaning
          - entity: vacuum.roborock_s7_maxv
            value_not: returning
        tooltip: Clean spot
        tap_action:
          action: call-service
          service: vacuum.clean_spot
          service_data:
            entity_id: vacuum.roborock_s7_maxv
      - icon: mdi:home-floor-0
        tooltip: Beneden
        tap_action:
          action: call-service
          service: vacuum.send_command
          service_data:
            entity_id: vacuum.roborock_s7_maxv
            command: load_multi_map
            params: 0
      - icon: mdi:home-floor-2
        tooltip: Boven
        tap_action:
          action: call-service
          service: vacuum.send_command
          service_data:
            entity_id: vacuum.roborock_s7_maxv
            command: load_multi_map
            params: 2
  - preset_name: Boven
    conditions:
      - entity: vacuum.roborock_s7_maxv
        attribute: map_status
        value: 11
    map_source:
      camera: camera.roborock_s7_maxv_map
    calibration_source:
      camera: true
    entity: vacuum.roborock_s7_maxv
    vacuum_platform: send_command
    map_locked: false
    map_modes:
      - name: Zone cleanup
        icon: mdi:select-drag
        run_immediately: false
        coordinates_rounding: true
        selection_type: MANUAL_RECTANGLE
        max_selections: 5
        repeats_type: INTERNAL
        max_repeats: 3
        service_call_schema:
          service: vacuum.send_command
          service_data:
            command: app_zoned_clean
            params: '[[selection]]'
            entity_id: '[[entity_id]]'
        predefined_selections: []
        variables: {}
      - name: Pin & Go
        icon: mdi:map-marker-plus
        run_immediately: false
        coordinates_rounding: true
        selection_type: MANUAL_POINT
        max_selections: 999
        repeats_type: NONE
        max_repeats: 1
        service_call_schema:
          service: vacuum.send_command
          service_data:
            command: app_goto_target
            params: '[[selection]]'
            entity_id: '[[entity_id]]'
        predefined_selections: []
        variables: {}
      - template: vacuum_clean_segment
        predefined_selections:
          - id: 16
            icon:
              name: mdi:microsoft-xbox
              x: 20125
              'y': 24100
            label:
              text: Speelkamer
              x: 20125
              'y': 24100
              offset_y: 35
            outline:
              - - 18250
                - 22100
              - - 22000
                - 22100
              - - 22000
                - 26100
              - - 18250
                - 26100
          - id: 17
            icon:
              name: mdi:bed
              x: 24400
              'y': 23550
            label:
              text: Wout
              x: 24400
              'y': 23550
              offset_y: 35
            outline:
              - - 22450
                - 22150
              - - 26350
                - 22150
              - - 26350
                - 24950
              - - 22450
                - 24950
          - id: 18
            icon:
              name: mdi:broom
              x: 23675
              'y': 26100
            label:
              text: Gang
              x: 23675
              'y': 26100
              offset_y: 35
            outline:
              - - 21100
                - 24950
              - - 26250
                - 24950
              - - 26250
                - 27250
              - - 21100
                - 27250
          - id: 19
            icon:
              name: mdi:bed
              x: 20275
              'y': 27950
            label:
              text: Jana
              x: 20275
              'y': 27950
              offset_y: 35
            outline:
              - - 18200
                - 26000
              - - 22350
                - 26000
              - - 22350
                - 29900
              - - 18200
                - 29900
          - id: 20
            icon:
              name: mdi:bathtub
              x: 24275
              'y': 28600
            label:
              text: Badkamer
              x: 24275
              'y': 28600
              offset_y: 35
            outline:
              - - 22350
                - 27200
              - - 26200
                - 27200
              - - 26200
                - 30000
              - - 22350
                - 30000
        variables: {}
    tiles:
      - tile_id: status
        entity: vacuum.roborock_s7_maxv
        label: Status
        icon: mdi:robot-vacuum
      - tile_id: battery_level
        entity: vacuum.roborock_s7_maxv
        label: Battery
        attribute: battery_level
        icon: mdi:battery-90
        unit: '%'
      - tile_id: cleaning_time
        entity: sensor.roborock_s7_maxv_current_clean_duration
        label: Cleaning
        multiplier: 0.016667
        precision: 0
        icon: mdi:clock
        unit: ' min'
    icons:
      - icon: mdi:play
        conditions:
          - entity: vacuum.roborock_s7_maxv
            value_not: cleaning
          - entity: vacuum.roborock_s7_maxv
            value_not: error
          - entity: vacuum.roborock_s7_maxv
            value_not: returning
        tooltip: Start
        tap_action:
          action: call-service
          service: vacuum.start
          service_data:
            entity_id: vacuum.roborock_s7_maxv
      - icon: mdi:pause
        conditions:
          - entity: vacuum.roborock_s7_maxv
            value_not: docked
          - entity: vacuum.roborock_s7_maxv
            value_not: idle
          - entity: vacuum.roborock_s7_maxv
            value_not: error
          - entity: vacuum.roborock_s7_maxv
            value_not: paused
        tooltip: Pause
        tap_action:
          action: call-service
          service: vacuum.pause
          service_data:
            entity_id: vacuum.roborock_s7_maxv
      - icon: mdi:stop
        conditions:
          - entity: vacuum.roborock_s7_maxv
            value_not: docked
          - entity: vacuum.roborock_s7_maxv
            value_not: idle
          - entity: vacuum.roborock_s7_maxv
            value_not: error
          - entity: vacuum.roborock_s7_maxv
            value_not: paused
        tooltip: Stop
        tap_action:
          action: call-service
          service: vacuum.stop
          service_data:
            entity_id: vacuum.roborock_s7_maxv
      - icon: mdi:home-map-marker
        conditions:
          - entity: vacuum.roborock_s7_maxv
            value_not: docked
          - entity: vacuum.roborock_s7_maxv
            value_not: returning
        tooltip: Return to base
        tap_action:
          action: call-service
          service: vacuum.return_to_base
          service_data:
            entity_id: vacuum.roborock_s7_maxv
      - icon: mdi:target-variant
        conditions:
          - entity: vacuum.roborock_s7_maxv
            value_not: docked
          - entity: vacuum.roborock_s7_maxv
            value_not: error
          - entity: vacuum.roborock_s7_maxv
            value_not: cleaning
          - entity: vacuum.roborock_s7_maxv
            value_not: returning
        tooltip: Clean spot
        tap_action:
          action: call-service
          service: vacuum.clean_spot
          service_data:
            entity_id: vacuum.roborock_s7_maxv
      - icon: mdi:home-floor-0
        tooltip: Beneden
        tap_action:
          action: call-service
          service: vacuum.send_command
          service_data:
            entity_id: vacuum.roborock_s7_maxv
            command: load_multi_map
            params: 0
      - icon: mdi:home-floor-1
        tooltip: Gelijkvloers
        tap_action:
          action: call-service
          service: vacuum.send_command
          service_data:
            entity_id: vacuum.roborock_s7_maxv
            command: load_multi_map
            params: 1

1 Like

I am using the Roborock integration, and it is working great. I can display all the data I need. I have used zones and rooms with no issues. Have had no issues so far with map and entities updating since last HACS update.

3 Likes

Can you share your card yaml? I havent been able to get the sensors to display the data like yours does. Thanks!

1 Like

How do you get it to select zones and rooms?

If you have generated a room configuration as explained in my post, you can click on the “Zone cleanup” button to change it to a rooms button as you can see in the screenshot in my post. If you do not see that, you have not setup the room configuration properly.

Then you simply select the rooms to clean on the map and press the yellow play button. That is a bit tricky. The regular gray play button will always start a general clean. If you want to start a room or zone clean, you need to use the yellow play button :slight_smile:

Thanks! I have gone through the xiaomi route before. I was hoping to avoid that!

Hello,

is there any way to simply run the vacuum cleaner without the mop?

Yes. You can run the service call provided by the integration to set the mop intensity to off.

service: roborock.vacuum_set_mop_intensity
data:
  mop_intensity: "off"
target:
  entity_id: vacuum.roborock_s7_maxv

I created a bunch of buttons that call these service calls on a tap action. I use a custom_button card to change the color based on the corresponding attribute. I have the following buttons to change the mopping/vacuum settings (the bottom three are the mopping route options (standard, deep and deep+).

image

Example for the button to turn off the mopping function.

show_name: false
show_icon: true
type: custom:button-card
tap_action:
  action: call-service
  service: roborock.vacuum_set_mop_intensity
  service_data:
    mop_intensity: 'off'
    entity_id: vacuum.roborock_s7_maxv
entity: vacuum.roborock_s7_maxv
name: 'Off'
icon: mdi:water-off
hold_action:
  action: more-info
styles:
  card:
    - height: 35px
    - font-size: 11px
  icon:
    - color: |
        [[[
          if (states["vacuum.roborock_s7_maxv"].attributes.water_box_mode == '200') return 'rgb(60,90,195)';
          else return 'white';
        ]]]

There are examples of others that use a drop-down list and an automation to achieve the same.

I own the roborock s7 pro ultra and I don’t have the roborock service. Also, I don’t have the water_box_mode attribute. Is there any special configuration to do?