Hello,
I’m building a dashboard and can’t get the button-card highlighted when selected. input_select.scene_studio_selected is used to select a scene. When scene_studio_guest_bathroom_night is selected, the static card (top) gets highlighted, but the auto-entities card with the same state value (one of the below) does not get highlighted and I cant’ figure out why. I verified that scenes has scene.scene_studio_guest_bathroom_night
cards:
- type: custom:button-card
name: Test
icon: mdi:theater
entity: input_select.scene_studio_selected
state:
- value: scene.scene_studio_guest_bathroom_night
operator: '=='
styles:
card:
- border: 2px solid var(--primary-color),
- background: rgba(var(--rgb-primary-color),0.08),
- box-shadow: 0 0 0 2px rgba(var(--rgb-primary-color),0.15) inset
- type: custom:auto-entities
card:
type: grid
columns: 4
square: false
card_param: cards
filter:
template: >
{% set area = states('input_select.scene_studio_area') %}
{% if area in ['unknown','unavailable',''] %}
[]
{% else %}
{% set slug = area|lower|regex_replace('[^a-z0-9]+','_')|trim('_') %}
{% set prefix = 'scene.scene_studio_' ~ slug ~ '_' %}
{% set scenes = states.scene
| selectattr('entity_id','match','^' ~ prefix)
| map(attribute='entity_id') | list %}
[
{%- for eid in scenes|sort -%}
{% set name_slug = eid[prefix|length:] %}
{% set pretty = name_slug.replace('_',' ') | title %}
{
"type": "custom:button-card",
"name": "{{ pretty }}",
"icon": "mdi:theater",
"entity": "input_select.scene_studio_selected",
"state": [
{
"value": "{{ eid }}",
"operator": "==",
"styles": {
"card": [
"border: 2px solid var(--primary-color)",
"background: rgba(var(--rgb-primary-color),0.08)",
"box-shadow: 0 0 0 2px rgba(var(--rgb-primary-color),0.15) inset"
],
}
}
]
}{% if not loop.last %},{% endif %}
{%- endfor -%}
]
{% endif %}
Any help much appreciated.
Thanks Goppi