Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Valetudo not working for rooms/zones? #778

Open
3 tasks done
borgqueenx opened this issue Nov 28, 2024 · 6 comments · May be fixed by #685
Open
3 tasks done

Valetudo not working for rooms/zones? #778

borgqueenx opened this issue Nov 28, 2024 · 6 comments · May be fixed by #685
Assignees
Labels
enhancement New feature or request

Comments

@borgqueenx
Copy link

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

I am using the map card, selected valetudo as platform and the device and camera (mqtt vacuum camera), then click on create room configuration and save.
However, i cant start cleaning a zone or room with the play/ button next to it. the robot wont do any work or confirm anything.
If i click the normal start button (that changes to pause when clicked) the robot starts working, but that command is for a full house cleaning, i think? The map also works fine, i see the robot moving.

The device i flashed valetudo on is a dreame x40 ultra and is added as a MQTT device in home assistant.

Perhaps and hopefully this is solvable by changing something, but maybe the auto-configuration maker needs some editting to solve this bug. (if it is a bug, i think so)

What version of a card has described problem?

v2.2.4

What was the last working version card?

No response

What vacuum model do you have problems with?

valetudo dreame x40

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

https://www.home-assistant.io/integrations/mqtt/

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

all

What version of Home Assistant do you use?

2024.11.3

What type of installation are you running?

Home Assistant OS

Card's configuration

type: custom:xiaomi-vacuum-map-card
map_source:
  camera: camera.valetudo_x40_ultra_occasionalmurkyguanaco_camera
calibration_source:
  camera: true
entity: vacuum.valetudo_occasionalmurkyguanaco
vacuum_platform: Hypfer/Valetudo
map_modes:
  - template: vacuum_clean_zone
  - template: vacuum_goto
  - template: vacuum_clean_segment
    predefined_selections:
      - id: "1"
        icon:
          name: mdi:broom
          x: 3200
          "y": 1952
        label:
          text: Naelis Room
          x: 3200
          "y": 1952
          offset_y: 35
        outline:
          - - 3035
            - 1755
          - - 3365
            - 1755
          - - 3365
            - 2150
          - - 3035
            - 2150
      - id: "2"
        icon:
          name: mdi:broom
          x: 3157
          "y": 2230
        label:
          text: Hallway Bathroom
          x: 3157
          "y": 2230
          offset_y: 35
        outline:
          - - 3050
            - 2160
          - - 3265
            - 2160
          - - 3265
            - 2300
          - - 3050
            - 2300
      - id: "3"
        icon:
          name: mdi:broom
          x: 3330
          "y": 2345
        label:
          text: Hallway
          x: 3330
          "y": 2345
          offset_y: 35
        outline:
          - - 3040
            - 2130
          - - 3620
            - 2130
          - - 3620
            - 2560
          - - 3040
            - 2560
      - id: "4"
        icon:
          name: mdi:broom
          x: 3737
          "y": 2340
        label:
          text: Entrance
          x: 3737
          "y": 2340
          offset_y: 35
        outline:
          - - 3620
            - 2135
          - - 3855
            - 2135
          - - 3855
            - 2545
          - - 3620
            - 2545
      - id: "6"
        icon:
          name: mdi:broom
          x: 3662
          "y": 2715
        label:
          text: Billiard Room
          x: 3662
          "y": 2715
          offset_y: 35
        outline:
          - - 3455
            - 2540
          - - 3870
            - 2540
          - - 3870
            - 2890
          - - 3455
            - 2890
      - id: "7"
        icon:
          name: mdi:broom
          x: 2662
          "y": 3060
        label:
          text: Master Bathroom
          x: 2662
          "y": 3060
          offset_y: 35
        outline:
          - - 2595
            - 2930
          - - 2730
            - 2930
          - - 2730
            - 3190
          - - 2595
            - 3190
      - id: "8"
        icon:
          name: mdi:broom
          x: 3677
          "y": 3042
        label:
          text: Kitchen
          x: 3677
          "y": 3042
          offset_y: 35
        outline:
          - - 3490
            - 2870
          - - 3865
            - 2870
          - - 3865
            - 3215
          - - 3490
            - 3215
      - id: "9"
        icon:
          name: mdi:broom
          x: 2417
          "y": 3147
        label:
          text: Bedroom
          x: 2417
          "y": 3147
          offset_y: 35
        outline:
          - - 2085
            - 2930
          - - 2750
            - 2930
          - - 2750
            - 3365
          - - 2085
            - 3365
      - id: "10"
        icon:
          name: mdi:broom
          x: 2892
          "y": 3140
        label:
          text: PC Corner
          x: 2892
          "y": 3140
          offset_y: 35
        outline:
          - - 2745
            - 2915
          - - 3040
            - 2915
          - - 3040
            - 3365
          - - 2745
            - 3365
      - id: "12"
        icon:
          name: mdi:broom
          x: 3240
          "y": 2955
        label:
          text: Living Room
          x: 3240
          "y": 2955
          offset_y: 35
        outline:
          - - 3030
            - 2535
          - - 3450
            - 2535
          - - 3450
            - 3375
          - - 3030
            - 3375
      - id: "13"
        icon:
          name: mdi:broom
          x: 3690
          "y": 3292
        label:
          text: Kitchen Side
          x: 3690
          "y": 3292
          offset_y: 35
        outline:
          - - 3515
            - 3195
          - - 3865
            - 3195
          - - 3865
            - 3390
          - - 3515
            - 3390

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

