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

Please support a image besides camera view #754

Open
borgqueenx opened this issue Aug 22, 2024 · 19 comments
Open

Please support a image besides camera view #754

borgqueenx opened this issue Aug 22, 2024 · 19 comments
Assignees
Labels
enhancement New feature or request

Comments

@borgqueenx
Copy link

Description

The official roborock integration makes constant updating images, does not have a camera view anymore. It would be great if instead of a camera, a image can be used for this card.

Solution

Supporting image view for the map.

Alternatives

No response

Context

No response

@borgqueenx borgqueenx added the enhancement New feature or request label Aug 22, 2024
@PiotrMachowski
Copy link
Owner

You can use image entity instead of camera entity by editing yaml configuration

@borgqueenx
Copy link
Author

You can use image entity instead of camera entity by editing yaml configuration

Can you show us how?

@borgqueenx
Copy link
Author

i simply tried to change camera into image in the yaml of the lovelace card, but now it says its missing calibration source.

@PiotrMachowski
Copy link
Owner

Unfortunately at this moment official Roborock integration doesn't support calibration required for the map card

@Diaoul
Copy link

Diaoul commented Sep 6, 2024

Why so? If a still image works I would imagine that one generated automatically would as well 🤔

I would love to do something like that but it does not seem to work:

map_source:
  image: image.roborock_s8_pro_ultra_ground_floor

@PiotrMachowski
Copy link
Owner

PiotrMachowski commented Sep 6, 2024

Why so? If a still image works I would imagine that one generated automatically would as well 🤔

You can try to manually calibrate the map from Roborock integration the same way you can calibrate the static image. It is not trivial though, so I prefer to not include it in the documentation.

The config would be:

map_source:
  camera: image.roborock_s8_pro_ultra_ground_floor

@Diaoul
Copy link

Diaoul commented Sep 6, 2024

Maybe we can ask the Roborock integration guys to make an easily calibrated image. What would it take to make it easier?

@PiotrMachowski
Copy link
Owner

That's not so easy. Also he is aware of this problem and we have already discussed potential solutions:

#691

home-assistant/core#105424

@Legromorph
Copy link

Is there a way to get the coordinates via the roborock custom integration, then switch back to the core integration and put the coordinates back into the card?

@PiotrMachowski
Copy link
Owner

@Legromorph potentially you can install the custom integration, copy "calibration points" from the map entity and use them to calibrate the map. Buuuut I don't know if this will work correctly - these maps might be a little bit different

@Legromorph
Copy link

Surprisingly it worked. I just had to change them a bit but it was the same ratio for all points(both x and y coordinates were shifted with the same ratio). So this is a valid strategy. Now I can enjoy the best from both the integration and the fantastic card :D

@psimona
Copy link

psimona commented Oct 5, 2024

@Legromorph potentially you can install the custom integration, copy "calibration points" from the map entity and use them to calibrate the map. Buuuut I don't know if this will work correctly - these maps might be a little bit different

@Legromorph can you elaborate on how you achieved this? Some bullets and potentially a screenshot. I would be intersted in replicating the setup.

@Legromorph
Copy link

Legromorph commented Oct 5, 2024

I am afraid, that I cannot do it with screenshots for 2 weeks because I am on vacation.
But I can list what I did for now.

  1. I installed the custom integration.
  2. I used the card to create the room coordinates.
  3. I used roborock.get_map if the card does not want to give you the coordinates of the rooms.
  4. I changed to calibration in the card from camera: true to calibration_points:
  5. I changed that the first template is the rooms template. (So I can always see the icons on the map.)
  6. I pasted the calibration points from a different github thread.
    When you paste them, your room icons will change positions. Note that under vacuum, I changed nothing. You only have to change map coordinates. Either I was just lucky or it is normal that the ratio is on all maps the same. If you change the x coordinate by for example -30 then change every other map x coordinate by -30 too.
    On each change you can see your room icons move.
    I had to change every y coordinate by +20 and every x coordinate by -120. (so not much different then the example I copied and pasted from a different user).
    Just be sure to not change the vacuum coordinates.
    Here are my real points, use them for the start.
