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).
MIT License
1.45k stars 249 forks source link

Unable to get zone data #415

Closed dogmatic69 closed 2 years ago

dogmatic69 commented 2 years ago

Checklist

The problem

Followed the docs to workout zone coordinates but seem to get bad data (number much lower than examples).

Additionally when using these numbers the zone does not show up in any way.

image

{
  "domain": "xiaomi_miio",
  "service": "vacuum_clean_zone",
  "serviceData": {
    "zone": [
      [
        2,
        -1,
        4,
        1
      ]
    ],
    "repeats": 1,
    "entity_id": "vacuum.waffle"
  }
}

I'm currently using this integration for the vacuum and your other one for the camera

I believe the vacuum is a STYJ02YM aka viomi.vacuum.v8.

What version of a card has described problem?

v2.0.11

What was the last working version card?

No response

What vacuum model do you have problems with?

viomi.vacuum.v8

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

https://github.com/nergal/homeassistant-vacuum-viomi

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

chrome on windows

What version of Home Assistant do you use?

2022.6.5

What type of installation are you running?

Home Assistant Supervised

Card's configuration

- type: custom:xiaomi-vacuum-map-card
        entity: vacuum.waffle
        map_source:
          camera: camera.waffle
          crop:
            top: 300
            bottom: 300
            left: 250
            right: 250
        calibration_source:
          camera: true
        map_modes:
          - template: vacuum_clean_zone
          - template: vacuum_goto
          - template: vacuum_clean_zone_predefined
            predefined_selections:
              - zones: [[2, -1, 4, 1]]
        tiles:
          - label: Status
            entity: vacuum.waffle
            icon: mdi:robot-vacuum
            attribute: status
          - label: Battery
            entity: vacuum.waffle
            icon: mdi:battery-charging-100
            attribute: battery_level
          - label: Fan Speed
            entity: vacuum.waffle
            icon: mdi:fan
            attribute: fan_speed
          - label: Sensors left
            entity: vacuum.waffle
            icon: mdi:eye
            attribute: sensors_left
            unit: h
            precision: 1
          - label: Filter left
            entity: vacuum.waffle
            icon: mdi:air-filter
            attribute: filter_left
            unit: h
            precision: 1
          - label: Main brush left
            entity: vacuum.waffle
            icon: mdi:broom
            attribute: main_brush_left
            unit: h
            precision: 1
          - label: Side brush left
            entity: vacuum.waffle
            icon: mdi:broom
            attribute: side_brush_left
            unit: h
            precision: 1

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

```shell
none

Additional information

No response

PiotrMachowski commented 2 years ago

Followed the docs to workout zone coordinates but seem to get bad data (number much lower than examples).

there are two coordinate systems: Xiaomi and Roborock vacuums use millimeter-based (~25500), Viomi use meter-based one. You have to change platform (e.g. to viomise) in card's config to change coordinate system

dogmatic69 commented 2 years ago

Ok I'm struggling to follow what you saying. I've tried changing platform on the card but viomise was not valid. I tried some others listed in the read me and then the data changed to x.xxxxxxxxx, I guess meters but with decimals.

I got it showing the defined zones now but seems it's not possible to select individual zones. will have to keep digging.

Anyway if you look at the screen shot out the box with no platform set even if it was meters the measurement always shows as 0.0m x 0.0m

PiotrMachowski commented 2 years ago

Anyway if you look at the screen shot out the box with no platform set even if it was meters the measurement always shows as 0.0m x 0.0m

That's also because of platform and coordinate systems.

It seems that integration you use doesn't support zone or segment cleaning, is it true? https://github.com/nergal/homeassistant-vacuum-viomi/issues/30 https://github.com/nergal/homeassistant-vacuum-viomi/issues/34