Vacuum Interactive Map Card

That was a super hint :slight_smile:
Now it works. But still does not look at nice as is does in the example:


Still more i need to configure?

Hi all,

I’m using the xiaomi map extractor, but does anyone succeed integrating the functionality of the Roborock S7Vmax Ultra including mopping ?

Thanks a lot !

Kr,

Bart

  • Missing icons on tile → this problem is caused by your theme, you can solve it by adding following code to it:
    map-card-primary-text-color: white
    
  • Missing tiles → this problem is caused by using an unsupported integration, you can:
    • Create tiles manually
    • Create a feature request in Map Card
    • Migrate to a supported integration (e.g. this one)

You are right, the icons are missing because of my theme.

map-card-primary-text-color: white

Does not solve it, but with another Theme it does work.

What do you mean with missing tiles?

I would need to check it.

You have less tiles compared to the demo config presented here https://youtu.be/H7FSk_92I7E

I am now using the following integration → https://github.com/nergal/homeassistant-vacuum-viomi and it looks lilke this:


Now i see the cleaning area for example. Are these the tiles you are talking about?

Yes. Buuuut with this integration you won’t be able to control your vacuum using the map (it doesn’t have required services). I recommend switching to this integration since (probably) there’s no better solution at this moment

Even when using the integration you provided only the “normal” start stop change fan speed button work. The zone clearning says its started but nothing happens. The message i got is:

{
  "domain": "vacuum",
  "service": "vacuum_clean_zone",
  "serviceData": {
    "zone": [
      [
        0.12767356406203234,
        1.3871171380984606,
        1.5579656447606176,
        2.0044010887157455
      ]
    ],
    "repeats": 1,
    "entity_id": "vacuum.vaccum"
  }
}```

Don’t you have debug: true in your config?

I tried it with

logger:
  default: info
  logs:
    custom_components.miio2: debug

but nothing appears in the log.

Show config of the card

It looks like this:

type: custom:xiaomi-vacuum-map-card
title: Xiaomi Vacuum Map Card
preset_name: Live map
entity: vacuum.vaccum
vacuum_platform: KrzysztofHajdamowicz/miio2
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
two_finger_pan: true
debug: true
map_locked: false
map-card-primary-text-color: white

You have to remove debug: true line from card’s config and everything will work

Thank you very much. That was the trick. I understood the debug line differently :wink:
Are you maybe able to explain me, how i zoom into the map automatically. It is far away on every start

The best way would be to adjust your map in Map Extractor using trim functionality.

1 Like

I went through a learning process to discover how to have HA switch maps from the UI:

  • Use additional_presets in the card to define additional maps/zones/etc.
  • Use activate_on_switch and activate in both the default config and each additional preset
  • Use vacuum.send_command and load_multi_map to activate a map

Example card config fragment:

additional_presets:
  - entity: vacuum.roborock_s5_max
    preset_name: Bath/Closet
    activate_on_switch: true
    activate:
      service: vacuum.send_command
      service_data:
        command: load_multi_map
        params: 1
      target:
        entity_id: '[[entity_id]]'

I did the same thing for the default config, using params: 0 for the load_multi_map command.

Now when I switch the preset in the UI, HA sends a load_multi_map command to the vacuum, which causes the UI to notice the new map and re-render the image. Perfect!

There may be better ways to achieve this, please let me know.

1 Like

v2.1.0 - Valetudo, Roomba, editor and more


New version of the card has been released! New platforms, improved editor, templating and other features/fixes.
1 Like

I’m wondering if there is a way to find out which map is the currently active one on the vacuum.

If I load/restore a map on the vacuum, it is correctly reflected on the card. I’d like to check that the correct map is loaded before sending some commands, but I can’t find a way to query whether it is loaded.

You can tell which map is loaded based on the calibration point attributes in camera.xiaomi_cloud_map_extractor

If you don’t have the autoupdate on you call it with

  - service: homeassistant.update_entity
    data: {}
    target:
      entity_id: camera.xiaomi_cloud_map_extractor

and then check the calibration points.

In my case I used a template sensor to always tell me what floor the vacuum is on. Even if the robot loads the map itself (rather than me doing it manually) the extractor is updating the calibration point attributes, and this can tell me the floor and rooms.

#robot vacuum floor
  - sensor:
      - name: "Robot Vacuum Floor"
        unique_id: 'B819ySBel09W1Sl40jJnuKdO0QLYeqb8'
        state: >
          {% set state=state_attr('camera.xiaomi_cloud_map_extractor','calibration_points')[0].map.x %}
          {% set state2=state_attr('camera.xiaomi_cloud_map_extractor','calibration_points')[1].map.x %}
          {% set state3=state_attr('camera.xiaomi_cloud_map_extractor','calibration_points')[2].map.x %}
          {% if is_number(state) and state | float == 150 and is_number(state2) and state2 | float == 170 and is_number(state3) and state3 | float == 150 %}
          Downstairs
          {% elif is_number(state) and state | float == 119 and is_number(state2) and state2 | float == 139 and is_number(state3) and state3 | float == 119 %}
          Upstairs
          {% elif is_number(state) and state | float == 120 and is_number(state2) and state2 | float == 140 and is_number(state3) and state3 | float == 120 %}
          Upstairs
          {% else %}
          unknown
          {% endif %}
1 Like

Hi, Is there any settings to control selected area transparency or color? I have a white map so when i select a area, i can see what is selected just because the black text change the color slightly.