Xiaomi Cloud Vacuum Map Extractor

map-card-room-outline-line-color: transparent

Well, now you know how to change colours, so you can adjust your config to your liking :wink:

Thanks again, time to learn some CSS then :smiley:
I wonder why i cant change that blue rooms color, just wont change. Room number is correct.

BTW, sometimes when rebooting hass, i get this error and need to reboot again to get robots working again :

Logger: homeassistant.setup
Source: setup.py:192
First occurred: 18:25:04 (1 occurrences)
Last logged: 18:25:04

Setup failed for xiaomi_miio: Unable to import component: cannot import name 'ROCKROBO_S7_MAXV' from 'miio.vacuum' (/usr/local/lib/python3.10/site-packages/miio/vacuum.py)

hi
i am trying to get room names from mi app to the cars, cant find a way to do that, any one can help? thank you

Hello
I have one minor issue with this otherwise flawless addon. Sometimes I get this error message. A reload under Development tools fixes it and I guess I could schedule it, but would be interesting to understand the cause of this.

Not all vacuum models have this functionality, if it is possible for your model you can enable it by adding rooms to attributes section of map extractor config.

It usually is caused by a problem with vacuum communication :confused:

1 Like

How did you set up this notification? :slight_smile:

and does someone know, where the room names are noted? i clicked on create croom config in the UI which worked well, but the rooms are named such “room 16, room 21” etc. and i cant find any info about rooms in the configuration.yaml - besides the “rooms” in the attributes.

Here is my code, might be difficult to just copy/paste it but use it for inspiration and a push in the right direction :slight_smile:

alias: ROBOROCK - Färdig
description: ""
trigger:
  - platform: state
    entity_id:
      - vacuum.roborock_s6_maxv
    from: returning
    to: docked
condition: []
action:
  - variables:
      time_stamp: ROBOROCK-{{ now().strftime('%Y-%m-%d-%H%M') }}
  - service: camera.snapshot
    data:
      entity_id: camera.xiaomi_cloud_map_extractor
      filename: /media/cameras/Roborock/{{ time_stamp }}.png
    entity_id: camera.xiaomi_cloud_map_extractor
  - service: notify.j_mobil
    data:
      title: Roborock färdig
      message: >-
        Dammsugit i {{
        (states('sensor.roborock_s6_maxv_last_clean_duration')|float/
        60)|round(0) }} min, totalt {{
        states('sensor.roborock_s6_maxv_last_clean_area')|round(1) }} m².
      data:
        image: /media/local/cameras/Roborock/{{ time_stamp }}.png
        notification_icon: mdi:robot-vacuum
        ttl: 0
        priority: high
        group: roborock
mode: single
2 Likes

I’ve finally gotten around to upload it and merge in the latest changes:

Basic functions should work, but it’s probably still in a pretty rough state (I barely tested any of the advanced parameters like scaling)

Also, I’m pretty much a novice in python, so I’d greatly apreciate any tips and improvements regarding both the rendering of the map and the code in general.

Hi everyone! Looking for some advice!

I have a Roborock S7 and everything is integrated and working properly. My only issue is really with the map. I have 2 separate maps with one vacuum. One map for my upstairs and one for my lower level. I have transformed the map in my config file so the map looks great for the upstairs, but when I switch to the map for the lower level, it applies the same transformations and that map doesn’t appear the way I want it to appear in the card.

Does anyone know of a way to set different transformations for each map so that I can customize the appearance of each map separately within one card?

Unfortunately it’s not possible at this moment. I need to add this feature

Thanks for the quick response!

Love this project and look forward to the updates!

(off topic) hello all Vacuum expert,
Dose any service call can move the vacuum manually?
I would like to maka UI on the card to manual move the vaccum.

the Mi home app has this built in feature locally, any chance to extract the api call ?
thanks

@jasonhk xiaomi_miio.vacuum_remote_control_move_step

thanks but it seems the addon only support the old devices.

I am using ijai.vacuum.v18 with miot auto addon,
it is work for most feature, but it doesn’t have manual move. :face_with_thermometer:

It supports new Roborock devices. In your case you have to search for info specific to your integration (miot auto)

1 Like

Thanks for your components, amazing work!

I am using it with Roborock S7, and one thing I can’t manage to get to work: to have the target room highlighted, when I send the robo to clean a room in roome mode with xiaomi_miio.vacuum_clean_segment.

When using zones, the zone is shown of course, but with a room, you cant see which room/area the robo is cleaning currently. Is there a way to change a room’s color when it’s “active”?

Thanks!

I don’t think it’s possible… Does it work this way in Xiaomi Home app?

