Vacuum Interactive Map Card

Ugh, node-red…

You have to remove last “1” from “zone”:

    "repeats": "1",
    "zone": [
        [
            18585,
            25299,
            22789,
            28062
        ]
    ]
}

OMG! So lovely, it works!!! Thanks…

1 letter difference between networking and notworking :slight_smile:

Hi!
I Have 2 vacuums, how can i make this work with the two different entities? When i tried it myself, the map was the same (two identical map cards), even though the entities were different.
Perhaps this only works with one vacuum?

Can you share your config?

1 Like

Sure!

I have experimented a bit, by duplicating the folders in custom components and adding a “_2” at the end, but this did not work.

vacuum:
  - platform: xiaomi_miio
    host: 192.168.x.30
    token: 49
  - platform: xiaomi_miio
    host: 192.168.x.31
    token: 54

camera:
  - platform: xiaomi_cloud_map_extractor
    host: 192.168.x.30
    token: 49
    username: x
    password: x
    draw: ['all']
    attributes:
      - calibration_points  
  - platform: xiaomi_cloud_map_extractor
    host: 192.168.x.31
    token: 54
    username: x
    password: x
    draw: ['all']
    attributes:
      - calibration_points  
  - platform: xiaomi_cloud_map_extractor_2
    host: 192.168.x.31
    token: 54
    username: x
    password: x
    draw: ['all']
    attributes:
      - calibration_points  

Changing the entity in the card configurator still only shows the same map. So im out of ideas =)
Tried the following for the new card of the second vacuum:

type: 'custom:xiaomi-vacuum-map-card'
entity: vacuum.xiaomi_vacuum_cleaner_2
calibration_points: null
camera_calibration: true
map_camera: camera.xiaomi_cloud_map_extractor_2

and

type: 'custom:xiaomi-vacuum-map-card'
entity: vacuum.xiaomi_vacuum_cleaner_2
calibration_points: null
camera_calibration: true
map_camera: camera.xiaomi_cloud_map_extractor

Thankful for any input!

You have to add name in config. It will create 2 entities with different ids

cameras:
  - platform: xiaomi_cloud_map_extractor
    name: vacuum camera 1
    host: 192.168.x.30
    token: 49
    username: x
    password: x
    draw: ['all']
    attributes:
      - calibration_points  
  - platform: xiaomi_cloud_map_extractor
    name: vacuum camera 2
    host: 192.168.x.31
    token: 54
    username: x
    password: x
    draw: ['all']
    attributes:
      - calibration_points  
1 Like

Thanks!
I tried it, but it made the vacuum map card disappear.
However, i can now see the 2 maps in glance card and “custom-vacuum-card”:

Current config:

camera:
  - platform: xiaomi_cloud_map_extractor
    name: vacuum camera 1
    host: 192.168.x.30
    token: 49
    username: x
    password: x
    draw: ['all']
    attributes:
      - calibration_points  
  - platform: xiaomi_cloud_map_extractor
    name: vacuum camera 2
    host: 192.168.x.31
    token: 54
    username: x
    password: x
    draw: ['all']
    attributes:
      - calibration_points  

And map card:

type: 'custom:xiaomi-vacuum-map-card'
entity: vacuum.xiaomi_vacuum_cleaner
calibration_points: null
camera_calibration: true
map_camera: camera.xiaomi_cloud_map_extractor

The custom vacuum card:

type: 'custom:vacuum-card'
entity: vacuum.xiaomi_vacuum_cleaner
image: default
compact_view: false
show_name: true
map: camera.vacuum_camera_1

Entity ids has changed, you have to provide valid ones in cards’ configs

1 Like

Aha! I changed the “map_camera”, i thought it was the entity that needed changing:

type: 'custom:xiaomi-vacuum-map-card'
entity: vacuum.xiaomi_vacuum_cleaner
calibration_points: null
camera_calibration: true
map_camera: camera.vacuum_camera_1

Works now, thanks alot =D

One final little thing:
Is it possible to add a name on the cards to distinguish between them? I have tried name: X and title: X. But nothing is shown.

I have installed the resource and have the map downloaded fine. The card is loaded up in the GUI fine.
The only problem is that when I send a command (go to target or zoned cleanup), and click start, I get the “command sent” pop-up but nothing happens with the hoover.
How can I troubleshoot?
Thanks!

@alexus no, it’s not possible at this moment :frowning:

@Michaelrch can you share your config?

Thanks very much for getting back to me.
I realised my mistake when I reviewed my config carefully :slight_smile:
In my lovelace card, I was referring to the vacuum entity by the wrong ID. Oops. To much copy/paste without thinking.
After matching the entityID properly, the control does indeed get the vacuum to work.
I have to check my calibration etc but I think I know how to do that.
Many thanks and nice work on this!

Now create a tutorial on how you achieved that pls :smiley:

Can anyone create a tutorial on creating the map and the zones?

2 Likes

It seems I also can’t seem to get the scaling/trim right… For the life of me I can’t seem to enlarge my map to fill out the card :frowning: even with my overzealous numbers!

#Xiaomi Cloud Map Extractor code in configuration.yaml
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
    map_transformation:
      scale: 2
      rotate: 90
      trim:
        top: 90
        bottom: 80
        left: 70
        right: 40
    scan_interval:
      seconds: 10
    auto_update: true
    store_map: false

Your “overzelaus numbers” are exactly what keeps your map from trimming :smiley:

These values are in percents, so each pair (top + bottom, left + right) must sum up to a value below 100%

I’ve just adjusted them in pairs to equal 100, but no dice :frowning:

    map_transformation:
      scale: 2
      rotate: 90
      trim:
        top: 40
        bottom: 60
        left: 60
        right: 40
    scan_interval:
      seconds: 10
    auto_update: true
    store_map: false

I’ve also found that no matter what value I put in the rotation field (90, 180etc) the map doesnt want to turn. Does the vacuume need to run in order to refresh the map with trimming and rotation by any chance?

100% is still invalid: you remove all of the image.
Let’s say that the image has a width of 1000px. Your configuration removes 600px from the left and 400px from the right side.

Is it possible to have this card resize to bigger, double width and height?

1 Like

Yes, with layout card

1 Like