PiotrMachowski / lovelace-xiaomi-vacuum-map-card

This card provides a user-friendly way to fully control map-based vacuums in Home Assistant. Supported brands include Xiaomi (Roborock/Viomi/Dreame/Roidmi/Valetudo/Valetudo RE), Neato, Wyze, Roomba, Ecovacs (and probably more).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ecovacs Deebot issues

Anashost opened this issue Β· comments

Checklist

  • I have updated the card to the latest version available
  • I have cleared the cache of my browser
  • I have checked if the problem is already reported

The problem

Hey @PiotrMachowski
I've an ecovacs deebot N8 pro, which i integrated using Deebot 4 Home assistant, and working fine. I found about your really good looking UI integration but sadly some of the features doesn't work:

  • number of cleans cycles in Room cleaning (x1 - x2) does nothing.

  • zone cleaning doesn't work, so drawning a rectangle on the map, creates an (outside the map) rectangle in the deebot official app, and deebot returns to base.

  • Predefined zone cleaning also doesn't work, whether i get the coordinates using your integration or according to Deebot 4 home assistant docs @edenhaus , i get this error:

Failed to call service xiaomi_miio/vacuum_clean_zone. Service not
found.

What version of a card has described problem?

v2.2.0

What was the last working version card?

None

What vacuum model do you have problems with?

Ecovacs Deebot N8 Pro

Which integration do you use to control your vacuum (link)?

https://github.com/DeebotUniverse/Deebot-4-Home-Assistant

What browser (browsers/apps) does have this problem?

All

What version of Home Assistant do you use?

2023.5.4

What type of installation are you running?

Home Assistant OS

Card's configuration

type: custom:xiaomi-vacuum-map-card
entity: vacuum.windy
vacuum_platform: DeebotUniverse/Deebot-4-Home-Assistant
map_source:
  camera: camera.windy_live_map
map_locked: true
two_finger_pan: true
map_modes:
  - template: vacuum_clean_zone
  - template: vacuum_clean_segment
    predefined_selections:
      - id: 5
        icon:
          name: mdi:sofa
          x: -5900
          'y': -8000
      - id: 0
        icon:
          name: mdi:sofa
          x: -5800
          'y': 2500
      - id: 1
        icon:
          name: mdi:bed
          x: -15200
          'y': 2000
      - id: 4
        icon:
          name: mdi:toilet
          x: -12500
          'y': -7500
      - id: 2
        icon:
          name: mdi:knife
          x: -12000
          'y': -17500
      - id: 3
        icon:
          name: mdi:door
          x: -3900
          'y': -15500
  - template: vacuum_clean_zone_predefined
    predefined_selections:
      - zones:
          - - 239
            - 184
            - 1336
            - 665
        icon:
          name: mdi:rectangle
          x: -5800
          'y': 2500

Javascript errors shown in the browser's console (if applicable)

No response

Additional information

No response

Can you also add a snapshot (created using camera.snapshot service - to keep the same resolution as original map image) of camera and a screenshot from the app with an invalid zone and its coordinates?

Never done something like that πŸ˜… i will try once I'm on my PC.

  • Here's the snapshot from camera.snapshot:

snapshot


  • screenshot from the official app (when zone created in the official app).
    Coordinates:
    [[198, 1911, 1332, 781]]

Screenshot_20230603_173035_ECOVACS HOME


  • screenshot from the official app (when zone created in HA vacuum card).
    Coordinates:
    [[-8212, 439, -4929, 3517]]
    (The coordinates are so different as you can see)

Screenshot_20230603_181402_ECOVACS HOME

This is how it looks in the vacuum card:
Screenshot_20230603_182621_Home Assistant

I hope that can help debugging the issues.

Great, thank you!

I have investigated your problems and:

  • repeats: the card works correctly, so the problem must be in the integration
  • zone cleaning: it looks like the calibration is incorrect (@edenhaus are you sure about static calibration you have sent?)
  • predefined zone cleaning: fixed on dev branch

