Vacuum Interactive Map Card

I know its your fault I need one​:joy::laughing:

I ide is to the the statue from it, so open when going out, close the the door. Then open when done, and need charging. And close when is in the dock.

Which model do you have?

S7

I have more stuff I need to change, on tha map, but that’s a other days project🥰

Ok, so you have to adjust some things in card’s config to make it work with your garage:

  1. Create a card with default config
  2. Click “Generate static config” button in editor
  3. Remove map_modes and tiles sections of generated config
  4. Adjust appropriate icons with new service calls, for example:
    • vacuum.startscript.vacuum_start
    • vacuum.returnscript.vacuum_return_to_base
  5. Adjust service call schemas in map_modes sections:
    map_modes:
      - template: vacuum_clean_segment
        service_call_schema:
          service: script.vacuum_send_command
          service_data:
            command: app_segment_clean
            params: "[[selection]]"
            entity_id: "[[entity_id]]"
      - template: vacuum_clean_zone
        service_call_schema:
          service: script.vacuum_send_command
          service_data:
            command: app_zoned_clean
            params: "[[selection]]"
            entity_id: "[[entity_id]]"
      - template: vacuum_clean_zone_predefined
        service_call_schema:
          service: script.vacuum_send_command
          service_data:
            command: app_zoned_clean
            params: "[[selection]]"
            entity_id: "[[entity_id]]"
      - template: vacuum_goto
        service_call_schema:
          service: script.vacuum_send_command
          service_data:
            command: app_goto_target
            params: "[[selection]]"
            entity_id: "[[entity_id]]"
      - template: vacuum_goto_predefined
        service_call_schema:
          service: script.vacuum_send_command
          service_data:
            command: app_goto_target
            params: "[[selection]]"
            entity_id: "[[entity_id]]"
    

Here you have some scripts that I used. You can find script.vacuum_send_command below:

vacuum_send_command:
  mode: parallel
  alias: vacuum_send_command
  fields:
    entity_id:
      description: entity_id
    command:
      description: command
    params:
      description: params
  sequence:
    - service: script.vacuum_leave_garage
    - service: vacuum.stop
      data:
        entity_id: "{{ entity_id }}"
    - service: vacuum.send_command
      data:
        entity_id: "{{ entity_id }}"
        command: "{{ command }}"
        params: "{{ params }}"

thanks, i am trying to solve this,

  1. Did a new config card,
    2.done
  2. Remove the map_modes and tiles.
    4 this one i dont understand, i have been looking over the code for “appropriate icons” but havent find it.

There’s no “appropriate icons” section in code, you just have to adjust service call for every icon that it makes sense to do it: for example you should replace service call for vacuum.start icon, because you want vacuum to exit the garage before starting go clean.

Please paste your code in a proper way

i think i have done it right now, but if i think right, when starting the vaccum, its send a script.vacuum_start.

I will need to add [25212, 22743] some wher, this is the place it sholde go out to after i have startred the vaccum.

Or maybe i dont need to, its just going out form the garage by it self?

You have to test it on your specific case. I use manual vacuum control to make it leave the garage

Is there a way to make the path_width thinner than 1?

Can you also make it look smoother? Like xiaomi’s own app?


You can add following lines to your config of map extractor:

map_transformation:
  scale: 2
1 Like

Fantastic!

One more question, can I hide the lock icon that shows I have locked the map?

Using card mod:

style: |
  #map-zoomer-overlay > div:nth-child(1) {
    display: none;
  }
1 Like

Is it possible to make the card less high and preferably wider? The card is too high to fit on my tablet.

Card dimensions depend on size of the image and column width in HA view. You can configure map_trimming in config of map extractor to change map size.

1 Like

Thank you. The trimming option did it. :+1:

Is it possible to get the map in higher resolution/quality?

You can also add scale: 2 to map transformations :slight_smile:

1 Like

Thank you. Is 2 max or could/should it be increased even more?

2 is acceptable :wink: increasing scale highly increases resources usage, limits depends on your hardware

1 Like

I’ll stick with 2. :blush: I think it looks pretty good now.

I have the Roborock S6 MaxV. I have names for the rooms in the app but they don’t show up on the map, even though I use draw: [‘all’]. Is there a limitation with my model? If so, is there any other way to show room names on the map?

Different vacuums store different things in the map file. Map names are stored only by a few of them. You can add room names in the config of a card (in room cleaning or predefined zones modes)

1 Like