calibration_coordinates:
    - vacuum:
        x: 25500
        "y": 25500
      map:
        x: 180
        "y": 84
    - vacuum:
        x: 35500
        "y": 25500
      map:
        x: 380
        "y": 84
    - vacuum:
        x: 25500
        "y": 35500
      map:
        x: 180
        "y": -116
  1. As soon as the room icons were on the same position as they were before I changed the calibration method, I copied the whole yaml of the card.
  2. I deinstalled the custom integration.
  3. Restart HA (important).
  4. I installed the core integration.
  5. I pasted the code into the card. (Maybe it will remember everything after the vacuum entity is swapped. But I wanted to be sure, that I dont have to reinstall again.)
  6. I changed to the send_command instead of the homeassistant-roborock. (This I had to do manual because everytime I tried fhe dropdoenmenu of the card it swapped back to homeassistant-roborock). So change the templates to the one liner written in the documentation under templates/send_command.
  7. For me I had to change alot of entitie names. Just name them with the new name from the integration (or other way around).
    And you have to delete for the status the: attribute: status because the core integration is only using the state of the roborock as status and doesnt have any attribute named status. But the rest is the same.
  8. Everything should work fine!
  9. PROFIT!

Please tell me if something is not understandable. I am not that good in english, but I tried my best.

@Mikescotland
Copy link

@Legromorph waiting for some full yaml and maybe screenshot. Did it all, all contours and icons are in place, yet when I do specific room, Consuela starts to wander to another... 😂

@drupry
Copy link

drupry commented Oct 23, 2024

thank you @Legromorph for clear manual, I managed to get right room coordinators to image instead of camera entity. Worse part is that I cant use homeassistant-roborock custom integration platform for room and zone cleaning because it says "command not found", original Roborock integration uses slightly different command according this page . I have to use send command platform instead witch is not so good integrated. Or I am doing something wrong ?

@Legromorph
Copy link

Legromorph commented Nov 4, 2024

I am sorry to answer that late.
@Mikescotland I will not make Screenshots for now, because then I have to uninstall the core integration and reinstall the custom, only to reinstall the core again.

@drupry Yes, you have to change the vacuum_platform to "send_command"
for Zone Cleaning just add the - template: vacuum_clean_zone
for Goto Option just add the - template: vacuum_goto

I wrote this in point 12 maybe not as clear as I should have.

here my complete yaml:

type: custom:xiaomi-vacuum-map-card
entity: vacuum.roborock_qrevo_curv
vacuum_platform: send_command
title: ""
map_source:
  camera: image.roborock_qrevo_curv_map
calibration_source:
  calibration_points:
    - vacuum:
        x: 25500
        "y": 25500
      map:
        x: 180
        "y": 84
    - vacuum:
        x: 35500
        "y": 25500
      map:
        x: 380
        "y": 84
    - vacuum:
        x: 25500
        "y": 35500
      map:
        x: 180
        "y": -116
map_modes:
  - template: vacuum_clean_segment
    predefined_selections:
      - id: "1"
        icon:
          name: mdi:sofa
          x: 21725
          "y": 21675
        label:
          text: Wohnzimmer
          x: 21725
          "y": 21675
          offset_y: 35
        outline:
          - - 19050
            - 19700
          - - 24400
            - 19700
          - - 24400
            - 23650
          - - 19050
            - 23650
      - id: "2"
        icon:
          name: mdi:shoe-sneaker
          x: 25475
          "y": 24475
        label:
          text: Flur
          x: 25475
          "y": 24475
          offset_y: 35
        outline:
          - - 24850
            - 22100
          - - 26100
            - 22100
          - - 26100
            - 26850
          - - 24850
            - 26850
      - id: "3"
        icon:
          name: mdi:toaster-oven
          x: 28325
          "y": 23600
        label:
          text: Küche
          x: 28325
          "y": 23600
          offset_y: 35
        outline:
          - - 26100
            - 22500
          - - 30550
            - 22500
          - - 30550
            - 24700
          - - 26100
            - 24700
      - id: "4"
        icon:
          name: mdi:bed
          x: 21975
          "y": 25775
        label:
          text: Schlafzimmer
          x: 21975
          "y": 25775
          offset_y: 35
        outline:
          - - 19450
            - 23900
          - - 24500
            - 23900
          - - 24500
            - 27650
          - - 19450
            - 27650
      - id: "9"
        icon:
          name: mdi:bathtub
          x: 28400
          "y": 25900
        label:
          text: Badezimmer
          x: 28400
          "y": 25900
          offset_y: 35
        outline:
          - - 26250
            - 24950
          - - 30550
            - 24950
          - - 30550
            - 26850
          - - 26250
            - 26850
  - template: vacuum_clean_zone
  - template: vacuum_goto