Thanks, i will wait for the next release/beta to test predefined zone cleaning. But zone cleaning is what i really care about, as i use it a lot, so it would be nice if it works.

  • This is the entity_id for repeats:
    number.VACUUM-NAME_clean_count
    Which works in @edenhaus integration.

  • When i use the coordinates that i generate using @edenhaus docs in automations like this:

service: vacuum.send_command
target:
  entity_id: vacuum.windy
data:
  command: custom_area
  params:
    coordinates: 198, 1911, 1332, 781

the robot gose the the right place on the map.

  • This is the entity_id for repeats:
    number.VACUUM-NAME_clean_count
    Which works in @edenhaus integration.

According to the documentation cleanings parameter should work as well

  • When i use the coordinates that i generate...

Does this version work as well?

service: vacuum.send_command
target:
  entity_id: vacuum.windy
data:
  command: custom_area
  params:
    coordinates: 198, 781, 1332, 1911

You can try to use following cofig (you have to adjust coordinates of icons/zones):

type: custom:xiaomi-vacuum-map-card
entity: vacuum.windy
vacuum_platform: DeebotUniverse/Deebot-4-Home-Assistant
map_source:
  camera: camera.windy_live_map
map_locked: true
two_finger_pan: true
calibration_source:
  calibration_points:
    - vacuum:
        x: 198
        y: 781
      map:
        x: 240
        y: 401
    - vacuum:
        x: 198
        y: 1991
      map:
        x: 240
        y: 469
    - vacuum:
        x: 1332
        y: 1991
      map:
        x: 310
        y: 469
map_modes:
  - template: vacuum_clean_zone
  - template: vacuum_clean_segment
    ...

Predefined zone cleaning fixed in v2.2.1

Thanks boss, will try in the morning, otherwise the neighbors will call the police.

Sorry @PiotrMachowski if I'm becoming a little bit of a headache πŸ˜…, so here we go.

Does this version work as well?

service: vacuum.send_command
target:
  entity_id: vacuum.windy
data:
  command: custom_area
  params:
    coordinates: 198, 781, 1332, 1911

Yes it worked like this too.

Predefined Zone cleaning now works πŸ‘ŒπŸ» but as Zone cleaning still doesn't create zones correctly, still can't use it.