No response

Additional information

No response

@borgqueenx borgqueenx added the bug Something isn't working label Nov 28, 2024
@borgqueenx
Copy link
Author

borgqueenx commented Nov 28, 2024

Here is the configuration when making it static:

type: custom:xiaomi-vacuum-map-card
language: en
map_source:
  camera: camera.valetudo_x40_ultra_occasionalmurkyguanaco_camera
calibration_source:
  camera: true
entity: vacuum.valetudo_occasionalmurkyguanaco
vacuum_platform: Hypfer/Valetudo
map_modes:
  - 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: {}
  - name: Rooms
    icon: mdi:floor-plan
    run_immediately: false
    coordinates_rounding: true
    coordinates_to_meters_divider: 1000
    selection_type: ROOM
    max_selections: 999
    repeats_type: EXTERNAL
    max_repeats: 3
    service_call_schema:
      service: mqtt.publish
      service_data:
        topic: "[[topic]]/MapSegmentationCapability/clean/set"
        payload: >-
          {"segment_ids": [[selection]], "iterations": [[repeats]],
          "customOrder": true}
    predefined_selections:
      - id: "1"
        icon:
          name: mdi:broom
          x: 3200
          "y": 1952
        label:
          text: Naelis Room
          x: 3200
          "y": 1952
          offset_y: 35
        outline:
          - - 3035
            - 1755
          - - 3365
            - 1755
          - - 3365
            - 2150
          - - 3035
            - 2150
      - id: "2"
        icon:
          name: mdi:broom
          x: 3157
          "y": 2230
        label:
          text: Hallway Bathroom
          x: 3157
          "y": 2230
          offset_y: 35
        outline:
          - - 3050
            - 2160
          - - 3265
            - 2160
          - - 3265
            - 2300
          - - 3050
            - 2300
      - id: "3"
        icon:
          name: mdi:broom
          x: 3330
          "y": 2345
        label:
          text: Hallway
          x: 3330
          "y": 2345
          offset_y: 35
        outline:
          - - 3040
            - 2130
          - - 3620
            - 2130
          - - 3620
            - 2560
          - - 3040
            - 2560
      - id: "4"
        icon:
          name: mdi:broom
          x: 3737
          "y": 2340
        label:
          text: Entrance
          x: 3737
          "y": 2340
          offset_y: 35
        outline:
          - - 3620
            - 2135
          - - 3855
            - 2135
          - - 3855
            - 2545
          - - 3620
            - 2545
      - id: "6"
        icon:
          name: mdi:broom
          x: 3660
          "y": 2715
        label:
          text: Billiard Room
          x: 3660
          "y": 2715
          offset_y: 35
        outline:
          - - 3450
            - 2540
          - - 3870
            - 2540
          - - 3870
            - 2890
          - - 3450
            - 2890
      - id: "7"
        icon:
          name: mdi:broom
          x: 2662
          "y": 3060
        label:
          text: Master Bathroom
          x: 2662
          "y": 3060
          offset_y: 35
        outline:
          - - 2595
            - 2930
          - - 2730
            - 2930
          - - 2730
            - 3190
          - - 2595
            - 3190
      - id: "8"
        icon:
          name: mdi:broom
          x: 3677
          "y": 3042
        label:
          text: Kitchen
          x: 3677
          "y": 3042
          offset_y: 35
        outline:
          - - 3490
            - 2870
          - - 3865
            - 2870
          - - 3865
            - 3215
          - - 3490
            - 3215
      - id: "9"
        icon:
          name: mdi:broom
          x: 2417
          "y": 3147
        label:
          text: Bedroom
          x: 2417
          "y": 3147
          offset_y: 35
        outline:
          - - 2085
            - 2930
          - - 2750
            - 2930
          - - 2750
            - 3365
          - - 2085
            - 3365
      - id: "10"
        icon:
          name: mdi:broom
          x: 2892
          "y": 3140
        label:
          text: PC Corner
          x: 2892
          "y": 3140
          offset_y: 35
        outline:
          - - 2745
            - 2915
          - - 3040
            - 2915
          - - 3040
            - 3365
          - - 2745
            - 3365
      - id: "12"
        icon:
          name: mdi:broom
          x: 3240
          "y": 2955
        label:
          text: Living Room
          x: 3240
          "y": 2955
          offset_y: 35
        outline:
          - - 3030
            - 2535
          - - 3450
            - 2535
          - - 3450
            - 3375
          - - 3030
            - 3375
      - id: "13"
        icon:
          name: mdi:broom
          x: 3690
          "y": 3292
        label:
          text: Kitchen Side
          x: 3690
          "y": 3292
          offset_y: 35
        outline:
          - - 3515
            - 3195
          - - 3865
            - 3195
          - - 3865
            - 3390
          - - 3515
            - 3390
    variables: {}
