Vacuum Interactive Map Card

yepp, there are rooms inside.

Do you have the latest version of the card? Is it inside some other card? Do you get any errors in the browser’s console?

Im using version 2.2.1
My original Vacuum card is inside some construct out of horizontal and vertical stacks.
But all Im trying here I do an extra dashboard page with just the vacuum card on it.
I dont get any errors. Just nothing happens.

Does copying selection work?

You mean copy from camera attributes to the card?
Ye this worked (even if I changed the rooms a bit)

No, no. I mean the “Copy selection” button in the card editor

Yes.
Everything else in the card works perfectly fine. (Including auto generate rooms for the first floor)

Edit: Another question popped up.
Is there any option to configure the size and the angle of the map?
I got 3 vacuums here, all with the same map and all maps are on different angles and sizes (partially huge different sizes).

I am a little dense and confused, so after days of looking I am going to ask for clarification. I have a Dreame Z10 Pro that I converted to using Valetudo and love it!

The reason I am here is the Valetudo Map Card leaves quite a bit to be desired compared to the Xiaomi Vacuum Card, but the Valetudo card pulled a map no problem and the Xiaomi card is throwing a calibration point error.

Xiaomi Config

type: custom:xiaomi-vacuum-map-card
entity: vacuum.valetudo_mixedaptkudu
vacuum_platform: Hypfer/Valetudo
preset_name: Live Map
map_source:
  camera: camera.valetudo_mixedaptkudu_map_data
calibration_source:
  camera: true
map_locked: true
two_finger_pan: false
title: Xiaomi Card

Valetudo Config

type: custom:valetudo-map-card
vacuum: valetudo_mixedaptkudu
title: Valetudo Card

My problem is that I cannot figure out how to get the calibration points for the Xiaomi card to use. All the guides I can find are for Xiaomi cloud and I cannot find anything for Valetudo. Maybe that’s because it isn’t possible, I don’t know.

Is there some guidance I am missing to be able to get a Valetudo Map into the Xiaomi Map card? That is the end goal.

Thanks!

Your problem is different. First you have to use I can’t believe it’s not Valetudo to retrieve map image from the Valetudo and only then worry about calibration :wink:

Well I have tried to use the Valetudo Mapper supervisor addon and cannot get it to work. I get this error SyntaxError: Unexpected token x in JSON at position 0.

And with my limited docker experience I cannot get the ICBINV compose file to work.

I will take another stab tonight and see what I can come up with.

Edit:

Well I got the compose file to work! Had to add services: above the first line in the supplied compose example.

I NOW HAVE A MAP!!!

Hi, I have Xiaomi Mi Robot Vacuum 1S with Xiaomi Miio and the lovelace-xiaomi-vacuum-map-card installed for some time and worked correctly, but with the latest updates I’m having problems cleaning with the “Rooms” button (vacuum_clean_segment). The Start buttons on the “Icon list entry options” and “Zone cleanup” work correctly, instead with the Rooms function it sends the command but nothing happens. With debug=true mode I noticed this:

{
  "domain": "vacuum",
  "service": "send_command",
  "serviceData": {
    "command": "app_segment_clean",
    "entity_id": "vacuum.mi_robot_vacuum_1s",
    "params": [
      {
        "segments": [
          16
        ],
        "repeat": 1
      }
    ]
  }
}

incorrect since I use Xiaomi Miio (vacuum_platform: default) and not send_command.
I think this problem comes from this commit:
https://github.com/PiotrMachowski/lovelace-xiaomi-vacuum-map-card/commit/a3e9f484f30bbef596e6829d80c5646f4f330a09

Was there some mistake or did I miss something?

Does your model support room cleaning?

The change you have linked was intentional - it is a workaround for this issue. Was previous version compatible with your vacuum?

Yes, it worked before but with the bug of repeating segments. I don’t know why but I can’t use it with vacuum.send_command (even via developer tools)

However I have investigated and it seems that the problem of segment repetitions has been solved upstream by python-miio Pull #1771 and as written in the pull they are waiting for the next release of python-miio to update Home Assistant, and then subsequently fix (I hope) lovelace-xiaomi-vacuum-map-card.

Thanks for the quick support.
We will wait patiently.

However I have investigated and it seems that the problem of segment repetitions has been solved upstream by python-miio

Finally! :wink:


We will wait patiently.

The beauty of this card is that you don’t have to wait, just use the following config to use xiaomi_miio.vacuum_clean_segment service again:

map_modes:
  - template: vacuum_clean_segment
    repeats_type: REPEAT
    service_call_schema:
      service: xiaomi_miio.vacuum_clean_segment
      service_data:
        segments: "[[selection]]"
        entity_id: "[[entity_id]]"

Oh wow, I’ve been missing out on this feature.
I just tried it and it works again! I love this card even more!
Thanks again for the support!

Does someone know if it is possible to have a nice generated floorplan can be used as background for the roborock floorplan. Or layered. So you have a nice floor with path of the cleaning?

Quick idea what I mean:

1 Like

From the Readme :

  • **How to create a map?**The easiest way is to use Xiaomi Cloud Map Extractor, but you can use any image (e.g., a screenshot from Mi Home/FloleVac).
  • **Can I use image that has a perspective distortion?**Yes, you just have to provide 4 calibration points.

It’s not possible “normally”, but probably you can hack it by yourself using card mod.

@NathanCu This is a bit different case. Usage of image makes paths disappear (they are on the image from the camera)

@3_14 Is there a possibility to stly the map at the top that is has only half of a page? I will make it suitable to a tablet with 100% width. But then the card shows only the map.

My current code to get it suited in the page:

                    - type: custom:xiaomi-vacuum-map-card
                      entity: camera.wall_e_map
                      style: |
                        ha-card {
                          width: 900px;
                          height: 650px;
                        }
                      map_source:
                        camera: camera.wall_e_map
                      calibration_source:
                        camera: true
                      map_modes:
                        - template: vacuum_clean_zone
                        - template: vacuum_goto
                        - template: vacuum_clean_zone_predefined

Thanks.

Minor stuff:

My zones shifted North a bit on their own. Do you know what could do that? Should I just tweak the calibration points manually?

How do I change the font-weight of the zone names?

Should the Status be Docked when the battery is 100%?

Having fun with your card and map.