yep, too late thanks anyways!
I added
card:
type: grid
title: "${'Test Icon color Buttons above ' + threshold}"
too just for the fun of it
full card:
- type: custom:config-template-card
entities:
- input_number.power_threshold
variables:
threshold: states['input_number.power_threshold'].state
card:
type: custom:auto-entities
card:
type: grid
title: "${'Test Icon color Buttons above ' + threshold}"
columns: 4
card_param: cards
filter:
include:
- entity_id: sensor.*_actueel
options:
type: custom:button-card
aspect_ratio: 1/1
show_state: true
template: support_custom_ui
exclude:
- state: '${"<" + threshold}'
sort:
method: state
numeric: true
yet unformatted buttons, but thats a matter of injecting another templateā¦
there is still a challenge of not showing the card at all if the list is empty. Think the only way is using a conditional card on a dedicated template
{% set threshold = states('input_number.power_threshold')|float(0) %}
{% set ns = namespace(above_threshold=[]) %}
{% for s in states.sensor
|selectattr('entity_id' 'search','_actueel')
if s.state|float(0) > threshold %}
{% set ns.above_threshold = ns.above_threshold + [s.entity_id] %}
{% endfor %}
{{ns.above_threshold|length > 0}}