PiotrMachowski/lovelace-xiaomi-vacuum-map-card

custom segments to clean not working

Xyz00777 opened this issue · 1 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

hoi, after setting it up and adding it to a dashboard, trying to get the controls on the right site and created a few custom rooms to clean i wasnt able to command it to clean specific predefined areas, also not custom one who are created on the fly. BUT i can let it clean everything, these is working. When i start a custom or predefined area im just getting an "SUCCESS" message and nothing else happens :(

What version of a card has described problem?

2.2.4

What was the last working version card?

No response

What vacuum model do you have problems with?

ViomiV6ValetudoRobot with valetudo

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

MQTT?

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

firefox-PC/tables/android

What version of Home Assistant do you use?

2024.10.4

What type of installation are you running?

Home Assistant OS

Card's configuration

type: custom:xiaomi-vacuum-map-card
map_source:
  camera: camera.valetudo_v6_bustlingflickeringgoose_camera
  crop:
    top: 230
    bottom: 100
    left: 100
    right: 90
vacuum_platform: Hypfer/Valetudo
calibration_source:
  camera: true
entity: vacuum.valetudo_bustlingflickeringgoose
title: ""
map_locked: true
two_finger_pan: false
icons:
  - icon: mdi:play
    conditions:
      - entity: vacuum.valetudo_bustlingflickeringgoose
        value_not: cleaning
      - entity: vacuum.valetudo_bustlingflickeringgoose
        value_not: error
      - entity: vacuum.valetudo_bustlingflickeringgoose
        value_not: returning
    tooltip: Start
    tap_action:
      action: call-service
      service: vacuum.start
      service_data:
        entity_id: vacuum.valetudo_bustlingflickeringgoose
  - icon: mdi:pause
    conditions:
      - entity: vacuum.valetudo_bustlingflickeringgoose
        value_not: docked
      - entity: vacuum.valetudo_bustlingflickeringgoose
        value_not: idle
      - entity: vacuum.valetudo_bustlingflickeringgoose
        value_not: error
      - entity: vacuum.valetudo_bustlingflickeringgoose
        value_not: paused
    tooltip: Pause
    tap_action:
      action: call-service
      service: vacuum.pause
      service_data:
        entity_id: vacuum.valetudo_bustlingflickeringgoose
  - icon: mdi:stop
    conditions:
      - entity: vacuum.valetudo_bustlingflickeringgoose
        value_not: docked
      - entity: vacuum.valetudo_bustlingflickeringgoose
        value_not: idle
      - entity: vacuum.valetudo_bustlingflickeringgoose
        value_not: error
      - entity: vacuum.valetudo_bustlingflickeringgoose
        value_not: paused
    tooltip: Stop
    tap_action:
      action: call-service
      service: vacuum.stop
      service_data:
        entity_id: vacuum.valetudo_bustlingflickeringgoose
  - icon: mdi:home-map-marker
    conditions:
      - entity: vacuum.valetudo_bustlingflickeringgoose
        value_not: docked
      - entity: vacuum.valetudo_bustlingflickeringgoose
        value_not: returning
    tooltip: Return to base
    tap_action:
      action: call-service
      service: vacuum.return_to_base
      service_data:
        entity_id: vacuum.valetudo_bustlingflickeringgoose
  - icon: mdi:map-marker
    tooltip: Locate
    tap_action:
      action: call-service
      service: vacuum.locate
      service_data:
        entity_id: vacuum.valetudo_bustlingflickeringgoose
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: low
    conditions:
      - entity: vacuum.valetudo_bustlingflickeringgoose
        attribute: fan_speed
        value: low
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.valetudo_bustlingflickeringgoose
        fan_speed: low
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: Medium
    conditions:
      - entity: vacuum.valetudo_bustlingflickeringgoose
        attribute: fan_speed
        value: medium
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.valetudo_bustlingflickeringgoose
        fan_speed: medium
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: high
    conditions:
      - entity: vacuum.valetudo_bustlingflickeringgoose
        attribute: fan_speed
        value: high
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.valetudo_bustlingflickeringgoose
        fan_speed: high
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: max
    conditions:
      - entity: vacuum.valetudo_bustlingflickeringgoose
        attribute: fan_speed
        value: max
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.valetudo_bustlingflickeringgoose
        fan_speed: max
  - icon: mdi:fan-alert
    conditions:
      - entity: vacuum.valetudo_bustlingflickeringgoose
        attribute: fan_speed
        value_not: low
      - entity: vacuum.valetudo_bustlingflickeringgoose
        attribute: fan_speed
        value_not: medium
      - entity: vacuum.valetudo_bustlingflickeringgoose
        attribute: fan_speed
        value_not: high
      - entity: vacuum.valetudo_bustlingflickeringgoose
        attribute: fan_speed
        value_not: max
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.valetudo_bustlingflickeringgoose
        fan_speed: low
tiles:
  - tile_id: battery_level
    entity: vacuum.valetudo_bustlingflickeringgoose
    label: Battery
    attribute: battery_level
    icon_source: vacuum.valetudo_bustlingflickeringgoose.attributes.battery_icon
    unit: "%"
  - tile_id: fan_speed
    entity: vacuum.valetudo_bustlingflickeringgoose
    label: Fan speed
    attribute: fan_speed
    icon: mdi:fan
    translations:
      silent: Silent
      standard: Standard
      medium: Medium
      turbo: Turbo
      auto: Auto
      gentle: Gentle
  - tile_id: filter_left
    label: Filter left
    icon: mdi:air-filter
    unit: h
    multiplier: 0.016666666666666666
    entity: sensor.valetudo_bustlingflickeringgoose_main_filter
    precision: 0
    translations: {}
  - tile_id: main_brush_left
    label: Main brush left
    icon: mdi:brush
    unit: h
    multiplier: 0.016666666666666666
    entity: sensor.valetudo_bustlingflickeringgoose_main_brush
    precision: 0
    translations: {}
  - tile_id: side_brush_left
    label: Side brush left
    icon: mdi:brush
    unit: h
    multiplier: 0.016666666666666666
    entity: sensor.valetudo_bustlingflickeringgoose_right_brush
    precision: 0
    translations: {}
  - tile_id: cleaned_area
    label: Cleaned area
    icon: mdi:texture-box
    unit: 
    multiplier: 0.0001
    entity: sensor.valetudo_bustlingflickeringgoose_current_statistics_area
    precision: 0
    translations: {}
  - tile_id: cleaning_time
    label: Cleaning time
    icon: mdi:timer-sand
    unit: min
    multiplier: 0.016666666666666666
    entity: sensor.valetudo_bustlingflickeringgoose_current_statistics_time
    precision: 0
    translations: {}
map_modes:
  - template: vacuum_clean_segment
    predefined_selections:
      - id: "10"
        icon:
          name: mdi:broom
          x: 1792
          "y": 2110
        label:
          text: Küche
          x: 1792
          "y": 2110
          offset_y: 35
        outline:
          - - 1540
            - 1960
          - - 2050
            - 1960
          - - 2050
            - 2245
          - - 1540
            - 2245
      - id: "11"
        icon:
          name: mdi:broom
          x: 1282
          "y": 2197
        label:
          text: Bad
          x: 1282
          "y": 2197
          offset_y: 35
        outline:
          - - 1145
            - 2120
          - - 1420
            - 2120
          - - 1420
            - 2260
          - - 1145
            - 2260
      - id: "12"
        icon:
          name: mdi:broom
          x: 1800
          "y": 2427
        label:
          text: Schlafzimmer
          x: 1800
          "y": 2427
          offset_y: 35
        outline:
          - - 1565
            - 2260
          - - 2035
            - 2260
          - - 2035
            - 2595
          - - 1565
            - 2595
      - id: "13"
        icon:
          name: mdi:broom
          x: 1357
          "y": 2435
        label:
          text: Wohnzimmer
          x: 1357
          "y": 2435
          offset_y: 35
        outline:
          - - 1145
            - 2260
          - - 1565
            - 2260
          - - 1565
            - 2590
          - - 1145
            - 2590
      - id: "16"
        icon:
          name: mdi:broom
          x: 1480
          "y": 2195
        label:
          text: Flur
          x: 1480
          "y": 2195
          offset_y: 35
        outline:
          - - 1420
            - 2100
          - - 1540
            - 2100
          - - 1540
            - 2260
          - - 1420
            - 2260
  - name: Zone cleanup
    icon: mdi:select-drag
    run_immediately: false
    coordinates_rounding: true
    coordinates_to_meters_divider: 100
    selection_type: MANUAL_RECTANGLE
    max_selections: 5
    repeats_type: EXTERNAL
    max_repeats: 3
    service_call_schema:
      service: mqtt.publish
      evaluate_data_as_template: true
      service_data:
        topic: "[[topic]]/ZoneCleaningCapability/start/set"
        payload: >-
          {"zones": [{%for s in ('[[selection]]')|from_json %}{ "points": {"pA":
          { "x": {{s[0]}}, "y": {{s[1]}} }, "pB": { "x": {{s[2]}}, "y": {{s[1]}}
          }, "pC": { "x": {{s[2]}}, "y": {{s[3]}} }, "pD": { "x": {{s[0]}}, "y":
          {{s[3]}} } }, "iterations": [[repeats]]}{%if not
          loop.last%},{%endif%}{%endfor%}]}
    predefined_selections: []
    variables: {}
  - name: Pin & Go
    icon: mdi:map-marker-plus
    run_immediately: false
    coordinates_rounding: true
    coordinates_to_meters_divider: 100
    selection_type: MANUAL_POINT
    max_selections: 999
    repeats_type: NONE
    max_repeats: 1
    service_call_schema:
      service: mqtt.publish
      service_data:
        topic: "[[topic]]/GoToLocationCapability/go/set"
        payload: "{ \"coordinates\": { \"x\": [[point_x]], \"y\": [[point_y]] } }"
    predefined_selections: []
    variables: {}
additional_presets: []
card_mod:
  style: |
    ha-card {
      display: flex !important;
      flex-direction: row;
      align-items: stretch;
    }
    #map-wrapper {
      flex: 1 1 auto;
      min-width: 0;
    }
    .controls-wrapper {
      flex: 0 0 250px; /* Breite der Bedienelemente angepasst */
      display: grid;
    }
    .room-wrapper {
      --map-card-internal-room-label-color: red;
      --map-card-internal-room-label-font-size: 120%;
    }
    .map-controls {
      width: 100% !important;
    }

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

No response

Additional information

No response

You have to provide topic in the config to make it work. Documentation