Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only keep "Unavailable" sensors #721

Open
dergreg opened this issue Apr 17, 2024 · 1 comment
Open

Only keep "Unavailable" sensors #721

dergreg opened this issue Apr 17, 2024 · 1 comment
Labels
question Further information is requested

Comments

@dergreg
Copy link

dergreg commented Apr 17, 2024

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

@dergreg dergreg added the question Further information is requested label Apr 17, 2024
@doppynl
Copy link

doppynl commented Aug 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants