Add default hold action to reset consumables
See original GitHub issueDescription
First: Thanks a lot for this really awesome card!
While playing with it, I found that it would be nice to be able to reset the consumables (filter, brush, sensor, etc.) through the appropriate buttons. I “hacked” this by manually overriding the tiles:
(see code below), however this is a bit cumbersome.
type: custom:xiaomi-vacuum-map-card
map_source:
camera: camera.xiaomi_cloud_map_extractor
calibration_source:
camera: true
entity: vacuum.roborock_vacuum_s5e
vacuum_platform: default
two_finger_pan: true
map_locked: false
tiles:
- label: Status
icon: mdi:robot-vacuum
entity: vacuum.roborock_vacuum_s5e
attribute: status
- label: Battery
icon: mdi:battery
entity: vacuum.roborock_vacuum_s5e
attribute: battery_level
unit: '%'
- label: Fan speed
icon: mdi:fan
entity: vacuum.roborock_vacuum_s5e
attribute: fan_speed
- label: Sensors left
icon: mdi:eye-outline
entity: sensor.roborock_vacuum_s5e_sensor_dirty_left
unit: h
multiplier: 0.000277778
precision: 0
hold_action:
action: call-service
service: vacuum.send_command
service_data:
command: reset_consumable
params: sensor_dirty_time
target:
device_id: ---
- label: Filter left
icon: mdi:air-filter
entity: sensor.roborock_vacuum_s5e_filter_left
unit: h
multiplier: 0.000277778
precision: 0
hold_action:
action: call-service
service: vacuum.send_command
service_data:
command: reset_consumable
params: filter_work_time
target:
device_id: ---
- label: Main brush left
icon: mdi:brush
entity: sensor.roborock_vacuum_s5e_main_brush_left
unit: h
multiplier: 0.000277778
precision: 0
hold_action:
action: call-service
service: vacuum.send_command
service_data:
command: reset_consumable
params: main_brush_work_time
target:
device_id: ---
- label: Sensors left
icon: mdi:brush
entity: sensor.roborock_vacuum_s5e_side_brush_left
unit: h
multiplier: 0.000277778
precision: 0
hold_action:
action: call-service
service: vacuum.send_command
service_data:
command: reset_consumable
params: side_brush_work_time
target:
device_id: ---
(removed the device id)
Solution
I’d guess that this is a reasonable behavior to have by default, so maybe one could add an attribute to the template or a separate template (default_with_reset
or so?). However, I am unsure what’s the best way to implement this.
Alternatives
No response
Context
Side note: While adding the hold_action
I found that this card expects the service call data to be given as service_data:
in the YAML, while normal home assistant actions are parametrized by data:
. Maybe it makes sense to keep this in sync?
Issue Analytics
- State:
- Created a year ago
- Comments:8 (6 by maintainers)
Top GitHub Comments
Totally fine with me! Maybe adding a remark / example in the README might be good 😄 The section “Tile list entry options” links to HA’s action definition, which suggests the
data:
format.Feature added in v2.1.0