Hypfer / lovelace-valetudo-map-card

Display the map from a valetudo-enabled robot in a home assistant dashboard card.
MIT License
243 stars 36 forks source link

Custom "start/play" button - Feature Request #148

Open ich777 opened 10 months ago

ich777 commented 10 months ago

Hi,

would it be somehow be possible to have a customizable start button that can be displayed in the spot where the built in one is located?

Currently I have removed the built in start button because I've created a Helper in HomeAssistant where I can specify the iterations and as you can see the "play" button is in front of all buttons: grafik

My code for the vertical stack card looks like that currently:

vacuum: valetudo_dreamed10spro
type: custom:valetudo-map-card
title: Dreame D10s Pro
show_status: false
show_battery_level: false
show_start_button: false
show_locate_button: false
custom_buttons:
  - service: mqtt.publish
    service_data:
      topic: valetudo/DreameD10sPro/MapSegmentationCapability/clean/set
      payload_template: >-
        {"segment_ids": ["3", "5", "1", "2", "6", "4"], "iterations": {{
        states('input_number.vacuum_wiederholungen') | int }}, "customOrder":
        true}
    icon: mdi:play
  - service: mqtt.publish
    service_data:
      topic: valetudo/DreameD10sPro/MapSegmentationCapability/clean/set
      payload_template: >-
        {"segment_ids": ["3"], "iterations": {{
        states('input_number.vacuum_wiederholungen') | int }}, "customOrder":
        true}
    icon: mdi:sofa
  - service: mqtt.publish
    service_data:
      topic: valetudo/DreameD10sPro/MapSegmentationCapability/clean/set
      payload_template: >-
        {"segment_ids": ["2"], "iterations": {{
        states('input_number.vacuum_wiederholungen') | int }}, "customOrder":
        true}
    icon: mdi:bed-queen
  - service: mqtt.publish
    service_data:
      topic: valetudo/DreameD10sPro/MapSegmentationCapability/clean/set
      payload_template: >-
        {"segment_ids": ["1"], "iterations": {{
        states('input_number.vacuum_wiederholungen') | int }}, "customOrder":
        true}
    icon: mdi:bed-king
  - service: mqtt.publish
    service_data:
      topic: valetudo/DreameD10sPro/MapSegmentationCapability/clean/set
      payload_template: >-
        {"segment_ids": ["5"], "iterations": {{
        states('input_number.vacuum_wiederholungen') | int }}, "customOrder":
        true}
    icon: mdi:door
  - service: mqtt.publish
    service_data:
      topic: valetudo/DreameD10sPro/MapSegmentationCapability/clean/set
      payload_template: >-
        {"segment_ids": ["4"], "iterations": {{
        states('input_number.vacuum_wiederholungen') | int }}, "customOrder":
        true}
    icon: mdi:stove
  - service: mqtt.publish
    service_data:
      topic: valetudo/DreameD10sPro/MapSegmentationCapability/clean/set
      payload_template: >-
        {"segment_ids": ["6"], "iterations": {{
        states('input_number.vacuum_wiederholungen') | int }}, "customOrder":
        true}
    icon: mdi:shower

There you can see that I push the topics directly with custom buttons and it would be really cool to be able to move the "play" button in the default spot, I also removed the locate button because it looks a bit odd if it is alone up there.

Hope that makes sense and is something that is considered as a feature and could be done.

Thanks, Christoph