append_icons: false
icons:
  - icon: mdi:play
    conditions:
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        value_not: cleaning
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        value_not: error
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        value_not: returning
    tooltip: Start
    tap_action:
      action: call-service
      service: vacuum.start
      service_data:
        entity_id: vacuum.valetudo_occasionalmurkyguanaco
  - icon: mdi:pause
    conditions:
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        value_not: docked
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        value_not: idle
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        value_not: error
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        value_not: paused
    tooltip: Pause
    tap_action:
      action: call-service
      service: vacuum.pause
      service_data:
        entity_id: vacuum.valetudo_occasionalmurkyguanaco
  - icon: mdi:stop
    conditions:
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        value_not: docked
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        value_not: idle
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        value_not: error
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        value_not: paused
    tooltip: Stop
    tap_action:
      action: call-service
      service: vacuum.stop
      service_data:
        entity_id: vacuum.valetudo_occasionalmurkyguanaco
  - icon: mdi:home-map-marker
    conditions:
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        value_not: docked
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        value_not: returning
    tooltip: Return to base
    tap_action:
      action: call-service
      service: vacuum.return_to_base
      service_data:
        entity_id: vacuum.valetudo_occasionalmurkyguanaco
  - icon: mdi:map-marker
    tooltip: Locate
    tap_action:
      action: call-service
      service: vacuum.locate
      service_data:
        entity_id: vacuum.valetudo_occasionalmurkyguanaco
  - menu_id: fan_speed
    icon: valetudo:fan-medium
    label: low
    conditions:
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        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_occasionalmurkyguanaco
        fan_speed: low
  - menu_id: fan_speed
    icon: valetudo:fan-medium
    label: Medium
    conditions:
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        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_occasionalmurkyguanaco
        fan_speed: medium
  - menu_id: fan_speed
    icon: valetudo:fan-high
    label: high
    conditions:
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        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_occasionalmurkyguanaco
        fan_speed: high
  - menu_id: fan_speed
    icon: valetudo:fan-turbo
    label: max
    conditions:
      - entity: vacuum.valetudo_occasionalmurkyguanaco
        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_occasionalmurkyguanaco
        fan_speed: max
  - type: menu
    menu_id: mopping_mode
    icon_id: moe
    entity: select.valetudo_occasionalmurkyguanaco_water
    available_values_attribute: options
    icon: mdi:water
    icon_mapping:
      min: valetudo:water-min
      low: valetudo:water-low
      medium: valetudo:water-medium
      high: valetudo:water-high
      max: valetudo:water-max
    tap_action:
      action: call-service
      service: select.select_option
      service_data:
        option: "[[value]]"
        entity_id: "[[entity_id]]"
  - type: menu
    menu_id: water_box_mode
    icon_id: water_box_mode
    entity: select.valetudo_occasionalmurkyguanaco_mode
    available_values_attribute: options
    icon: mdi:water
    icon_mapping:
      vacuum_and_mop: valetudo:mode-vacuum-and-mop
      vacuum_then_mop: valetudo:mode-vacuum-then-mop
      mop: mdi:waves
      vacuum: mdi:car-turbocharger
    tap_action:
      action: call-service
      service: select.select_option
      service_data:
        option: "[[value]]"
        entity_id: "[[entity_id]]"
