Vacuum Interactive Map Card

i use hassio on a raspberry 3B+.

i just see this in log :

You are using a custom integration for xiaomi_vacuum_map which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.

Hi 3_14. thanks for all your work.
With this explaination, i understand how to use the calibration.
It’s a very good job.
It’s working very well with my vaccum.

PS: In a discovery / system improvement / personal development. :grinning: How could I use scripts that I have already made in a new option for launching / associating zones that i have created on the map.

Probably there is an issue with downloading map files from a vacuum, it was only tested on HA Core in python venv. I think I can make it compatible with hassio, but it will require some changes

You can add debug: true to cards configuration to discover parameters sent to a service

vacuum_territory:
  sequence:
    - service: vacuum.send_command
      data:
        entity_id: vacuum.roborock
        command: app_zoned_clean
        params: [[25500,25500,26500,26500,1]]

Ok. My scripts are like this.
What I would like to do was to call a script that I had already done in your customise card

I am not sure what you mean… Do you want to call your script instead of a vacuum service? Or do you want to add an additional mode to a card and use it to call your script?

No errors on HA log. How do I check browsers console? Curently I am using mozila

Yes. that’s the idea. Select a zone on the map and call a script.

It is already possible :wink:

Can you write me an example?
I don’t understand how to applique that in my configuration.
My actual configuration

calibration_points:
  - map:
      x: 155
      'y': 165
    vacuum:
      x: 16000
      'y': 30500
  - map:
      x: 139
      'y': 611
    vacuum:
      x: 15550
      'y': 23300
  - map:
      x: 967
      'y': 596
    vacuum:
      x: 29300
      'y': 23650
debug: false
entity: vacuum.xiaomi_vacuum_cleaner
language: pt
map_image: /local/custom_lovelace/xiaomi_vacuum_map_card/map.png
entity_id: vacuum.xiaomi_vacuum_cleaner
type: 'custom:xiaomi-vacuum-map-card'
zones:
  - - - 15088
      - 28388
      - 21011
      - 30879
  - - - 15452
      - 25835
      - 21068
      - 28483
  - - - 15380
      - 22754
      - 21098
      - 25649
  - - - 21239
      - 26921
      - 24119
      - 29697
  - - - 20619
      - 24655
      - 24134
      - 26823
  - - - 24010
      - 26112
      - 29235
      - 29790
  - - - 25990
      - 29797
      - 29475
      - 31718
  - - - 23848
      - 22856
      - 29661
      - 26282
  - - - 20465
      - 22658
      - 22443
      - 25051
  - - - 23339
      - 22892
      - 25182
      - 24896

You just have to add service: script.do_stuff to your config. Bear in mind that card will only call this script, so your script have to handle passing data to a vacuum. The simplest one is available here. Additionally you have to use this python script to call vacuum using data_template, as params property doesn’t support templates.

Example:

calibration_points:
  - ...
debug: false
entity: vacuum.xiaomi_vacuum_cleaner
language: pt
map_image: /local/custom_lovelace/xiaomi_vacuum_map_card/map.png
entity_id: vacuum.xiaomi_vacuum_cleaner
type: 'custom:xiaomi-vacuum-map-card'
service: script.vacuum_send_command
zones:
  - ...
1 Like

Anyone test on hassio ? how can i debug the connection between HA and vacuum ?

You don’t have to, I already know where is the issue. I hope to fix it soon

thanks :slight_smile: great job :wink:

It would be nice if the GitHub page had a gif showing how it looks when you have enabled the live camera part.

There will be :wink: I have to finish it first

1 Like

How will it look? Will it look like the image the app creates, with different colors for different rooms?

It will probably look like a previous version of an app, I don’t know if it is possible to have different colors for different rooms, but I will check it.
Here you have a sneak peek:

2 Likes

@3_14 is there any way to stop the map from reset in the Mi ==home app> I just was about to put in my zones then the map moved