maxwroc/battery-state-card

Only keep "Unavailable" sensors

Opened this issue · 1 comments

Is there a way to only keep battery sensors with state "Unavailable"?

I have quite a few sensors, some of them rarely used where the battery is already discharged. I want to have separate views for the regular devices which have battery state >= 0% and the ones with state "Undefined".

Since the filter is only applied using OR condition, this will not work.

Any ideas?

YAML configuration

  include:
    - name: attributes.device_class
      value: battery
  include:
    - name: state
      value: Unavailable

Version
3.2.1

I use the following:

  exclude:
    - name: state
      value: /[0-9]/
      operator: matches

which just filters out all that have a numerical value.

Although that doesn't show devices that have an empty battery, don't respond anymore and aren't marked as unavailable.