[Article] Un beau dashboard, tout simplement

Bonjour,

Je suis partie dans la même philosophie que vous, j’ai beaucoup joué avec les card_mod, je suis revenu à tuile et mushroom quasi sans card_mod. J’ai encore des cartes bien empilées mais assez maintenable. Les templates mushroom sont quand-même top. La dernière évolution à moitié en UI est très appréciable.

J’ai quand-même celle-ci qui mélange de tout :blush:

Code
type: vertical-stack
cards:
  - type: custom:vertical-stack-in-card
    cards:
      - type: heading
        icon: mdi:bed-double
        heading: Parents
        heading_style: title
        badges:
          - type: entity
            show_state: true
            show_icon: true
            entity: sensor.valve_parents_battery
            color: blue
            tap_action:
              action: more-info
          - type: entity
            show_state: true
            show_icon: true
            entity: number.valve_parents_valve_opening_degree
            icon: mdi:valve-open
            color: green
            tap_action:
              action: more-info
          - type: entity
            show_state: false
            show_icon: true
            entity: binary_sensor.valve_parents_running
            color: red
            tap_action:
              action: more-info
          - type: entity
            show_state: true
            show_icon: true
            entity: climate.valve_parents
            state_content: temperature
            icon: mdi:target
            color: orange
      - type: custom:mini-graph-card
        entities:
          - entity: sensor.sonde_parents_temperature
            name: Température
            state_adaptive_color: true
          - entity: climate.valve_parents
            name: Temp
            attribute: current_temperature
            unit: °C
            state_adaptive_color: true
            show_graph: false
            show_state: true
        hour24: true
        hours_to_show: 24
        points_per_hour: 2
        font_size: 50
        show:
          name: false
          icon: false
          legend: false
          labels: true
          extrema: false
        color_thresholds:
          - color: "#33ccff"
            value: 19
          - color: "#00ffff"
            value: 19.5
          - color: "#33ffcc"
            value: 20
          - color: "#00ff99"
            value: 20.5
          - color: "#ffff99"
            value: 21
          - color: "#ffff33"
            value: 21.5
          - color: "#ff9933"
            value: 22
          - color: "#cc6633"
            value: 24
          - color: "#ff6000"
            value: 26
      - type: custom:stack-in-card
        mode: horizontal
        cards:
          - type: custom:button-card
            name: Conf.
            entity: climate.versatile_parents
            show_state: false
            show_icon: true
            show_name: false
            icon: mdi:fire
            size: 80%
            styles:
              icon:
                - color: |
                    [[[
                      if (states['climate.versatile_parents']) {
                      if (states['climate.versatile_parents'].attributes.preset_mode == 'comfort')
                        return 'darkorange';
                      else
                        return 'white'; }
                    ]]]
              name:
                - color: white
                - font-size: 60%
              card:
                - height: 40px
                - width: 30px
            tap_action:
              action: perform-action
              perform_action: climate.set_preset_mode
              target:
                entity_id:
                  - climate.versatile_parents
              data:
                preset_mode: comfort
          - type: custom:button-card
            name: Eco
            entity: climate.versatile_parents
            show_state: false
            show_icon: true
            show_name: false
            icon: mdi:leaf
            size: 80%
            styles:
              icon:
                - color: |
                    [[[
                      if (states['climate.versatile_parents']) {
                      if (states['climate.versatile_parents'].attributes.preset_mode == 'eco')
                        return 'lightgreen';
                      else
                        return 'white'; }
                    ]]]
              name:
                - color: white
                - font-size: 60%
              card:
                - height: 40px
                - width: 30px
            tap_action:
              action: perform-action
              perform_action: climate.set_preset_mode
              target:
                entity_id:
                  - climate.versatile_parents
              data:
                preset_mode: eco
          - type: custom:button-card
            name: Manu
            entity: climate.versatile_parents
            show_state: false
            show_icon: true
            show_name: false
            icon: mdi:hand-back-left
            size: 80%
            styles:
              icon:
                - color: |
                    [[[
                      if (states['climate.versatile_parents']) {
                      if (states['climate.versatile_parents'].attributes.preset_mode == 'none')
                        return 'indianred';
                      else
                        return 'white'; }
                    ]]]
              name:
                - color: white
                - font-size: 60%
              card:
                - height: 40px
                - width: 30px
            tap_action:
              action: perform-action
              perform_action: climate.set_preset_mode
              target:
                entity_id:
                  - climate.versatile_parents
              data:
                preset_mode: none
          - type: custom:button-card
            name: Abs.
            entity: climate.versatile_parents
            show_state: false
            show_icon: true
            show_name: false
            icon: mdi:snowflake
            size: 80%
            styles:
              icon:
                - color: |
                    [[[
                      if (states['climate.versatile_parents']) {
                      if (states['climate.versatile_parents'].attributes.preset_mode == 'frost')
                        return 'skyblue';
                      else
                        return 'white'; }
                    ]]]
              name:
                - color: white
                - font-size: 60%
              card:
                - height: 40px
                - width: 30px
            tap_action:
              action: perform-action
              perform_action: climate.set_preset_mode
              target:
                entity_id:
                  - climate.versatile_parents
              data:
                preset_mode: frost
          - type: custom:button-card
            name: Boost
            entity: climate.versatile_parents
            show_state: false
            show_icon: true
            show_name: false
            icon: mdi:rocket-launch
            size: 80%
            styles:
              icon:
                - color: |
                    [[[
                      if (states['climate.versatile_parents']) {
                      if (states['climate.versatile_parents'].attributes.preset_mode == 'boost')
                        return 'red';
                      else
                        return 'white'; }
                    ]]]
              name:
                - color: white
                - font-size: 60%
              card:
                - height: 40px
                - width: 30px
            tap_action:
              action: perform-action
              perform_action: climate.set_preset_mode
              target:
                entity_id:
                  - climate.versatile_parents
              data:
                preset_mode: boost
      - type: custom:mushroom-climate-card
        entity: climate.versatile_parents
        name: Radiateur
        primary_info: state
        secondary_info: last-updated
        show_temperature_control: true
        fill_container: false
        collapsible_controls: false
        tap_action:
          action: more-info
        layout: horizontal
        card_mod:
          style:
            mushroom-shape-icon$: |
              .shape {
                box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.36) !important;
                {% set state = states('number.valve_parents_valve_opening_degree') %}
                {% if is_number(state) and state | float > 0 %}
                {% else %}
                  --shape-color: transparent !important;
                {% endif %}       
              }
            .: |
              ha-state-icon {
                {% set state = states('number.valve_parents_valve_opening_degree') %}
                {% if is_number(state) and state | float > 0 %}
                  color: deep-orange;
                  --card-mod-icon: mdi:radiator;
                {% else %}
                  color: grey;
                  --card-mod-icon: mdi:radiator-off;
                {% endif %}
              }

5 « J'aime »