Hey guys,
Iam trying to create a status page where I can see with one quick glance the status of my devices.
iam struggling with the count of devices (per device_class, motion, temperature, window, door) which have a low battery. I dont have to know which devices have a low battery level, just how many.
I came across several solutions for instance:
a blueprint https://community.home-assistant.io/t/low-battery-level-detection-notification-for-all-battery-sensors/258664
but I was more looking for a one-liner something like:
{{ states | selectattr('attributes.device_class', 'eq', 'motion') | selectattr('attributes.device_class', 'eq', 'battery') | selectattr('state', '<=','20') | list | count}}
I tried several several combinations from several one-liner examples, But I lack the skills to figure this out, if even possible.
Somebody?
Thanks in advance
Frank