Dashboard - 🌻 Minimalist

Sans optimiser le code, voici 2 nouvelles cartes que j’utilise.

image

image

#templates
button_card_templates:
  list_items_1:
    styles:
      card:
        - box-shadow: none
        - padding: 0px
      grid:
        - grid-template-areas: '"item1"'
        - grid-template-columns: 1fr
        - grid-template-rows: min-content
        - column-gap: 7px
  garage_button:
    variables:
      entity: binary_sensor.default
      name: Default name
      icon: mdi:home
      entity_command: input_boolean.default
    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 ]]]'
          tap_action:
            action: more-info
          template:
            - icon_info
            - ouverture
          state:
            - icon: mdi:garage-open-variant
              value: 'on'
              id: 'on'
              label: Ouvert
            - icon: mdi:garage-variant
              value: 'off'
              id: 'off'
              label: Fermé
          type: custom:button-card
      item2:
        card:
          template: list_items_1
          type: custom:button-card
          custom_fields:
            item1:
              card:
                icon: '[[[ return variables.icon ]]]'
                tap_action:
                  action: call-service
                  service: input_boolean.turn_on
                  service_data:
                    entity_id: '[[[ return variables.entity_command ]]]'
                type: custom:button-card
                template: widget_icon
  portail_close_button:
    variables:
      entity: binary_sensor.default
      name: Default name
      icon: mdi:home
      entity_command: input_boolean.default
    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 ]]]'
          tap_action:
            action: more-info
          template:
            - icon_info
            - ouverture
          state:
            - icon: mdi:gate-open
              value: 'on'
              id: 'on'
              label: Ouvert
            - icon: mdi:gate
              value: 'off'
              id: 'off'
              label: Fermé
          type: custom:button-card
      item2:
        card:
          template: list_items_1
          type: custom:button-card
          custom_fields:
            item1:
              card:
                icon: mdi:arrow-left-bold
                tap_action:
                  action: call-service
                  service: input_boolean.turn_on
                  service_data:
                    entity_id: '[[[ return variables.entity_command ]]]'
                type: custom:button-card
                template: widget_icon
  list_items_2:
    styles:
      card:
        - box-shadow: none
        - padding: 0px
      grid:
        - grid-template-areas: '"item1 item2"'
        - grid-template-columns: 1fr 1fr
        - grid-template-rows: min-content
        - column-gap: 7px
  portail_button:
    variables:
      entity_pieton: input_boolean.default
      entity_voiture: input_boolean.default
      name: Default 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 ]]]'
          tap_action:
            action: more-info
          template:
            - icon_info
            - ouverture
          state:
            - icon: mdi:gate-open
              value: 'on'
              id: 'on'
              label: Ouvert
            - icon: mdi:gate
              value: 'off'
              id: 'off'
              label: Fermé
          type: custom:button-card
      item2:
        card:
          template: list_items_2
          type: custom:button-card
          custom_fields:
            item1:
              card:
                icon: mdi:run
                tap_action:
                  action: call-service
                  service: input_boolean.turn_on
                  service_data:
                    entity_id: '[[[ return variables.entity_pieton ]]]'
                type: custom:button-card
                template: widget_icon
            item2:
              card:
                icon: mdi:car
                tap_action:
                  action: call-service
                  service: input_boolean.turn_on
                  service_data:
                    entity_id: '[[[ return variables.entity_voiture ]]]'
                type: custom:button-card
                template: widget_icon
#cards
type: grid
cards:
  - type: horizontal-stack
    cards:
      - type: conditional
        conditions:
          - entity: binary_sensor.door_012
            state: 'off'
        card:
          type: custom:button-card
          variables:
            entity: binary_sensor.door_012
            entity_pieton: input_boolean.portail_pieton_command
            entity_voiture: input_boolean.portail_voiture_command
            name: Portail
          template:
            - portail_button
      - type: conditional
        conditions:
          - entity: binary_sensor.door_012
            state: 'on'
        card:
          type: custom:button-card
          variables:
            entity: binary_sensor.door_012
            entity_command: input_boolean.portail_pieton_command
            name: Portail
          template:
            - portail_close_button
  - type: horizontal-stack
    cards:
      - type: conditional
        conditions:
          - entity: binary_sensor.porte_du_garage
            state: 'off'
        card:
          type: custom:button-card
          variables:
            entity: binary_sensor.porte_du_garage
            entity_command: input_boolean.garage_command
            name: Garage
            icon: mdi:arrow-up-bold
          template:
            - garage_button
      - type: conditional
        conditions:
          - entity: binary_sensor.porte_du_garage
            state: 'on'
        card:
          type: custom:button-card
          variables:
            entity: binary_sensor.porte_du_garage
            entity_command: input_boolean.garage_command
            name: Garage
            icon: mdi:arrow-down-bold
          template:
            - garage_button
columns: 2
square: false

détecteur de fumée

#card:
entity: binary_sensor.smoke_sensor_salon
type: custom:button-card
template:
  - icon_info_bg
  - ouverture
name: Salon
state:
  - icon: mdi:fire
    value: 'on'
    id: 'on'
    label: Incendie !
  - icon: mdi:shield-check
    value: 'off'
    id: 'off'
    label: RAS

Toujours avec l’utilisation des id / Always with id key :

#template
  ouverture:
    template:
      - rouge_on
      - vert_off
    state:
      - label: Ouvert(e)
        id: 'on'
        value: 'on'
      - label: Fermé(e)
        id: 'off'
        value: 'off'