maxwroc/battery-state-card

Is it possible to add a tap-action while showing only filtered entities?

Numelle opened this issue · 2 comments

Hi all,

first of all thanks for this great card. I am currently working on a card where I have explicitly filtered devices.
What I am missing is the possibility to add a tap-action for all devices.
It should be the same (naturally ;-D). So basically a "Foreach filtered device ad the tap-action: more-info" functionality.
Is this currently already possible? If yes, how? ;-)

Below is my YAML which Doesn't work :-P
YAML configuration
type: custom:battery-state-card
title: Devices Less 20% Battery
color_gradient:

  • '#ff0000'
  • '#ffff00'
  • '#00ff00'
    entities: null
    filter:
    include:
    • name: entity_id
      value: '*_battery'
    • name: attributes.device_class
      value: battery
      exclude:
    • name: entity_id
      value: 'iphone'
    • name: entity_id
      value: 'zoe'
      tap-action:
      action: more-info

paste your card configuration here

See YAML

Screenshot
N/A

Version
2.1.1

Thanks to all ;-)

You cannot do it now per filter but you can add tap action for all of the entities.

All of these common options you can specify at the "card-level":
https://github.com/maxwroc/battery-state-card#common-options

Example taken from the documentation

type: custom:battery-state-card
title: HDD temperatures
icon: mdi:harddisk
color_thresholds:
  - value: 26
    color: blue
  - value: 36
    color: green
  - value: 45
    color: yellow
  - value: 60
    color: red
tap_action:
  action: more-info
collapse: 3
sort_by_level: desc
unit: °C
round: 0
filter:
  include:
    - name: entity_id
      value: sensor.nasos_sd*
    - name: entity_id
      value: sensor.omv2_sd*
    - name: entity_id
      value: sensor.exnas_st12*temper*
    - name: entity_id
      value: sensor.*_disk_*_temperature
entities:
  - entity: sensor.vidik_temperature
  - entity: sensor.exnas_d1_temperatures_temperature

If this solves your problem please close the issue