Vacuum Interactive Map Card

All restrictions will be applied :slight_smile:

Hey @3_14

noted
i am a new HA user and all this yaml stuff is a first for me.
See if my 2 suggestions make sense

  1. add explanation to the card (github) that states that the no-go zones and invisible walls are ā€œtakenā€ from the app and are implemented. ( will make it easier , i had to read tons of posts to understand that and double check with you as well)
  2. add more explanation in github to the room identifiers. i followed the hints and set the room outlines right but used idā€™s 1 to 6 and it didnā€™t work. only after a lot of trial/error and reading posts i understood that they need to be matched with whatā€™s comes up with the app or the vacuum will says room is clean and will do nothing.(and you can find the room numbers from map card if you enable the attribute)

this would save people like me 2-3 hours of looking around.
let me know if that makes sense for you or i missed this in the doc.

1 Like

ad. 1) Map restrictions are stored on the vacuum itself, so it doesnā€™t matter how it is started :wink:

ad. 2) I will try to improve readme :slight_smile: The problem is that this card has a lot of features so docs are quite long

Release v2.0.10 published, now card supports Neato vacuums!

Hey @3_14

wanted to ask if you can change the room highlight color
for example in ROOM.mp4 you clicking the bedroom room , and the highlight is somewhat white, can this be changed to other color or have higher opacity ?

Yes, you can add any of these CSS variables to your theme: lovelace-xiaomi-vacuum-map-card/css_variables.md at 1d15587535f5059a4f89ca4dc740404c90ded2f1 Ā· PiotrMachowski/lovelace-xiaomi-vacuum-map-card Ā· GitHub

Hi Piotr,

First a big thank you. I have been using this for a couple of months now, and it is perfect.
I have a situation though where I would like your advice about.

I have built a small cave for my robovac (aka BOB. Kids choose Bob, I wanted to call him Dustin) . It has a latch/door which opens and closes by actuator. It is controlled by mqtt (ESPHome) with a relay board.
I have now built in node red code that at a certain time, first the hatch needs to open, and 2 seconds later the robot can start vacuuming.
But this works only if I use node red as trigger to initiate the cleaning. (time trigger or using alexa voice command)
When I use the app of xiaomi directly, the trigger for the latch is missed ofcourse.

Video of the build (this is Bob going to its service location)

I wanted to get the status change from charging > cleaning as a trigger to open the hatch. But this is not working because there is a too big delay, even if I have the polling frequency set to 5 seconds. (which is too fast anyway.)

Behaviour I see is that in your card, when I press ā€˜playā€™ aka start cleaning, the robot INSTANTLY starts to clean. I also see that in the same card, the statuschange from charging > cleaning takes 5 to sometimes 30 seconds.

What I am thinking is that I want to use the ā€˜Start cleaning buttonā€™ in the card as a trigger directly as well.
Do you think this is possible? How do you think this can be achieved best?

fyi. I own a Roborock S5Max, which is not rootable without disassembly. I CAN in theory do it so I can flash it with valetudo, and have direct MQTT access without server delays. But I only want to do that if all other non disassembly routes are exhausted.

Kindly your advice :slight_smile:

Hey Piotr

thanks for pointer, but non of the css variables helped me.
what however did is this part of the documentation:

style: |
  .room-<room_id>-wrapper {
    --map-card-internal-room-outline-line-color: red;
    --map-card-internal-room-outline-fill-color: rgba(255, 0, 0, 0.5)
  }

after reviewing the css variables i decided to just edit the sample with ā€œ-selectedā€
here is how my config looks

    style: |
      .room-16-wrapper {
        --map-card-internal-room-outline-line-color-selected: red;
        --map-card-internal-room-outline-fill-color-selected: rgba(255, 140, 0, 0.5)
      }
      .room-17-wrapper {
        --map-card-internal-room-outline-line-color-selected: red;
        --map-card-internal-room-outline-fill-color-selected: rgba(255, 140, 0, 0.5)
      }

i could not find this variable ā€œā€“map-card-internal-room-outline-fill-colorā€ in the css list

