Hi all, I currently am trying to understand yaml…
Hope one of you could help me with the topic below.
I created a group with my cover blinds : “group_status_alle_somfy_rolluiken”.
This group is set to “closed” if all the blinds are closed and this is working fine.
Now I want to use this information to have the color of a custom button card changed : green if all the covers are closed and red if not.
This is the yaml code behind the custom button card but the “color” part is not working. Any feedback appreciated.
- type: custom:button-card
tap_action:
action: call-service
service: cover.close_cover
service_data: {}
target:
device_id:
- b0d31b5826836dc6eb185dfe41bf07fb
- ff9380f9744ec162553b9fa98d749aad
name: Sluit alle rolluiken
icon: mdi:window-shutter
hold_action:
action: none
show_state: true
color: |
[[[
if (states['group.group_status_alle_somfy_rolluiken'].state == 'closed') return "green";
else return 'red';
]]]