map_locked: true
two_finger_pan: false
tiles:
  - tile_id: status
    entity: vacuum.roborock_qrevo_curv
    label: Status
    icon: mdi:robot-vacuum
    translations:
      starting: Starting
      charger disconnected: Charger disconnected
      idle: Idle
      remote control active: Remote control active
      cleaning: Cleaning
      returning home: Returning home
      manual mode: Manual mode
      charging: Charging
      charging problem: Charging problem
      paused: Paused
      spot cleaning: Spot cleaning
      error: Error
      shutting down: Shutting down
      updating: Updating
      docking: Docking
      going to target: Going to target
      zoned cleaning: Zoned cleaning
      segment cleaning: Segment cleaning
      emptying the bin: Emptying the bin
      charging complete: Charging complete
      device offline: Device offline
  - tile_id: battery_level
    entity: vacuum.roborock_qrevo_curv
    label: Battery
    attribute: battery_level
    icon_source: vacuum.roborock_qrevo_curv.attributes.battery_icon
    unit: "%"
    conditions:
      - entity: sensor.is_staubi_battery_under_25
        value: "true"
  - tile_id: sensor_dirty_left
    label: Sensors left
    unit: h
    multiplier: 0.0002777777777777778
    hold_action:
      action: call-service
      service: vacuum.send_command
      confirmation: {}
      service_data:
        command: reset_consumable
        params: sensor_dirty_time
        entity_id: vacuum.roborock_qrevo_curv
    entity: sensor.roborock_qrevo_curv_verbleibende_sensorzeit
    icon: mdi:eye-outline
    precision: 0
    translations: {}
    conditions:
      - entity: sensor.is_staubi_sensor_left_under_1h
        value: "true"
  - tile_id: filter_left
    label: Filter left
    unit: h
    multiplier: 0.0002777777777777778
    hold_action:
      action: call-service
      service: vacuum.send_command
      confirmation: {}
      service_data:
        command: reset_consumable
        params: filter_work_time
        entity_id: vacuum.roborock_qrevo_curv
    entity: sensor.roborock_qrevo_curv_verbleibende_filterzeit
    icon: mdi:air-filter
    precision: 0
    translations: {}
    conditions:
      - entity: sensor.is_staubi_filter_under_15h
        value: "true"
  - tile_id: main_brush_left
    label: Main brush left
    unit: h
    multiplier: 0.0002777777777777778
    hold_action:
      action: call-service
      service: vacuum.send_command
      confirmation: {}
      service_data:
        command: reset_consumable
        params: main_brush_work_time
        entity_id: vacuum.roborock_qrevo_curv
    entity: sensor.roborock_qrevo_curv_verbleibende_zeit_der_hauptburste
    icon: mdi:brush
    precision: 0
    translations: {}
    conditions:
      - entity: sensor.is_staubi_hauptburste_under_15h
        value: "true"
  - tile_id: side_brush_left
    label: Side brush left
    unit: h
    multiplier: 0.0002777777777777778
    hold_action:
      action: call-service
      service: vacuum.send_command
      confirmation: {}
      service_data:
        command: reset_consumable
        params: side_brush_work_time
        entity_id: vacuum.roborock_qrevo_curv
    entity: sensor.roborock_qrevo_curv_verbleibende_zeit_der_seitenburste
    icon: mdi:brush
    precision: 0
    translations: {}
    conditions:
      - entity: sensor.is_staubi_seitenburste_under_15h
        value: "true"
  - tile_id: cleaned_area
    label: Cleaned area
    unit: 
    precision: 2
    entity: sensor.roborock_qrevo_curv_reinigungsbereich
    icon: mdi:texture-box
    translations: {}
  - tile_id: cleaning_time
    label: Cleaning time
    unit: min
    multiplier: 0.016667
    entity: sensor.roborock_qrevo_curv_reinigungszeit
    icon: mdi:timer-sand
    precision: 0
    translations: {}
