Vacuum Interactive Map Card

My /config/configuration.yaml look like this for the map extractor: (I am probably just missing some small part somewhere)

#RoboRock
camera:
  - platform: xiaomi_cloud_map_extractor
    host: !secret xiaomi_vacuum_host
    token: !secret xiaomi_vacuum_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
    draw: ['all']
    attributes:
      - calibration_points

Well, i would guess so, since the map extractor is working fine, and when i start my vacuum from the Mi Home app, i see movement in HA-screen also.

image

Map extractor just retrieves map data, to control the vacuum you have to add it to HA as well

2 Likes

That was it. I simply assumed that since you had made the map extractor, that this card was like a frontend for that utilizing the javascript for the extractor. I did not think that the card was a frontend for the Xiaomi integration. I sort of feel very silly now :slight_smile:

If i may, if you could update your readme/documentation with a “Requirement” section. Something like:

"In order to utilize this card you must first install the Xiaomi Integration.

  1. HA->Configuration->Devices&Services->Integration.
  2. Click on [+ Add Integration], blue button in bottom right corner
  3. Search for “Xiaomi Miio”
  4. Fill in “Cloud username”, “Cloud password” and select your country/region and how you would in the app.

After you have installed the integration, restart HA and install the Card".

(Its just a suggestion from my side as a new person to HA. And spending hours doing research and reading this thread and not fully understand what i needed as a baseline first. Im sure that could help other people in the future too :slight_smile:

Viomi S9 aka V18 ussing coordinates like:

-5.8191,0.0795,-5.8191,-4.3753,1.2464,-4.3753,1.2464,0.0795

It utilizes both extractor and vacuum entity :wink: and vacuum doesn’t have to be from built-in miio integration

1 Like

And this coordinates system is supported as well, just not in “default” vacuum platform :wink:

I checked 4 of build in vacuum platfroms, and none of them supporting “x1,y1; x1,y2; x2,y2; x2,y1” option…

Oh, ok. Can you show me the integration that you use?

I’m ussing this one:

With this Vacuum:
https://home.miot-spec.com/spec/viomi.vacuum.v18

And I’m ussing this config:

Actually, this config contains 2 service calls, which is not possible via UI. Buuuuut you can make a script that will handle it even with current version of map card.

I have used the map extractor with additional attributes (se below). How should i add all this to the card in order to be able to select a given room? Each room seems to have multiple x and y coordinates, so how do i apply that to the card?

From my current configuration.yaml:

#RoboRock
camera:
  - platform: xiaomi_cloud_map_extractor
    host: !secret xiaomi_vacuum_host
    token: !secret xiaomi_vacuum_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
    draw: ['all']
    attributes:
      - calibration_points
      - charger
      - cleaned_rooms
      - country
      - goto_path
      - goto_predicted_path
      - goto
      - ignored_obstacles_with_photo
      - ignored_obstacles
      - image
      - is_empty
      - map_name
      - no_go_areas
      - no_mopping_areas
      - obstacles_with_photo
      - obstacles
      - room_numbers
      - rooms
      - vacuum_position
      - vacuum_room_name
      - vacuum_room
      - walls
      - zones

And this is what i got in Developer section for the Map extractor. Now i would like to apply this to my card and probably give each room a proper name as well. But most important is to get this in place so wife and kids can use the new system.

[From map extrator]

calibration_points: 
- vacuum:
    x: 25500
    'y': 25500
  map:
    x: 405
    'y': 290
- vacuum:
    x: 26500
    'y': 25500
  map:
    x: 425
    'y': 290
- vacuum:
    x: 25500
    'y': 26500
  map:
    x: 405
    'y': 270

charger: 
x: 25530
'y': 29241

cleaned_rooms: null
country: de
goto: null
goto_path: null
goto_predicted_path: null
ignored_obstacles: null
ignored_obstacles_with_photo: null
image: 
size: 286752
offset_y: 337
offset_x: 105
height: 464
scale: 1
rotation: 0
width: 618

is_empty: false
map_name: roboroommap%2F471931069%2F17
no_go_areas: 
no_mopping_areas: 
obstacles: null
obstacles_with_photo: null
room_numbers: 
'16': null
'17': null
'18': null
'19': null
'20': null
'21': null
'22': null

rooms: 
'16':
  x0: 15100
  y0: 29700
  x1: 18050
  y1: 34000
'17':
  x0: 10850
  y0: 29850
  x1: 15050
  y1: 33300
'18':
  x0: 18000
  y0: 29500
  x1: 19100
  y1: 32650
'19':
  x0: 10850
  y0: 32500
  x1: 15050
  y1: 34350
'20':
  x0: 19350
  y0: 24650
  x1: 28400
  y1: 29400
'21':
  x0: 17000
  y0: 24650
  x1: 19300
  y1: 29450
'22':
  x0: 19150
  y0: 28450
  x1: 22400
  y1: 29500

vacuum_position: 
x: 25539
'y': 29062
a: 93

vacuum_room: 20
vacuum_room_name: null
walls: 
- x0: 15119
  y0: 32317
  x1: 15129
  y1: 32764
- x0: 15072
  y0: 33513
  x1: 15065
  y1: 33210
- x0: 15091
  y0: 31722
  x1: 15107
  y1: 31422

zones: 
- x0: 22800
  y0: 24700
  x1: 25950
  y1: 29500

Here you have config generator: Setting up room cleaning with Map Extractor
Paste it in dev tools > templates, create the card with output config and adjust values to your liking.

When finished change camera settings to following to reduce memory usage:

#RoboRock
camera:
  - platform: xiaomi_cloud_map_extractor
    host: !secret xiaomi_vacuum_host
    token: !secret xiaomi_vacuum_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
    draw: ['all']
    attributes:
      - calibration_points
3 Likes

Hey @3_14

i liked the custom:xiaomi-vacuum-card and custom:xiaomi-vacuum-map-card
i wanted a hold_action over the vacuum card to bring popup with vaccum map but it fails to do so, other buttons triggers this action fine.

SO i wanted to make sure that custom:xiaomi-vacuum-card does not support a fire-dom-event(browser mode)

@yaruslavm custom:xiaomi-vacuum-card is not my card, so I can’t really help :wink:

Xiaomi vacuum card repo

Actually even that was confusing right now. So i replace enter my details in the raw section or in the YAML section?

Isnt the yaml section supposed to fill in the information or generate for me, or where am I going wrong here? I took the data from Room 16" which i got from the map extractor. Or would you like to fill in one sample room for me based on Room 16 from my map extractor data, then i can see how it look like? A screenshot how it should be filled would be enough for me :slight_smile:

You have to paste this stuff (without modifying) in dev tools > templates
Open your Home Assistant instance and show your template developer tools.

If you want a more detailed example you can check it out here

Seems to be a mistake in the template code from pastebin:

Right, I have accidentally removed too much. It is fixed now

hey @3_14

thanks for answer earlier , i created a custom button to mimic the custom:xiaomi-vacuum-card.
now i am able to run a pop up.

i have a question about the functionality:
i redefined all the rooms with the hint options from the docs and i have mapped all my rooms, will the invisible walls and no-go zones that were defined in the app apply? or i need to somehow define them again.