Hello,
Je souhaite passer sur le thème Mushroom et j’avais fait pas mal de template récupérés et adaptés sur Minimalist:
Un exemple de template:
template
custom_card_cover:
tap_action:
action: more-info
triggers_update: all
icon: |
[[[
var icon = 'mdi:window-shutter';
if (states[variables.position_ouvert].state == 0){
var icon = 'mdi:window-shutter';
} else
var icon = 'mdi:window-shutter-open';
return icon ;
]]]
label: |-
[[[
var etat = "";
if (states[variables.position_ouvert].state == 100)
etat = 'Ouvert';
else if (states[variables.position_ouvert].state == 0)
etat = "Fermé";
else
etat = "Ouvert" + ' • ' + states[variables.position_ouvert].state + '%' ;
return etat ;
]]]
state:
- operator: template
value: |
[[[
return states[variables.position_ouvert].state != 0;
]]]
styles:
icon:
- color: "rgba(var(--color-blue),1)"
img_cell:
- background-color: "rgba(var(--color-blue),0.2)"
custom_card_cover_buttons:
variables:
entity: '[[[ return variables.entity ]]]'
name: '[[[ return variables.name ]]]'
styles:
card:
- border-radius: 20px
- box-shadow: var(--box-shadow)
- padding: 12px
grid:
- grid-template-areas: '"item1" "item2"'
- grid-template-columns: 1fr
- grid-template-rows: min-content min-content
- row-gap: 12px
custom_fields:
item1:
card:
entity: '[[[ return variables.entity ]]]'
name: '[[[ return variables.name ]]]'
variables:
position_ouvert: '[[[ return variables.position_ouvert ]]]'
tap_action:
action: none
template:
- icon_info
- custom_card_cover
type: custom:button-card
item2:
card:
template: list_4_items
type: custom:button-card
custom_fields:
item1:
card:
icon: mdi:arrow-up
tap_action:
action: call-service
service: cover.open_cover
service_data:
entity_id: '[[[ return variables.entity ]]]'
type: custom:button-card
template: widget_icon
item2:
card:
icon: mdi:pause
tap_action:
action: call-service
service: cover.stop_cover
service_data:
entity_id: '[[[ return variables.entity ]]]'
type: custom:button-card
template: widget_icon
item3:
card:
icon: mdi:menu
tap_action:
action: call-service
service: cover.set_cover_position
service_data:
entity_id: '[[[ return variables.entity ]]]'
position: '[[[ return variables.position ]]]'
type: custom:button-card
template: widget_icon
item4:
card:
icon: mdi:arrow-down
tap_action:
action: call-service
service: cover.close_cover
service_data:
entity_id: '[[[ return variables.entity ]]]'
type: custom:button-card
template: widget_icon
Et la card:
Card
- type: custom:button-card
template: custom_card_cover_buttons
variables:
entity: cover.volet_entree
position_ouvert: sensor.position_entree
name: Entrée
position: 84
Est-il possible de « transférer » c’est template minimalist vers mushroom?