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

Bulk include not working for 1/3 of my devices #739

Open
DonLuigi opened this issue Aug 30, 2024 · 1 comment
Open

Bulk include not working for 1/3 of my devices #739

DonLuigi opened this issue Aug 30, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@DonLuigi
Copy link

DonLuigi commented Aug 30, 2024

Describe the bug
To bulk include devices, you would typically write
filter:
include:
- name: attributes.device_class
value: battery

However, I have many devices that have battery low state attribute classified as device_class: battery.
This means that instead of displaying battery percentage, the card displays On or Off, and no battery percentage, since it includes only one (first) attribute of the entity that matches.

Since there is no AND in include, I cannot write something like this:
filter:
include:
- name: attributes.device_class
value: battery
- type: AND
- name: attributes.state_class
value: measurement

that would actually filter my entity attributes properly.

Is there any way around this?

@DonLuigi DonLuigi added the bug Something isn't working label Aug 30, 2024
@GeoffWy
Copy link

GeoffWy commented Sep 2, 2024

If your problem devices had battery percentage classified as device_class battery, that would display as well as battery low state.

It could be that those devices only offer battery state (values 0, 1, 2), in which case you could use state_map: to map those states to artificial percentages (eg, 25%, 50%, 100%).

Or it could be that the battery percentage for these devices is being classified as device_class measurement. You should be able to find some other filter method to include them, and use an exclude: to exclude the battery state you don't want. Alternatively maybe you can you use the attribute: option to pick out the attribute you want. Also suggest use the debug: option to inspect what is actually available.

All these options are described here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants