@Clemalex a encore les bonnes pistes
J’ai utilisé le « state » pour adapter mes opacités et titre et cela fonctionne :
card_select_floor:
show_icon: false
show_label: true
show_name: true
styles:
grid:
- grid-template-areas: "'n item1 item2 item3' 'l item1 item2 item3'"
- grid-template-columns: "1fr 60px 60px 60px"
- grid-template-rows: "min-content min-content"
card:
- background-color: "rgba(0,0,0,0)"
- box-shadow: "none"
- height: "auto"
- margin: "5px 0px 0px 0px"
- padding: "0px"
name:
- justify-self: "start"
- font-weight: "bold"
- font-size: "1.5rem"
label:
- justify-self: "start"
- font-size: "0.8rem"
- opacity: "0.4"
state:
- name: Maison
value: Maison
- name: Rez-de-chaussée
value: Rez-de-chaussée
- name: Etage
value: Etage
custom_fields:
item1:
card:
type: custom:button-card
name: Maison
entity: "[[[ return variables.input_select_name; ]]]"
icon: mdi:home-assistant
styles:
card:
- background-color: "rgba(0,0,0,0)"
- box-shadow: "none"
- padding: "0px"
icon:
- width: 30px
name:
- font-size: "0.8rem"
state:
- styles:
icon:
- opacity: 1
name:
- opacity: 1
value: Maison
- styles:
icon:
- opacity: 0.4
name:
- opacity: 0.4
operator: default
tap_action:
action: call-service
service: input_select.select_option
service_data:
entity_id: "[[[ return variables.input_select_name; ]]]"
option: Maison
item2:
card:
type: custom:button-card
name: RDC
entity: "[[[ return variables.input_select_name; ]]]"
icon: mdi:home-floor-0
styles:
card:
- background-color: "rgba(0,0,0,0)"
- box-shadow: "none"
- padding: "0px"
icon:
- width: 30px
name:
- font-size: "0.8rem"
state:
- styles:
icon:
- opacity: 1
name:
- opacity: 1
value: Rez-de-chaussée
- styles:
icon:
- opacity: 0.4
name:
- opacity: 0.4
operator: default
tap_action:
action: call-service
service: input_select.select_option
service_data:
entity_id: "[[[ return variables.input_select_name; ]]]"
option: Rez-de-chaussée
item3:
card:
type: custom:button-card
name: Etage
entity: "[[[ return variables.input_select_name; ]]]"
icon: mdi:home-floor-1
styles:
card:
- background-color: "rgba(0,0,0,0)"
- box-shadow: "none"
- padding: "0px"
icon:
- width: 30px
name:
- font-size: "0.8rem"
state:
- styles:
icon:
- opacity: 1
name:
- opacity: 1
value: Etage
- styles:
icon:
- opacity: 0.4
name:
- opacity: 0.4
operator: default
tap_action:
action: call-service
service: input_select.select_option
service_data:
entity_id: "[[[ return variables.input_select_name; ]]]"
option: Etage