icons:
  - icon: mdi:play
    conditions:
      - entity: vacuum.roborock_qrevo_curv
        value_not: cleaning
      - entity: vacuum.roborock_qrevo_curv
        value_not: error
      - entity: vacuum.roborock_qrevo_curv
        value_not: returning
    tooltip: Start
    tap_action:
      action: call-service
      service: vacuum.start
      service_data:
        entity_id: vacuum.roborock_qrevo_curv
  - icon: mdi:pause
    conditions:
      - entity: vacuum.roborock_qrevo_curv
        value_not: docked
      - entity: vacuum.roborock_qrevo_curv
        value_not: idle
      - entity: vacuum.roborock_qrevo_curv
        value_not: error
      - entity: vacuum.roborock_qrevo_curv
        value_not: paused
    tooltip: Pause
    tap_action:
      action: call-service
      service: vacuum.pause
      service_data:
        entity_id: vacuum.roborock_qrevo_curv
  - icon: mdi:stop
    conditions:
      - entity: vacuum.roborock_qrevo_curv
        value_not: docked
      - entity: vacuum.roborock_qrevo_curv
        value_not: idle
      - entity: vacuum.roborock_qrevo_curv
        value_not: error
      - entity: vacuum.roborock_qrevo_curv
        value_not: paused
    tooltip: Stop
    tap_action:
      action: call-service
      service: vacuum.stop
      service_data:
        entity_id: vacuum.roborock_qrevo_curv
  - icon: mdi:home-map-marker
    conditions:
      - entity: vacuum.roborock_qrevo_curv
        value_not: docked
      - entity: vacuum.roborock_qrevo_curv
        value_not: returning
    tooltip: Return to base
    tap_action:
      action: call-service
      service: vacuum.return_to_base
      service_data:
        entity_id: vacuum.roborock_qrevo_curv
  - icon: mdi:target-variant
    conditions:
      - entity: vacuum.roborock_qrevo_curv
        value_not: docked
      - entity: vacuum.roborock_qrevo_curv
        value_not: error
      - entity: vacuum.roborock_qrevo_curv
        value_not: cleaning
      - entity: vacuum.roborock_qrevo_curv
        value_not: returning
    tooltip: Clean spot
    tap_action:
      action: call-service
      service: vacuum.clean_spot
      service_data:
        entity_id: vacuum.roborock_qrevo_curv
  - icon: mdi:map-marker
    tooltip: Locate
    tap_action:
      action: call-service
      service: vacuum.locate
      service_data:
        entity_id: vacuum.roborock_qrevo_curv
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: "off"
    conditions:
      - entity: vacuum.roborock_qrevo_curv
        attribute: fan_speed
        value: "off"
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.roborock_qrevo_curv
        fan_speed: "off"
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: quiet
    conditions:
      - entity: vacuum.roborock_qrevo_curv
        attribute: fan_speed
        value: quiet
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.roborock_qrevo_curv
        fan_speed: quiet
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: balanced
    conditions:
      - entity: vacuum.roborock_qrevo_curv
        attribute: fan_speed
        value: balanced
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.roborock_qrevo_curv
        fan_speed: balanced
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: Turbo
    conditions:
      - entity: vacuum.roborock_qrevo_curv
        attribute: fan_speed
        value: turbo
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.roborock_qrevo_curv
        fan_speed: turbo
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: max
    conditions:
      - entity: vacuum.roborock_qrevo_curv
        attribute: fan_speed
        value: max
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.roborock_qrevo_curv
        fan_speed: max
  - menu_id: fan_speed
    icon: mdi:fan-alert
    label: max_plus
    conditions:
      - entity: vacuum.roborock_qrevo_curv
        attribute: fan_speed
        value: max_plus
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.roborock_qrevo_curv
        fan_speed: max_plus
  - icon: mdi:fan-alert
    conditions:
      - entity: vacuum.roborock_qrevo_curv
        attribute: fan_speed
        value_not: "off"
      - entity: vacuum.roborock_qrevo_curv
        attribute: fan_speed
        value_not: quiet
      - entity: vacuum.roborock_qrevo_curv
        attribute: fan_speed
        value_not: balanced
      - entity: vacuum.roborock_qrevo_curv
        attribute: fan_speed
        value_not: turbo
      - entity: vacuum.roborock_qrevo_curv
        attribute: fan_speed
        value_not: max
      - entity: vacuum.roborock_qrevo_curv
        attribute: fan_speed
        value_not: custom
      - entity: vacuum.roborock_qrevo_curv
        attribute: fan_speed
        value_not: max_plus
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.roborock_qrevo_curv
        fan_speed: "off"
  - type: menu
    menu_id: water_box_mode
    icon_id: water_box_mode
    available_values_attribute: options
    icon: mdi:water
    icon_mapping:
      "off": mdi:water-remove
      mild: mdi:water-minus
      moderate: mdi:water
      intense: mdi:water-plus
      custom: mdi:water-sync
    tap_action:
      action: call-service
      service: select.select_option
      service_data:
        option: "[[value]]"
        entity_id: "[[entity_id]]"
    entity: select.roborock_qrevo_curv_wisch_intensitat
  - type: menu
    menu_id: mop_mode
    icon_id: mop_mode
    available_values_attribute: options
    icon: mdi:water
    icon_mapping:
      standard: mdi:standard-definition
      deep: mdi:high-definition
      deep_plus: mdi:ultra-high-definition
      custom: mdi:fit-to-screen-outline
    tap_action:
      action: call-service
      service: select.select_option
      service_data:
        option: "[[value]]"
        entity_id: "[[entity_id]]"
    entity: select.roborock_qrevo_curv_mop_modus