append_tiles: true
tiles:
  - tile_id: battery_level
    entity: vacuum.valetudo_occasionalmurkyguanaco
    label: Battery
    attribute: battery_level
    icon_source: vacuum.valetudo_occasionalmurkyguanaco.attributes.battery_icon
    unit: "%"
  - tile_id: fan_speed
    entity: sensor.valetudo_occasionalmurkyguanaco_sensor_cleaning
    label: Sensor Cleaning Left
    icon: mdi:lotion-outline
    multiplier: 0.0166667
    precision: 0
    unit: h
  - tile_id: filter_left
    label: Filter left
    icon: mdi:air-filter
    unit: h
    multiplier: 0.016666666666666666
    entity: sensor.valetudo_occasionalmurkyguanaco_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_occasionalmurkyguanaco_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_occasionalmurkyguanaco_right_brush
    precision: 0
    translations: {}
  - tile_id: cleaned_area
    label: Cleaned area
    icon: mdi:texture-box
    unit: 
    multiplier: 0.0001
    entity: sensor.valetudo_occasionalmurkyguanaco_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_occasionalmurkyguanaco_current_statistics_time
    precision: 0
    translations: {}
  - tile_id: error_me
    entity: sensor.valetudo_occasionalmurkyguanaco_error
    label: Error Messages
    icon: mdi:alert-circle-outline
additional_presets: []

@sca075
Copy link

sca075 commented Nov 28, 2024

@borgqueenx,

you need to add to your config the topic of the vacuum.

internal_variables:
  topic: valetudo/YOUR_VACUUM_IDENTIFIER.

This should be also available on the camera attributes.

@borgqueenx
Copy link
Author

Thanks, now it is working! However shouldn't that be automatic when selecting the valetudo integration for this card?
Because the config automatically already shows the identifier as you see above: occasionalmurkyguanaco.
but in any case im happy things are working now :)

@sca075
Copy link

sca075 commented Nov 28, 2024

@borgqueenx there was a pull request, but is a little obsolete, probably @PiotrMachowski as soon has have time can have a look at it and then this will go automatically in the card. For now anyhow it is good that is working 👍

P.s. this isn't really a bug but a future request..

@borgqueenx
Copy link
Author

@borgqueenx there was a pull request, but is a little obsolete, probably @PiotrMachowski as soon has have time can have a look at it and then this will go automatically in the card. For now anyhow it is good that is working 👍

P.s. this isn't really a bug but a future request..

Oh i apologise. I thought it would classify as a bug because the valetudo auto generation config for this card isnt working 100% due to this, and didnt see anywhere we have to add this line. Maybe it could alternatively be added to documentation or maybe i simply missed reading it😅 then it would also work for others. I mean, valetudo also has its own map for home assistant, but i think everyone knows how much better this one is😁
So next time il remember that a bug is only code thats not working well.

Feel free to change the tags of this topic to a feature request then and sorry again.

@sca075
Copy link

sca075 commented Nov 28, 2024

w

Maybe it could alternatively be added to documentation

it is already documented in card for Valetudo docs, and also in the Camera install guide ;) Read the manual first save a lot time 😄

@PiotrMachowski PiotrMachowski added enhancement New feature or request and removed bug Something isn't working labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants