
Voilà ce que ça donne avec une custom:button-card.
Il y a une carte avec deux custom_fields (un pour la zone Tomates1 et un pour la zone Tomates2)
Chacun de ces custom_fields est composé des éléments de base (nom, bordure, ombrage, couleur de fond, etc.) et de cinq custom_fields, un par bouton dans la zone (3 boutons ronds et 2 boutons rectangulaires). Tu peux ajouter une action sur chaque bouton.
Le code yaml de la carte fait 430 lignes car tout est paramètrable (les couleurs, la transparence des fond, la taille de chaque élément, etc.).
Si tu as des questions ou des difficultés à l’utiliser, n’hésite pas à demander.
Le code:
type: custom:button-card
name: Titre
custom_fields:
zone1:
card:
type: custom:button-card
name: Tomates1
custom_fields:
zone1bouton1:
card:
type: custom:button-card
icon: mdi:power-on
show_icon: true
styles:
card:
- background-color: rgba(32,32,32,1.0)
- border-radius: 50%
- border: 1px solid rgba(52,52,52,1.0)
- width: 50px
- height: 50px
icon:
- color: rgba(111,111,111,1.0)
- width: 60%
tap_action:
action: none
hold_action:
action: none
zone1bouton2:
card:
type: custom:button-card
icon: mdi:power-off
show_icon: true
styles:
card:
- background-color: rgba(17,17,17,1.0)
- border-radius: 50%
- border: 1px solid rgba(52,52,52,1.0)
- width: 50px
- height: 50px
icon:
- color: rgba(244,67,54,1.0)
- width: 60%
tap_action:
action: none
hold_action:
action: none
zone1bouton3:
card:
type: custom:button-card
icon: mdi:water-sync
show_icon: true
styles:
card:
- background-color: rgba(32,32,32,1.0)
- border-radius: 50%
- border: 1px solid rgba(52,52,52,1.0)
- width: 50px
- height: 50px
icon:
- color: rgba(111,111,111,1.0)
- width: 60%
tap_action:
action: none
hold_action:
action: none
zone1bouton4:
card:
type: custom:button-card
layout: icon_name_state2nd
name: Durée
label: 0 minutes
icon: mdi:ray-vertex
show_icon: true
show_label: true
custom_fields:
fond_icone:
card:
type: custom:button-card
aspect_ratio: 1/1
styles:
card:
- background-color: rgba(30,53,72,1.0)
- width: 54px
- height: 54px
- border-radius: 50%
styles:
card:
- background-color: rgba(32,32,32,1.0)
- border-radius: 10px
- border: 1px solid rgba(52,52,52,1.0)
- width: 200px
- height: 70px
name:
- color: rgba(255,255,255,0.8)
- justify-self: start
- font-size: 1.0em
label:
- color: rgba(255,255,255,0.8)
- justify-self: start
- font-size: 0.8em
- padding-top: 7px
icon:
- color: rgba(33,150,243,1.0)
- border-radius: 50%
- z-index: 1
custom_fields:
fond_icone:
- position: absolute
- left: 11px
- top: 7px
- z-index: 0
tap_action:
action: none
hold_action:
action: none
zone1bouton5:
card:
type: custom:button-card
layout: icon_name_state2nd
name: minuteur
label: inactif
icon: mdi:timer-outline
show_icon: true
show_label: true
custom_fields:
fond_icone:
card:
type: custom:button-card
aspect_ratio: 1/1
styles:
card:
- background-color: rgba(30,53,72,1.0)
- width: 54px
- height: 54px
- border-radius: 50%
styles:
card:
- background-color: rgba(32,32,32,1.0)
- border-radius: 10px
- border: 1px solid rgba(52,52,52,1.0)
- width: 200px
- height: 70px
name:
- color: rgba(255,255,255,0.8)
- justify-self: start
- font-size: 1.0em
label:
- color: rgba(255,255,255,0.8)
- justify-self: start
- font-size: 0.8em
- padding-top: 7px
icon:
- color: rgba(33,150,243,1.0)
- border-radius: 50%
- z-index: 1
custom_fields:
fond_icone:
- position: absolute
- left: 11px
- top: 7px
- z-index: 0
tap_action:
action: none
hold_action:
action: none
styles:
name:
- font-size: 0.9em
- justify-self: start
- align-self: start
- padding-left: 10px
- color: rgba(255,255,255,1.0)
card:
- background-color: rgba(17,17,17,1.0)
- box-shadow: 4px 4px 4px 0px rgba(32,32,32,0.5)
- border: 1px rgba(211,211,211,1.0) outset
- width: 420px
- height: 180px
custom_fields:
zone1bouton1:
- position: absolute
- top: 45px
- left: 120px
zone1bouton2:
- position: absolute
- top: 45px
- left: 185px
zone1bouton3:
- position: absolute
- top: 45px
- left: 250px
zone1bouton4:
- position: absolute
- top: 104px
- left: 5px
zone1bouton5:
- position: absolute
- top: 104px
- left: 213px
tap_action:
action: none
hold_action:
action: none
zone2:
card:
type: custom:button-card
name: Tomates2
custom_fields:
zone2bouton1:
card:
type: custom:button-card
icon: mdi:power-on
show_icon: true
styles:
card:
- background-color: rgba(32,32,32,1.0)
- border-radius: 50%
- border: 1px solid rgba(52,52,52,1.0)
- width: 50px
- height: 50px
icon:
- color: rgba(111,111,111,1.0)
- width: 60%
tap_action:
action: none
hold_action:
action: none
zone2bouton2:
card:
type: custom:button-card
icon: mdi:power-off
show_icon: true
styles:
card:
- background-color: rgba(17,17,17,1.0)
- border-radius: 50%
- border: 1px solid rgba(52,52,52,1.0)
- width: 50px
- height: 50px
icon:
- color: rgba(244,67,54,1.0)
- width: 60%
tap_action:
action: none
hold_action:
action: none
zone2bouton3:
card:
type: custom:button-card
icon: mdi:water-sync
show_icon: true
styles:
card:
- background-color: rgba(32,32,32,1.0)
- border-radius: 50%
- border: 1px solid rgba(52,52,52,1.0)
- width: 50px
- height: 50px
icon:
- color: rgba(111,111,111,1.0)
- width: 60%
tap_action:
action: none
hold_action:
action: none
zone2bouton4:
card:
type: custom:button-card
layout: icon_name_state2nd
name: Durée
label: 0 minutes
icon: mdi:ray-vertex
show_icon: true
show_label: true
custom_fields:
fond_icone:
card:
type: custom:button-card
aspect_ratio: 1/1
styles:
card:
- background-color: rgba(30,53,72,1.0)
- width: 54px
- height: 54px
- border-radius: 50%
styles:
card:
- background-color: rgba(32,32,32,1.0)
- border-radius: 10px
- border: 1px solid rgba(52,52,52,1.0)
- width: 200px
- height: 70px
name:
- color: rgba(255,255,255,0.8)
- justify-self: start
- font-size: 1.0em
label:
- color: rgba(255,255,255,0.8)
- justify-self: start
- font-size: 0.8em
- padding-top: 7px
icon:
- color: rgba(33,150,243,1.0)
- border-radius: 50%
- z-index: 1
custom_fields:
fond_icone:
- position: absolute
- left: 11px
- top: 7px
- z-index: 0
tap_action:
action: none
hold_action:
action: none
zone2bouton5:
card:
type: custom:button-card
layout: icon_name_state2nd
name: minuteur
label: inactif
icon: mdi:timer-outline
show_icon: true
show_label: true
custom_fields:
fond_icone:
card:
type: custom:button-card
aspect_ratio: 1/1
styles:
card:
- background-color: rgba(30,53,72,1.0)
- width: 54px
- height: 54px
- border-radius: 50%
styles:
card:
- background-color: rgba(32,32,32,1.0)
- border-radius: 10px
- border: 1px solid rgba(52,52,52,1.0)
- width: 200px
- height: 70px
name:
- color: rgba(255,255,255,0.8)
- justify-self: start
- font-size: 1.0em
label:
- color: rgba(255,255,255,0.8)
- justify-self: start
- font-size: 0.8em
- padding-top: 7px
icon:
- color: rgba(33,150,243,1.0)
- border-radius: 50%
- z-index: 1
custom_fields:
fond_icone:
- position: absolute
- left: 11px
- top: 7px
- z-index: 0
tap_action:
action: none
hold_action:
action: none
styles:
name:
- font-size: 0.9em
- justify-self: start
- align-self: start
- padding-left: 10px
- color: rgba(255,255,255,1.0)
card:
- background-color: rgba(17,17,17,1.0)
- box-shadow: 4px 4px 4px 0px rgba(32,32,32,0.5)
- border: 1px rgba(211,211,211,1.0) outset
- width: 420px
- height: 180px
custom_fields:
zone2bouton1:
- position: absolute
- top: 45px
- left: 120px
zone2bouton2:
- position: absolute
- top: 45px
- left: 185px
zone2bouton3:
- position: absolute
- top: 45px
- left: 250px
zone2bouton4:
- position: absolute
- top: 104px
- left: 5px
zone2bouton5:
- position: absolute
- top: 104px
- left: 213px
tap_action:
action: none
hold_action:
action: none
tap_action:
action: none
hold_action:
action: none
styles:
card:
- box-shadow: 0px 0px 5px 1px
- background-color: rgba(32,32,32,0.9)
- border: 1px rgba(211,211,211,1.0) outset
- width: 443px
- height: 443px
name:
- font-size: 1.4em
- color: rgba(255,255,255,1.0)
- align-self: start
- justify-self: start
- padding-top: 0px
- padding-left: 20px
custom_fields:
zone1:
- position: absolute
- top: 60px
- left: 10px
zone2:
- position: absolute
- top: 250px
- left: 10px