battery-state-card
battery-state-card copied to clipboard
Allow template when excluding based on state value
Is your feature request related to a problem? Please describe. I'm trying to get the battery card to show up conditionally based on a sensor which triggers when a device has a battery level below a certain threshold, which works fine. However, I haven't been able to figure out how to exclude devices in the shown card based on a sensor value from another entity.
type: conditional
conditions:
- condition: state
entity: binary_sensor.low_battery
state: 'on'
card:
type: custom:battery-state-card
title: Battery Levels
secondary_info: '{last_changed}'
filter:
include:
- name: entity_id
value: '*_battery_level'
- name: attributes.device_class
value: battery
exclude:
- name: state
value: '{input_number.low_battery_threshold}' <--- This doesn't work
operator: '>'
- name: entity_id
value: binary_sensor.low_battery
sort:
by: state
bulk_rename:
- from: ' Battery'
- from: ' level'
colors:
steps:
- '#ff0000'
- '#ffff00'
- '#00ff00'
gradient: true
Describe the solution you'd like I'd like it to be possible to use templating for the value of a filter (if it's not already possible in another way than what I'm trying)
Interesting idea