Vacuum Interactive Map Card

Strange. Works well here since I changed that. No valetudo. Plain firmware.

Fuck that. Iā€™ve dropped the whole coordinates idea.
Iā€™ve found app_segment_clean command. It uses the rooms, I already have in the Mi Home app.
It works great. Will write the logic, when Iā€™ll have some time.

1 Like

So it turned out, you can use the rooms, Mi Home app already drew.
You only need to use app_segment_clean command.

The only thing I had to do is to find out, the ID of the rooms, I use in params: []
Since you can send the vacuum to multiple room, I suggest picking 1,2,3,4,5 in the first test.
If there are any match, youā€™ll see the room highlighted in the Mi Home app, like you were using room cleaning there.
If you see Spot cleanup in the top of the app, change the IDs.
If you see Room cleanup in the top of the app, and multiple rooms are colored then stop cleaning, start removing IDs in your list, and send the vacuum to clean again. This way you can find out which ID referred to which room.

In the end finding out the the coordinates werenā€™t that much useless, since I can send the vacuum next to the dumpster after 3 cleaning period. :slight_smile:

3 Likes

@szucs.krisz incredible find!

I was really struggling to set up proper coordinates, but with rooms it took me 5 minutes to figure out the whole home (and itā€™s really precise)

My last question is how do you set up using cards instead of launching with DEVTools - Service every time?
I followed this guide (LINK) and everything is working, but I have to clean 1 room at a time, there is no way to select multiple rooms at once

Iā€™m still new to HA

Thanks

Hi everyone,
I have finally created a more detailed guide for map calibration. It is still not finished, but it might be already useful. The final version (with screenshots) should be available soon

4 Likes

Right now all I have is automations set up to room cleaning. That was my main goal.
Setting up cards, is the next challenge for me.
Right now I have almost nothing implemented in Lovelace, so I canā€™t help you about this.

hello 3_14,
Congratulation for the great project!

I am a newbie who is having hard time with calibration as when I press start on card the command is sent but nothing happens. Here is the map (screenshot from Flolevac)

I have follow your instructions and I have the rectangle coordinates and the coordinates of three corners as per steps 5 and 7. Here are all the sets of coordinates:

[[21092,11009,34942,28709]]

[23700,28150]
[30000,14200]
[22350,12000]

Donā€™t understand step 8.

Am still facing problem with the card as non of the modes are working.
Any help would be much appreciated.

type: 'custom:xiaomi-vacuum-map-card'
entity: vacuum.xiaomi_vacuum
map_image: /local/custom-lovelace/xiaomi_vacuum_map_card/map2.png
calibration_points:
        - vacuum:
            x: 25500
            y: 25500
          map:
            x: 466
            y: 1889
        - vacuum:
            x: 26500
            y: 26500
          map:
            x: 730
            y: 1625
        - vacuum:
            x: 25500
            y: 26500
          map:
            x: 466
            y: 1625
zones:
        - [[31053, 24530, 34753, 27680]]
        - [[25736, 20330, 28236, 23930]]
        - [[21913, 17528, 24863, 19078]]

Hi @solomos,

The guide is not finished yet, it should be ready this weekend.
The goal of step 8 is to make yourself sure about coordinates of the zone created in step 3:
Corner near point [23700,28150] would be [21092,28709] and so on.
Example:

  1. You draw a zone and get black coordinates: [[x1,y1,x2,y2]]
  2. You mark points and get green coordinates: 3 times [x, y]
  3. You use black and green coordinates to get yellow ones
    • from x1 and x2 take one closer to x
    • from y1 and y2 take one closer to y

When you have these coordinates you have to find coordinates on the image (section ā€œGIMPā€ in help)

Whats your Card config to show the time when the room was clean last?

vacuum_last_clean:
friendly_name: Last clean (days)
value_template: ā€œ{{ (( as_timestamp(now()) - as_timestamp(states.vacuum.xiaomi_vacuum_cleaner.attributes.clean_stop) ) / 86400 ) | round(0) }}ā€

hello,
First of all, thank you very much for your time.
Unfortunately I canā€™t get it. Here are the steps I follow

  1. copy / paste the following code to UI:
type: 'custom:xiaomi-vacuum-map-card'
entity: vacuum.xiaomi_vacuum
map_image: /local/custom-lovelace/xiaomi_vacuum_map_card/map2.png
calibration_points:
        - vacuum:
            x: 25500
            y: 25500
          map:
            x: 25950
            y: 26500
        - vacuum:
            x: 26500
            y: 26500
          map:
            x: 29700
            y: 9976
        - vacuum:
            x: 25500
            y: 26500
          map:
            x: 24150
            y: 18850
zones:
        - [[21559, 9976, 35609, 27426]]
  1. As per your instructions we need 3 sets of zones and 3 set of points.
    There are not specific guidelines how to capture the zones. Any part? Something specific? Something which I must follow? Also, there are not specific guidelines how to capture the 3 set of points. E.g. The point can be anything on the map? Any logic behind it ? The 2nd must be close to the 1st point or far ? etc etc . Please accept my apologies if there are guidelines but I couldnā€™t find them.

  2. Using FloleVac and Zoned cleanup, without specific guidelines, I created three zones:

which gives me the following coordinates:
ZONE 1: 23911,26688,28111,28138
ZONE 2: 27097, 14175, 30647, 15825
ZONE 3: 21917, 20279, 25467, 21929

  1. Using FloleVac and Go, without specific guidelines, I created three points:

which gave me the following coordinates:

point 1: [27050,26550]
point 2: [29250, 14650]
point 3: [22550, 20650]

So, as far as I have understand, from the above values (zones & points) I must create new values which I will use to the bit of code which I will then insert to UI as card. (as per 1)

My questions are:

  1. How do I select the correct calibration points?
  2. How do I select the correct zones ?
  3. What to do if I select ā€œGo to targetā€ and ā€œStartā€ and nothing happens ?
  4. What to do if i select ā€œGo to Zoneā€ and nothing happens ?
  5. How to debug the above steps ?

Hi, you need 1 zone and 3 points. I have created a detailed guide for FloleVac calibration process, you can check it out here:

1 Like

hi @3_14 i want to test your live map beta but i use hassio. i have ssh access on my vacuum without password but how can i add my camera id on the lovelace card to check ?

hello 3_14,
Thank you very much for your reply and thank you very much for the detailed guide. However although I followed all the step as per your instructions I wasnā€™t able to start the vacuum. Neither the Go to target nor the Zoned Cleaned up worked for me.

When I use the following code:

entity_id: vacuum.xiaomi_vacuum_cleaner
command: app_goto_target
params:   
  [26050,20450]

under Developer Tools/service the vacuum works fine.

However am not able to start vacuum from map START.

Hi @cnopix, I am not sure what you mean. If you have installed and configured camera its id should be available in developers tools in states section

Hi @solomos,
Thatā€™s weird, do you have any errors in HA log or browsers console?

ok i see the camera entity now but not the map. i check my config again :slight_smile: thx

You have to start your vacuum in order for map to appear for the first time

iā€™m start two times, the vacuum clean the living room but i donā€™t see the map.

How is your HA installed? Do you have any errors in log?