@simllll
Copy link

simllll commented Nov 5, 2024

One more thing that makes life even easiser, to get the right calibration_points you can just go to the developer menu and select "States" http://homeassistant.local/developer-tools/state (this only works while you have the custom integration installed!)
And search for "camera.roborock", there you get a result with the calbration points included.
e.g.

access_token: xyz
calibration_points: 
- vacuum:
    x: 25500
    'y': 25500
  map:
    x: 266
    'y': 336
- vacuum:
    x: 26500
    'y': 25500
  map:
    x: 286
    'y': 336
- vacuum:
    x: 25500
    'y': 26500
  map:
    x: 266
    'y': 316

carpet_map: 96283, 96284, 96285, 96286, 96287, 96288, 96289, 96290, 96291, 96292, 96293, 96294, 79931, 79932, 79933, 79934, 79935, 79936, 41038, 41039, 41040, 41041, 41042, 41043, 41044, 41045, 41046, 41047, 41048, 41049, 41050, 41051, 41052, 41053, 41054, 41055, 41056, 41057, 41058, 41059, 39076, 39081, 39082, 39083, 39097, 39098, 67793, 67794, 98565, 98566, 98567, 98568, 98569, 98570, 98571, 98572, 98573, 98574, 98575, 98576, 98577, 98578, 98579, 98580, 98581, 98582, 98583, 98584, 8221....

Full working config (adapted "ids" to numbers and fixed some props)

Vacuum Card Config