Current issues:

  • So, Zone cleaning still creates off location rectangles (im using the calibration points you provided).
    Examples:

    Coordinates: [[-375, -3164, 1486, -2014]]
    20230605_124614


    Coordinates: [[-2511, -6174, -920, -4845]]
    20230605_125127


    Coordinates: [[-3002, -468, -1453, 724]]
    20230605_125032


    Coordinates: [[-77, 179, 1557, 1670]]
    20230605_124524


  • Repeats (which still doesn't work) can be specified only in Room cleaning, as you can see:
    20230605_130507

Repeats (which still doesn't work) can be specified only in Room cleaning, as you can see:

Zone cleaning doesn't have a "cleanings" parameter in the service call, so it is not available to select here.

Ok, so what I need are 4 sets of coordinates made for the same zone (marked on the map):

  • one retrieved from the vacuum - the "correct" ones
  • one retrieved from the card with calibration points I have sent above
  • one retrieved from the card with no calibration_source config
  • one retrieved from the card with following calibration_source config:
    calibration_source:
      identity: true

Such data should make it possible to create a calibration for you (and possibly all other Ecovacs vacuums)

OK:

  • one retrieved from the vacuum - the "correct" ones

[[358, 3388, 1890, 2508]]

  • one retrieved from the card with calibration points I have sent above

[[361, -778, 1850, 145]]

  • one retrieved from the card with no calibration_source config

[[-7539, -4372, -2899, -1738]]

  • one retrieved from the card with following calibration_source config:
    calibration_source:
      identity: true

[[249, 312, 342, 365]]

Can you try these ones?

        - vacuum:
            x: 358
            y: 3388
          map:
            x: 249
            y: 312
        - vacuum:
            x: 358
            y: 2508
          map:
            x: 249
            y: 365
        - vacuum:
            x: 1890
            y: 2508
          map:
            x: 342
            y: 365

@PiotrMachowski
very very nice, it's creating Zones perfectly now, really big Thanks for your work.

Final question πŸ˜… is there an easy way to create outlines for the rooms, as getting the coordinates from the card gives me something like this:
[[-611, -307, 1873, 3376]]

While i need something like this for the outlines to work:
[[1900, -805],[-700, -805],[-700, 3550],[1900, 3550]]

and, what about if the room not a rectangle, but a more complex shape πŸ€”

To get outline you have to change vacuum platform to "Setup integer", choose "Path" mode, mark an outline of the room and click "Copy selection"

I've just tried it, works perfectly. Thanks a lot.

  • zone cleaning: it looks like the calibration is incorrect (@edenhaus are you sure about static calibration you have sent?)

Sorry for the late answer. But the calibration data was only meant for testing purposes by others as I currently don't have time to do it.

  • This is the entity_id for repeats:
    number.VACUUM-NAME_clean_count
    Which works in @edenhaus integration.

According to the documentation cleanings parameter should work as well

@PiotrMachowski please use as described in the docs the cleanings parameter as this parameter is supported by all models and the clean count sensor only for a few newer models. For example my model is also not supporting it

Sorry for the late answer.

@edenhaus No problem, I was aware that this might not be the final solution, but I have released it to be able to get more feedback about this functionality. Please don't treat this issue/discussion as pushing you to implement changes, I'm just trying to investigate the problem and maybe find the solution that will work for everyone.


But the calibration data was only meant for testing purposes by others as I currently don't have time to do it.

During calculation of calibration points I have found out following differences compared to your calibration:

  • The "resolution" (vacuum diff/map diff) turned out to be 0.06 (compared to 0.02)
  • The (0,0) point in vacuum coordinates maps to ~(230, 520) point in map coordinates (compared to 400, 400)
  • The y axis is inverted - in the card if you're getting closer to the bottom then the y value increases, it seems to be the other way in the case of calibration that seems to work for @Anashost

@PiotrMachowski please use as described in the docs the cleanings parameter as this parameter is supported by all models and the clean count sensor only for a few newer models. For example my model is also not supporting it

The card uses this approach and it seems that it doesn't work (you can check out the code here)

@Anashost could you provide the service call with repeats set to 2 (using card's "copy service call" functionality)?

In my case it looks the following way:

{
  "domain": "vacuum",
  "service": "send_command",
  "serviceData": {
    "entity_id": "vacuum.test",
    "command": "spot_area",
    "params": {
      "rooms": "0,1",
      "cleanings": 2
    }
  }
}

@Anashost could you provide the service call with repeats set to 2 (using card's "copy service call" functionality)?

In my case it looks the following way:

{
  "domain": "vacuum",
  "service": "send_command",
  "serviceData": {
    "entity_id": "vacuum.test",
    "command": "spot_area",
    "params": {
      "rooms": "0,1",
      "cleanings": 2
    }
  }
}

it looks the same as yours, but nothing happen as the entity id value stay 1
number.VACUUM-NAME_clean_count

{
  "domain": "vacuum",
  "service": "send_command",
  "serviceData": {
    "entity_id": "vacuum.windy",
    "command": "spot_area",
    "params": {
      "rooms": "5",
      "cleanings": 2
    }
  }
}

@Anashost how you get "one retrieved from the vacuum - the "correct" ones" without app ?

@PiotrMachowski i have calibration my map to work correctly, but after I open the door and recleaning, images of map to change and my calibration not work correctly ?? how do i calibrate correctly no matter the size of the image ??

The calibration data should be static. At least I use a static formula to generate the map.

During calculation of calibration points I have found out following differences compared to your calibration:

* The "resolution" (vacuum diff/map diff) turned out to be 0.06 (compared to 0.02)

* The (0,0) point in vacuum coordinates maps to ~(230, 520) point in map coordinates (compared to 400, 400)

* The y axis is inverted - in the card if you're getting closer to the bottom then the y value increases, it seems to be the other way in the case of calibration that seems to work for @Anashost

Hopefully I have time next week to give it a look.

@tantai251295 Can you please share me some screenshot with before/after