The Android App automatically highlights the Room, yes:

hi guys

im having a bit of trougle, i can get the output to be left aligned no matter what i try (maybe im not trying hard enough)

edit: im using custom:layout-card and cards

type: custom:layout-card
layout:
  grid-template-columns: repeat(15, 80px)
  grid-template-rows: auto
layout_type: grid-layout
cards:
  - type: vertical-stack
    view_layout:
      grid-column-start: 1
      grid-column-end: 15
      grid-row-start: 1
      grid-row-end: end
    cards:
      - type: custom:xiaomi-vacuum-map-card
        title: ''
        preset_name: Live map
        entity: vacuum.wall_e
        vacuum_platform: default
        map_locked: true
        map_source:
          camera: camera.xiaomi_cloud_map_extractor
        calibration_source:
          camera: true
        map_modes:
          - template: vacuum_goto
          - template: vacuum_clean_zone
          - template: vacuum_clean_segment
            predefined_selections:
              - id: 20
                outline:
                  - - 25250
                    - 16200
                  - - 25250
                    - 20300
                  - - 28500
                    - 20300
                  - - 28500
                    - 16200
                label:
                  text: Dormitor Robert
                  x: 26875
                  'y': 18250
                  offset_y: 35
                icon:
                  name: mdi:broom
                  x: 26875
                  'y': 18250
              - id: 16
                outline:
                  - - 28800
                    - 16250
                  - - 28800
                    - 20300
                  - - 33100
                    - 20300
                  - - 33100
                    - 16250
                label:
                  text: Dormitor
                  x: 30950
                  'y': 18275
                  offset_y: 35
                icon:
                  name: mdi:broom
                  x: 30950
                  'y': 18275
              - id: 18
                outline:
                  - - 25250
                    - 19800
                  - - 25250
                    - 27200
                  - - 29600
                    - 27200
                  - - 29600
                    - 19800
                label:
                  text: Hol
                  x: 27425
                  'y': 23500
                  offset_y: 35
                icon:
                  name: mdi:broom
                  x: 27425
                  'y': 23500
              - id: 22
                outline:
                  - - 25150
                    - 20600
                  - - 25150
                    - 22150
                  - - 27650
                    - 22150
                  - - 27650
                    - 20600
                label:
                  text: Baie
                  x: 26400
                  'y': 21375
                  offset_y: 35
                icon:
                  name: mdi:broom
                  x: 26400
                  'y': 21375
              - id: 23
                outline:
                  - - 29600
                    - 20600
                  - - 29600
                    - 23300
                  - - 32900
                    - 23300
                  - - 32900
                    - 20600
                label:
                  text: Debara
                  x: 31250
                  'y': 21950
                  offset_y: 35
                icon:
                  name: mdi:broom
                  x: 31250
                  'y': 21950
              - id: 17
                outline:
                  - - 25300
                    - 22600
                  - - 25300
                    - 24900
                  - - 27650
                    - 24900
                  - - 27650
                    - 22600
                label:
                  text: Bucatarie
                  x: 26475
                  'y': 23750
                  offset_y: 35
                icon:
                  name: mdi:broom
                  x: 26475
                  'y': 23750
              - id: 21
                outline:
                  - - 29350
                    - 23600
                  - - 29350
                    - 27300
                  - - 32900
                    - 27300
                  - - 32900
                    - 23600
                label:
                  text: Living
                  x: 31125
                  'y': 25450
                  offset_y: 35
                icon:
                  name: mdi:broom
                  x: 31125
                  'y': 25450
        card_mod:
          style: |
            ha-card {
              text-align: left;
              display: flex !important;
              align-items: stretch;
              flex-wrap: wrap;
              justify-content: space-evenly;
              --map-card-zoomer-background: rgba(0, 0, 0, 0);
              --ha-card-background: none   

            }
            .map-wrapper {
              flex-grow: 3;
              width: 200px;
            }
            .controls-wrapper {
              flex-grow: 1;
              width: 200px;
            }
            .room-wrapper {
            --map-card-internal-room-label-color: red;
            --map-card-internal-room-label-font-size: 20px;

            }

Hi @3_14
I’ve had a bit of a web browse, but not found much. Then thought I might ask the most robo-vacuum-knowledgeable person I know - you!

Are you aware of any efforts or feasibility to edit room divisions other than via the split/divide functions of the mi home or roborock apps?

I’m sure you’ve experienced how finicky it can be. Ideally I’d be able to just paint pixels and have the tool do the rest, but I wonder if it’s even possible to even just issue a room split command from outside the app.