type: custom:xiaomi-vacuum-map-card
entity: vacuum.roborock_s8_pro_ultra
vacuum_platform: send_command
map_source:
  camera: image.roborock_s8_pro_ultra
calibration_source:
  calibration_points:
    - vacuum:
        x: 25500
        "y": 25500
      map:
        x: 266
        "y": 336
    - vacuum:
        x: 26500
        "y": 25500
      map:
        x: 286
        "y": 336
    - vacuum:
        x: 25500
        "y": 26500
      map:
        x: 266
        "y": 316
map_locked: true
map_modes:
  - template: vacuum_clean_segment
    predefined_selections:
      - id: 16
        comment: Flur
        icon:
          name: mdi:walk
          x: 23100
          "y": 34200
        outline:
          - - 22300
            - 32900
          - - 23900
            - 32900
          - - 23900
            - 35500
          - - 22300
            - 35500
      - id: 17
        comment: Garderobe
        icon:
          name: mdi:hanger
          x: 16475
          "y": 30225
        outline:
          - - 16000
            - 29100
          - - 16950
            - 29100
          - - 16950
            - 31350
          - - 16000
            - 31350
      - id: 18
        comment: Klo
        icon:
          name: mdi:toilet
          x: 19275
          "y": 31825
        outline:
          - - 18800
            - 31050
          - - 19750
            - 31050
          - - 19750
            - 32600
          - - 18800
            - 32600
      - id: 19
        comment: Abstellraum
        icon:
          name: mdi:storage-tank-outline
          x: 17425
          "y": 32025
        outline:
          - - 16250
            - 31250
          - - 18600
            - 31250
          - - 18600
            - 32800
          - - 16250
            - 32800
      - id: 20
        comment: Küche
        icon:
          name: mdi:food-variant
          x: 21525
          "y": 31375
        outline:
          - - 19800
            - 30100
          - - 25250
            - 30100
          - - 25250
            - 33050
          - - 19800
            - 33050
      - id: 21
        comment: Duschbad
        icon:
          name: mdi:shower-head
          x: 19400
          "y": 34600
        outline:
          - - 18000
            - 33700
          - - 20800
            - 33700
          - - 20800
            - 35500
          - - 18000
            - 35500
      - id: 22
        comment: Schlafzimmer
        icon:
          name: mdi:bed-king-outline
          x: 20100
          "y": 36775
        outline:
          - - 17900
            - 35500
          - - 20900
            - 35500
          - - 20900
            - 33700
          - - 22300
            - 33700
          - - 22300
            - 39850
          - - 17900
            - 39850
      - id: 23
        comment: Gästezimmer
        icon:
          name: mdi:bed-outline
          x: 24650
          "y": 37625
        outline:
          - - 22500
            - 35450
          - - 26800
            - 35450
          - - 26800
            - 39800
          - - 22500
            - 39800
      - id: 24
        comment: Balkon
        icon:
          name: mdi:balcony
          x: 21475
          "y": 23750
        outline:
          - - 18950
            - 21750
          - - 24000
            - 21750
          - - 24000
            - 25750
          - - 18950
            - 25750
      - id: 25
        comment: Esszimmer
        icon:
          name: mdi:table-furniture
          x: 21975
          "y": 27950
        outline:
          - - 19000
            - 25800
          - - 23950
            - 25800
          - - 24950
            - 30100
          - - 19000
            - 30100
      - id: 26
        comment: Wannenbad
        icon:
          name: mdi:bathtub-outline
          x: 24925
          "y": 33725
        outline:
          - - 23850
            - 32900
          - - 26000
            - 32900
          - - 26000
            - 34550
          - - 23850
            - 34550
      - id: 27
        comment: Wohnzimmer
        icon:
          name: mdi:sofa-outline
          x: 25875
          "y": 26875
        outline:
          - - 23700
            - 24500
          - - 28050
            - 24500
          - - 28050
            - 29950
          - - 24700
            - 29950
      - id: 28
        comment: Eingang
        icon:
          name: mdi:coat-rack
          x: 18425
          "y": 30250
        outline:
          - - 17050
            - 29000
          - - 19800
            - 29000
          - - 19800
            - 31500
          - - 17050
            - 31500
  - template: vacuum_clean_zone
  - template: vacuum_goto
