question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add default hold action to reset consumables

See original GitHub issue

Description

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:closed
  • Created a year ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
incaseoftroublecommented, Aug 25, 2022

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.

0reactions
PiotrMachowskicommented, Sep 13, 2022

Feature added in v2.1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Action group - Kerbal Space Program Wiki
In a default career mode, the action groups button is not initially visible. The VAB or SPH buildings must be upgraded to enable...
Read more >
Reset Your Echo Dot (3rd, 4th, or 5th Generations)
If the issue persists, reset your device: Press and hold the Action button for 20 seconds. Wait for the light ring to turn...
Read more >
touch-action - CSS: Cascading Style Sheets - MDN Web Docs
The touch-action CSS property sets how an element's region can be manipulated by a touchscreen user (for example, by zooming features built ...
Read more >
Use Photoshop tools - Adobe Support
By default, you cycle through a set of hidden tools by holding down Shift and repeatedly pressing a tool shortcut key.
Read more >
Reset 7900 Series IP Phones Password - Cisco
Complete these steps in order to reset the Cisco 7920 Wireless IP phone to the factory default: Choose Menu > Phone Settings >...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found