Salut 
Je reviens donner des nouvelles 
J’ai commencé hier soir à revoir mes cartes de prises électriques.
Et bien que la politique de bubble card n’est pas fameuse, je vais quand même continuer à les utiliser 
Ce que je voulais avec la carte burton-card c’était le verrouillage contre le clic accidentel.
La bubble card ne permet pas de le faire mais je peux avoir une invite de confirmation qui me permet d’éviter les clic accidentel :
Bon jusque là, ça va.
Mais pour auto-entities… 
Quelqu’un sait quel est la variable qui contient l’entité en cours quand on utilise autoentities ?
Car avec ça, je devrais pouvoir adapter le code 
D’ailleurs voici ce que j’ai :
Code YAML
type: custom:bubble-card
card_type: button
button_type: switch
entity: switch.smartplug_bureau
tap_action:
confirmation:
text: Allumer/Éteindre la prise ?
action: toggle
target:
entity_id: switch.smartplug_bureau
show_state: false
button_action:
tap_action:
confirmation:
text: Allumer/Éteindre la prise ?
action: toggle
target:
entity_id: switch.smartplug_bureau
show_state: false
double_tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
hold_action:
action: none
icon: mdi:power-socket-fr
force_icon: false
show_state: true
show_last_changed: true
show_last_updated: false
sub_button:
- entity: sensor.smartplug_bureau_power
name: Puissance
show_name: true
show_state: true
show_last_changed: false
show_attribute: false
show_background: true
state_background: false
visibility:
- condition: state
entity: switch.smartplug_bureau
state: "on"
modules:
- "!default"
card_layout: large
grid_options:
rows: auto
columns: 12
get_state_attribute:
- entity: sensor.smartplug_bureau_power
flat_style:
card_styles:
prime_color:
- 25
- 23
- 140
icon_container_color:
color: accent
bubble_chips:
gap: 30
justify-content: space-evenly
izequbes_custom_colors:
main_icon:
background_color: dark-grey
icon_color: teal
icon_opacity: 0.9
subbutton_colors:
subbutton1:
color: brown
visual_styling_center:
height_multiplier: 2.1
inner_padding: 8
icon_vertical_margin: -4
styles: |
.bubble-button-background {
background-color: ${ hass.states['switch.smartplug_bureau'].state === 'on'
? 'rgba(0, 255, 255, 0.35)'
: hass.states['switch.smartplug_bureau'].state === 'off'
? 'rgba(30, 30, 30, 0.35)'
: 'rgba(200, 200, 200, 0.35)'
} !important;
}
.bubble-icon-container{
opacity: 0.8 !important;
background-color: rgba(0, 0, 0) !important;
}
.bubble-icon {
color:
${ hass.states['switch.smartplug_bureau'].state === 'on'
? 'rgba(0, 255, 255, 0.55)'
: hass.states['switch.smartplug_bureau'].state === 'off'
? 'rgba(30, 30, 30, 0.55)'
: 'rgba(200, 200, 200, 0.55)'
} !important;
}
.bubble-sub-button-1 > ha-icon {
color:
${hass.states['sensor.smartplug_bureau_power'].state > 110
? 'rgb(255, 0, 212)'
: hass.states['sensor.smartplug_bureau_power'].state > 100
? 'rgb(255, 0, 0)'
: hass.states['sensor.smartplug_bureau_power'].state > 90
? 'rgb(252, 152, 3)'
: hass.states['sensor.smartplug_bureau_power'].state > 80
? 'rgb(255, 255, 0)'
: hass.states['sensor.smartplug_bureau_power'].state > 60
? 'rgb(87, 255, 0)'
: hass.states['sensor.smartplug_bureau_power'].state > 40
? 'rgb(0, 255, 127)'
: hass.states['sensor.smartplug_bureau_power'].state > 20
? 'rgb(0, 203, 255)'
: hass.states['sensor.smartplug_bureau_power'].state > 10
? 'rgb(0, 77, 255)'
: hass.states['sensor.smartplug_bureau_power'].state > 0
? 'rgb(0, 0, 255)'
: 'rgb(145, 145, 145)'
} !important;
}
.bubble-sub-button-1 {
opacity: 0.8 !important;
background-color: rgb(0, 0, 0) !important;
font-weight: bold;
color:
${hass.states['sensor.smartplug_bureau_power'].state > 110
? 'rgb(255, 0, 212)'
: hass.states['sensor.smartplug_bureau_power'].state > 100
? 'rgb(255, 0, 0)'
: hass.states['sensor.smartplug_bureau_power'].state > 90
? 'rgb(252, 152, 3)'
: hass.states['sensor.smartplug_bureau_power'].state > 80
? 'rgb(255, 255, 0)'
: hass.states['sensor.smartplug_bureau_power'].state > 60
? 'rgb(87, 255, 0)'
: hass.states['sensor.smartplug_bureau_power'].state > 40
? 'rgb(0, 255, 127)'
: hass.states['sensor.smartplug_bureau_power'].state > 20
? 'rgb(0, 203, 255)'
: hass.states['sensor.smartplug_bureau_power'].state > 10
? 'rgb(0, 77, 255)'
: hass.states['sensor.smartplug_bureau_power'].state > 0
? 'rgb(0, 0, 255)'
: 'rgb(145, 145, 145)'
} !important;
}
J’ai donc un changement de couleur du texte du sous-bouton ainsi que son icône quand la puissance prend des valeurs particulière.
Sachant sur la prise est nommée switch.smartplug_bureau
et l’entité de sa puissance est sensor.smartplug_bureau_power
.
Vous pensez que c’est possible de faire du auto-entites ?
Le decluttering-card c’est un peu complexe pour moi…