two_finger_pan: true
title: Roborock S8 Pro Ultra
icons:
  - icon: mdi:pause
    conditions:
      - entity: vacuum.roborock_s8_pro_ultra
        value_not: docked
      - entity: vacuum.roborock_s8_pro_ultra
        value_not: idle
      - entity: vacuum.roborock_s8_pro_ultra
        value_not: error
      - entity: vacuum.roborock_s8_pro_ultra
        value_not: paused
    tooltip: Pause
    tap_action:
      action: call-service
      service: vacuum.pause
      service_data:
        entity_id: vacuum.roborock_s8_pro_ultra
  - icon: mdi:stop
    conditions:
      - entity: vacuum.roborock_s8_pro_ultra
        value_not: docked
      - entity: vacuum.roborock_s8_pro_ultra
        value_not: idle
      - entity: vacuum.roborock_s8_pro_ultra
        value_not: error
      - entity: vacuum.roborock_s8_pro_ultra
        value_not: paused
    tooltip: Stop
    tap_action:
      action: call-service
      service: vacuum.stop
      service_data:
        entity_id: vacuum.roborock_s8_pro_ultra
  - icon: mdi:home-map-marker
    conditions:
      - entity: vacuum.roborock_s8_pro_ultra
        value_not: docked
      - entity: vacuum.roborock_s8_pro_ultra
        value_not: returning
    tooltip: Return to base
    tap_action:
      action: call-service
      service: vacuum.return_to_base
      service_data:
        entity_id: vacuum.roborock_s8_pro_ultra
  - icon: mdi:map-marker
    tooltip: Locate
    tap_action:
      action: call-service
      service: vacuum.locate
      service_data:
        entity_id: vacuum.roborock_s8_pro_ultra
tiles:
  - tile_id: status
    entity: vacuum.roborock_s8_pro_ultra
    label: Status
    icon: mdi:robot-vacuum
    translations:
      starting: Starten...
      charger disconnected: Charger disconnected
      idle: Idle
      remote control active: Remote control active
      cleaning: Cleaning
      returning home: Returning home
      manual mode: Manual mode
      charging: Charging
      charging problem: Charging problem
      paused: Paused
      spot cleaning: Spot cleaning
      error: Error
      shutting down: Shutting down
      updating: Updating
      docking: Docking
      going to target: Going to target
      zoned cleaning: Zoned cleaning
      segment cleaning: Segment cleaning
      emptying the bin: Emptying the bin
      charging complete: Charging complete
      device offline: Device offline
  - tile_id: battery_level
    entity: vacuum.roborock_s8_pro_ultra
    label: Batterie
    attribute: battery_level
    icon_source: vacuum.roborock_s8_pro_ultra.attributes.battery_icon
    unit: "%"
  - tile_id: fan_speed
    entity: vacuum.roborock_s8_pro_ultra
    label: Saugstärke
    attribute: fan_speed
    icon: mdi:fan
    translations:
      silent: Silent
      standard: Standard
      medium: Medium
      turbo: Turbo
      auto: Auto
      gentle: Gentle
  - tile_id: sensor_dirty_left
    label: Sensoren verbleibend
    unit: h
    multiplier: 0.0002777777777777778
    hold_action:
      action: call-service
      service: vacuum.send_command
      confirmation: {}
      service_data:
        command: reset_consumable
        params: sensor_dirty_time
        entity_id: vacuum.roborock_s8_pro_ultra
    entity: sensor.roborock_s8_pro_ultra_verbleibende_sensorzeit
    icon: mdi:eye-outline
    precision: 0
    translations: {}
  - tile_id: filter_left
    label: Filter verbleibend
    unit: h
    multiplier: 0.0002777777777777778
    hold_action:
      action: call-service
      service: vacuum.send_command
      confirmation: {}
      service_data:
        command: reset_consumable
        params: filter_work_time
        entity_id: vacuum.roborock_s8_pro_ultra
    entity: sensor.roborock_s8_pro_ultra_verbleibende_filterzeit
    icon: mdi:air-filter
    precision: 0
    translations: {}
  - tile_id: main_brush
    label: Hauptbürste verbleibend
    unit: h
    multiplier: 0.0002777777777777778
    hold_action:
      action: call-service
      service: vacuum.send_command
      confirmation: {}
      service_data:
        command: reset_consumable
        params: main_brush_work_time
        entity_id: vacuum.roborock_s8_pro_ultra
    entity: sensor.roborock_s8_pro_ultra_verbleibende_zeit_der_hauptburste
    icon: mdi:brush
    precision: 0
    translations: {}
  - tile_id: side_brush_left
    label: Seitenbürste verbleibend
    unit: h
    multiplier: 0.0002777777777777778
    hold_action:
      action: call-service
      service: vacuum.send_command
      confirmation: {}
      service_data:
        command: reset_consumable
        params: side_brush_work_time
        entity_id: vacuum.roborock_s8_pro_ultra
    entity: sensor.roborock_s8_pro_ultra_verbleibende_zeit_der_seitenburste
    icon: mdi:brush
    precision: 0
    translations: {}
  - tile_id: cleaned_area
    label: Gereinigte Fälche
    unit: m²
    precision: 2
    entity: sensor.roborock_s8_pro_ultra_reinigungsbereich
    icon: mdi:texture-box
    translations: {}
  - tile_id: cleaning_time
    label: Reinigungsszeit
    unit: min
    multiplier: 0.016667
    entity: sensor.roborock_s8_pro_ultra_reinigungszeit
    icon: mdi:timer-sand
    precision: 0
    translations: {}
