Hi all,
I wrote down the following code:
- type: custom:vertical-stack-in-card
cards:
- type: vertical-stack
cards:
- features:
- type: cover-position
type: tile
entity: cover.tapparella_della_camera
icon: mdi:window-shutter
color: white
name: Tapparella
- type: horizontal-stack
cards:
- type: custom:button-card
tap_action:
action: call-service
service: cover.set_cover_position
service_data:
position: 0
entity_id: cover.tapparella_della_camera
entity: cover.tapparella_della_camera
name: Close
show_icon: false
card_mod:
style: |
ha-card {
--ha-card-background:
{% if is_state_attr('cover.tapparella_della_camera', 'current_position', 0) %}
green;
color: white;
{% endif %}
}
styles:
card:
- border: 0px 0px 0px 0px
- border-radius: 0%
- box-shadow: 0px 0px 0px 0px
- type: custom:button-card
tap_action:
action: call-service
service: cover.set_cover_position
service_data:
position: 50
entity_id: cover.tapparella_della_camera
entity: cover.tapparella_della_camera
name: 50%
show_icon: false
card_mod:
style: |
ha-card {
--ha-card-background:
{% if is_state_attr('cover.tapparella_della_camera', 'current_position', 50) %}
green;
color: white;
{% endif %}
}
styles:
card:
- border: 0px 0px 0px 0px
- border-radius: 0%
- box-shadow: 0px 0px 0px 0px
- type: custom:button-card
tap_action:
action: call-service
service: cover.set_cover_position
service_data:
position: 100
entity_id: cover.tapparella_della_camera
entity: cover.tapparella_della_camera
name: Open
show_icon: false
card_mod:
style: |
ha-card {
--ha-card-background:
{% if is_state_attr('cover.tapparella_della_camera', 'current_position', 100) %}
green;
color: white;
{% endif %}
}
styles:
card:
- border: 0px 0px 0px 0px
- border-radius: 0%
- box-shadow: 0px 0px 0px 0px
In order to get this tile card:
But I’d like to change the icon if the cover is in the following states (as example):
- if it has a position <= 22%
- if it has a position > 22% and != 50%
-if it has a position == 50%
is there a chance to implement in the above code?