is there another equalent style in the css list or am i missing something ?

You have 2 options:

  • create an automation that will be triggered by appropriate service calls
  • create a set of scripts that will proxy vacuum calls and change service calls in map card to use them instead

By the way, I also have a garage for my Alfred :wink:

7 Likes

Check out this discussion:

Could you point me in the right direction how to do the first option? I looked in automations, but I could not find this easilly. If you know of a link where it is described in a bit more words, thats good enough :slight_smile:

Thanks for your response and advice !

It should be an automation triggered by call_service event with appropriate data. You can check the data in dev tools

Thank you for the pointer. I have it working now. When using HA to initiate a cleaning cycle, the hatch now instantly opens. For reference for others, this is the code:

alias: Bob_open_Hatch
description: ''
trigger:
  - platform: event
    event_type: call_service
    id: start_cleaning
    event_data:
      domain: vacuum
      service: start
      service_data:
        entity_id: vacuum.bob
condition: []
action:
  - service: mqtt.publish
    data:
      topic: esp01relay/switch/relay_1/state
      payload: OPEN
      qos: '1'
mode: single

The actions I use are going through MQTT, but any action is possible of course.

Regards,

1 Like

Hi All,
Sorry it took me a while to see an upgrade to 2.X happened for the card.

Zones template to automatically receive zones from the App is still working - just some minor changes to the template are necessary.
Here my example again (just in case somebody is interested):

- type: custom:card-templater
  entities: 
    - vacuum.roborock_og
  card:
    type: custom:xiaomi-vacuum-map-card
    entity: vacuum.roborock_og
    language: de
    map_source:
      camera: camera.roborock_og_map
    calibration_source:
      camera: true
    map_modes:
      - template: vacuum_clean_zone_predefined
        predefined_selections_template: >-
          {%- set map = states.camera.roborock_og_map %}
          {%- if map is defined and not map is none %} 
            {%- set data = namespace(rooms=[]) %}
            {%- for roomid in state_attr(map.entity_id, "rooms") -%}
              {%- set room = map.attributes.rooms[roomid] %}
              {%- set roomlst = [] %}
              {%- set roomlst = roomlst + [room['x0'],room['y0'],room['x1'],room['y1']] %}
              {%- set data.rooms = data.rooms + [ { 'zones':[ roomlst ]} ] %}
            {%- endfor -%}
            {{ data.rooms }}
          {% endif %}
      - template: vacuum_clean_zone
      - template: vacuum_goto
      - template: vacuum_follow_path
1 Like

Version 2.X.X supports cleaning by room number, which is much better than zoned one :wink: You might want to change your config to use this feature instead of coordinates

1 Like

awesome - wasnā€™t aware about that

Hello,
first of all thanks for an amazing card!

I have two questions regarding visual configuration. Unfortunately I couldnā€™t find right examples at github.
1 - how to remove certain icon (ā€˜locate meā€™) and add another (go to predefined point)?
2 - how to disable tap action for certain fields (not all of them)?

obraz

Itā€™s not possible to edit auto-generated icons/tiles. You can provide your own list of icons/tiles, by default they replace auto-generated ones, but they can be appended to them as well.

First of all, you are a god.

i had this card up and running for the last 8m+
but fore some reson unknown for even myself i was like time to upgrade the card to the the fancy stuff.

and now its broken.

this is my cards setup

type: 'custom:xiaomi-vacuum-map-card'
entity: vacuum.xiaomi_vacuum_cleaner
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
vacuum_platform: Neato

and this is my yaml config

camera:
  - platform: xiaomi_cloud_map_extractor
    host: XXX
    token: XXX
    username: XXX
    password: XXX
    draw: ['all']
    attributes:
      - calibration_points

i still gets this problem (invalid calibraton if itĀ“s not clear)

i have tried to uninstall and install both the card and the extractor more times then i will admit.

tried to clear chase, going incognito and rebooting the vacuum.

Why do you have ā€œNeatoā€ platform selected? Can you show attributes of camera?