additional_presets: []

for me to get it working, I have to use
vacuum_platform: default

Use numbers as IDs, not strings!

Regarding the vacuum_platform there are some weird behaviours, as far as I have seen the default implementaiton uses "send_command" for clean segments? but using send_command doesn't work, it starts cleaning all instead or it does nothing at all (very strange, seems now it doesn't do anything anymore with room cleaning). But for the two other map modes (go to and zone), default doesn't work but "send_command" does. So this point is still a issue for me.
see next posting for solution.

For clarification, sending a raw command like this:

service: vacuum.send_command
data:
  command: app_segment_clean
  params:
    - segments:
        - 22
      repeat: 1
target:
  entity_id: vacuum.roborock_s8_pro_ultra

does work as expected.

debuged what the websocket is sending, seems also correct to me. strange?

{"type":"call_service","domain":"vacuum","service":"send_command","return_response":false,"service_data":{"command":"app_segment_clean","params":["27"],"entity_id":"vacuum.roborock_s8_pro_ultra"},"id":96}

I'm stuck, I tried sending the call_service via developer tools:
image

but still doesn't do anything. If I call the action instead:

image

it works as expected.

who is processing the "call_service"? Isn't this HA core?

@simllll
Copy link

simllll commented Nov 5, 2024

Okay I debugged it even further, it seems that "params" is passed in a wrong format,.. what then happens is that the whole integration goes offline for a second, and comes back. but the robot is not doing anything.

e.g.
sending:

action: vacuum.send_command
data:
  command: app_segment_clean
  params: "27"
target:
  entity_id: vacuum.robrock

breaks it

action: vacuum.send_command
data:
  command: app_segment_clean
  params:
    - 27
target:
  entity_id: vacuum.robrock

works.

Puh, I finally found the issue and the SOLUTION, the "id" in the predefined_selections:
- id: "20"
MUST BE defined without quotes,
- id: 20
then it starts working correclty :-)

@PiotrMachowski
Copy link
Owner

@simllll You can force ids to be treated as numbers with following config (even when they are provided with quotes):

map_modes:
  - template: vacuum_clean_segment
    id_type: number
    predefined_selections:
      - id: 16
        comment: Flur
        ...

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
Development

No branches or pull requests

8 participants