Comment répartir 2 cartes sur une même colonne?

Bonjour,

Sur la base de la discussion et de la carte partagée par @LeLapinFou (Pollens custom component sensor - #226 par LeLapinFou), je suis en train d’essayer de me faire ma propre carte et qui pour le moment ressemble à cela:
image
J’aimerai pouvoir utiliser les 2/3 de la colonne pour la jauge et le reste pour les boutons (button card). Quelle serait la meilleure approche pour réaliser cela ?

Merci !!!

The carte
type: horizontal-stack
cards:
  - type: gauge
    entity: sensor.pollens_91_risklevel
    needle: true
    min: -0.5
    max: 3.5
    segments:
      - from: -0.5
        color: '#43a047'
      - from: 0.5
        color: '#63d087'
      - from: 1.5
        color: '#ff781f'
      - from: 2.5
        color: '#ff2200'
    name: Alerte niveau Pollens
  - square: false
    type: grid
    columns: 1
    cards:
      - type: custom:button-card
        custom_fields:
          numitems:
            card:
              type: custom:button-card
              name: nb
              show_icon: false
              show_state: true
              show_name: true
              entity: sensor.nombre_pollens_herbe_sup_0
              styles:
                name:
                  - font-size: 0.5em
                  - color: rgba(178,190,181,0.6)
                state:
                  - font-size: 0.5em
                  - color: rgba(255,255,255,0.6)
              tap_action:
                action: none
              hold_action:
                action: none
        styles:
          card:
            - background: none
            - border-radius: 0
          custom_fields:
            numitems:
              - position: absolute
              - left: 65%
              - top: 10%
        entity: sensor.nombre_pollens_herbe_on
        show_entity_picture: true
        show_icon: false
        show_label: false
        show_state: false
        show_name: false
        state:
          - value: 0
            entity_picture: /local/images/pollens/pollen_grass_01.png
          - value: 1
            entity_picture: /local/images/pollens/pollen_grass_02.png
          - value: 2
            entity_picture: /local/images/pollens/pollen_grass_03.png
          - value: 3
            entity_picture: /local/images/pollens/pollen_grass_04.png
        size: 35px
        tap_action:
          action: fire-dom-event
          browser_mod:
            service: browser_mod.popup
            deviceID:
              - this
              - dashboard
            data:
              title: Pollen Plante
              content:
                type: grid
                columns: 1
                square: false
                cards:
                  - type: grid
                    columns: 4
                    square: false
                    cards:
                      - type: custom:button-card
                        entity: sensor.pollens_91_ambroisies
                        name: ambroisies
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_weed_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_weed_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_weed_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_weed_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_oseille
                        name: oseille
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_weed_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_weed_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_weed_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_weed_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_urticacees
                        name: urticacees
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_weed_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_weed_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_weed_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_weed_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_cupressacees
                        name: cupressacees
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_weed_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_weed_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_weed_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_weed_04.png
                        tap_action:
                          action: none
        hold_action:
          action: none
      - type: custom:button-card
        custom_fields:
          numitems:
            card:
              type: custom:button-card
              name: nb
              show_icon: false
              show_state: true
              show_name: true
              entity: sensor.nombre_pollens_plante_sup_0
              styles:
                name:
                  - font-size: 0.5em
                  - color: rgba(178,190,181,0.6)
                state:
                  - font-size: 0.5em
                  - color: rgba(255,255,255,0.6)
              tap_action:
                action: none
              hold_action:
                action: none
        styles:
          card:
            - background: none
            - border-radius: 0
          custom_fields:
            numitems:
              - position: absolute
              - left: 65%
              - top: 10%
        entity: sensor.nombre_pollens_plante_on
        show_entity_picture: true
        show_icon: false
        show_label: false
        show_state: false
        show_name: false
        state:
          - value: 0
            entity_picture: /local/images/pollens/pollen_weed_01.png
          - value: 1
            entity_picture: /local/images/pollens/pollen_weed_02.png
          - value: 2
            entity_picture: /local/images/pollens/pollen_weed_03.png
          - value: 3
            entity_picture: /local/images/pollens/pollen_weed_04.png
        size: 35px
        tap_action:
          action: fire-dom-event
          browser_mod:
            service: browser_mod.popup
            deviceID:
              - this
              - dashboard
            data:
              title: Pollen Herbe
              content:
                type: grid
                columns: 1
                square: false
                cards:
                  - type: grid
                    columns: 3
                    square: false
                    cards:
                      - type: custom:button-card
                        entity: sensor.pollens_91_armoise
                        name: armoise
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_grass_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_grass_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_grass_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_grass_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_graminees
                        name: graminees
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_grass_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_grass_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_grass_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_grass_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_plantain
                        name: plantain
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_grass_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_grass_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_grass_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_grass_04.png
                        tap_action:
                          action: none
        hold_action:
          action: none
      - type: custom:button-card
        custom_fields:
          numitems:
            card:
              type: custom:button-card
              name: nb
              show_icon: false
              show_state: true
              show_name: true
              entity: sensor.nombre_pollens_arbres_sup_0
              styles:
                name:
                  - font-size: 0.5em
                  - color: rgba(178,190,181,0.6)
                state:
                  - font-size: 0.5em
                  - color: rgba(255,255,255,0.6)
              tap_action:
                action: none
              hold_action:
                action: none
        styles:
          card:
            - background: none
            - border-radius: 0
          custom_fields:
            numitems:
              - position: absolute
              - left: 65%
              - top: 10%
        entity: sensor.nombre_pollens_arbre_on
        show_entity_picture: true
        show_icon: false
        show_label: false
        show_state: false
        show_name: false
        state:
          - value: 0
            entity_picture: /local/images/pollens/pollen_tree_01.png
          - value: 1
            entity_picture: /local/images/pollens/pollen_tree_02.png
          - value: 2
            entity_picture: /local/images/pollens/pollen_tree_03.png
          - value: 3
            entity_picture: /local/images/pollens/pollen_tree_04.png
        size: 35px
        tap_action:
          action: fire-dom-event
          browser_mod:
            service: browser_mod.popup
            deviceID:
              - this
              - dashboard
            data:
              title: Pollen Arbre
              content:
                type: grid
                columns: 1
                square: false
                cards:
                  - type: grid
                    columns: 3
                    square: false
                    cards:
                      - type: custom:button-card
                        entity: sensor.pollens_91_bouleau
                        name: bouleau
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_platane
                        name: platane
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_tilleul
                        name: tilleul
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_peuplier
                        name: peuplier
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_noisetier
                        name: noisetier
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_olivier
                        name: olivier
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_chataignier
                        name: chataignier
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_frene
                        name: frene
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_chene
                        name: chene
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_aulne
                        name: aulne
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_saule
                        name: saule
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_charme
                        name: charme
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
        hold_action:
          action: none

Salut,
ta c’est carte qui conviendrais GitHub - thomasloven/lovelace-layout-card: 🔹 Get more control over the placement of lovelace cards.

tu trouvera des exemples sur le forum anglais 🔹 Layout-card - Take control of where your cards end up - Dashboards & Frontend - Home Assistant Community

1 « J'aime »

Top et Merci !
Voici le résultat :

J’ai aussi créé 3 templates (i.e. sensor.nombre_pollens_herbe_sup_0…) qui utilisent cette formulation pour compter le nbre de types de pollens > 0 :

{{(expand(states.sensor.nombre_pollens_arbre_on) | selectattr( 'state', '>', '0') | list | count) | int}}
The Code
type: custom:layout-card
layout_type: custom:grid-layout
layout:
  grid-template-columns: 320px 80px
  grid-template-rows: auto
  grid-template-areas: |
    "sidebar1  room1"
cards:
  - type: gauge
    entity: sensor.pollens_91_risklevel
    needle: true
    min: -0.5
    max: 3.5
    segments:
      - from: -0.5
        color: '#43a047'
      - from: 0.5
        color: '#63d087'
      - from: 1.5
        color: '#ff781f'
      - from: 2.5
        color: '#ff2200'
    name: Niveau Pollens
    view_layout:
      grid-area: sidebar1
  - square: false
    type: grid
    columns: 1
    cards:
      - type: custom:button-card
        custom_fields:
          numitems:
            card:
              type: custom:button-card
              label: |
                [[[
                  var bri = states['sensor.nombre_pollens_herbe_sup_0'].state;
                  return '(' + (bri ? bri : '0') + ')';
                ]]]
              show_icon: false
              show_state: false
              show_name: false
              show_label: true
              entity: sensor.nombre_pollens_herbe_sup_0
              styles:
                label:
                  - font-size: 0.6em
                  - color: rgba(178,190,181,0.6)
              tap_action:
                action: none
              hold_action:
                action: none
        styles:
          card:
            - background: none
            - border-radius: 0
            - border: 0
          custom_fields:
            numitems:
              - position: absolute
              - left: 75%
              - top: 10%
        entity: sensor.nombre_pollens_herbe_on
        show_entity_picture: true
        show_icon: false
        show_label: false
        show_state: false
        show_name: false
        state:
          - value: 0
            entity_picture: /local/images/pollens/pollen_grass_01.png
          - value: 1
            entity_picture: /local/images/pollens/pollen_grass_02.png
          - value: 2
            entity_picture: /local/images/pollens/pollen_grass_03.png
          - value: 3
            entity_picture: /local/images/pollens/pollen_grass_04.png
        size: 45px
        tap_action:
          action: fire-dom-event
          browser_mod:
            service: browser_mod.popup
            deviceID:
              - this
              - dashboard
            data:
              title: Pollen Plante
              content:
                type: grid
                columns: 1
                square: false
                cards:
                  - type: grid
                    columns: 4
                    square: false
                    cards:
                      - type: custom:button-card
                        entity: sensor.pollens_91_ambroisies
                        name: ambroisies
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_weed_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_weed_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_weed_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_weed_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_oseille
                        name: oseille
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_weed_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_weed_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_weed_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_weed_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_urticacees
                        name: urticacees
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_weed_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_weed_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_weed_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_weed_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_cupressacees
                        name: cupressacees
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_weed_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_weed_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_weed_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_weed_04.png
                        tap_action:
                          action: none
        hold_action:
          action: none
      - type: custom:button-card
        custom_fields:
          numitems:
            card:
              type: custom:button-card
              label: |
                [[[
                  var bri = states['sensor.nombre_pollens_plante_sup_0'].state;
                  return '(' + (bri ? bri : '0') + ')';
                ]]]
              show_icon: false
              show_state: false
              show_name: false
              show_label: true
              entity: sensor.nombre_pollens_plante_sup_0
              styles:
                label:
                  - font-size: 0.6em
                  - color: rgba(178,190,181,0.6)
              tap_action:
                action: none
              hold_action:
                action: none
        styles:
          card:
            - background: none
            - border-radius: 0
            - border: 0
          custom_fields:
            numitems:
              - position: absolute
              - left: 75%
              - top: 10%
        entity: sensor.nombre_pollens_plante_on
        show_entity_picture: true
        show_icon: false
        show_label: false
        show_state: false
        show_name: false
        state:
          - value: 0
            entity_picture: /local/images/pollens/pollen_weed_01.png
          - value: 1
            entity_picture: /local/images/pollens/pollen_weed_02.png
          - value: 2
            entity_picture: /local/images/pollens/pollen_weed_03.png
          - value: 3
            entity_picture: /local/images/pollens/pollen_weed_04.png
        size: 45px
        tap_action:
          action: fire-dom-event
          browser_mod:
            service: browser_mod.popup
            deviceID:
              - this
              - dashboard
            data:
              title: Pollen Herbe
              content:
                type: grid
                columns: 1
                square: false
                cards:
                  - type: grid
                    columns: 3
                    square: false
                    cards:
                      - type: custom:button-card
                        entity: sensor.pollens_91_armoise
                        name: armoise
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_grass_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_grass_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_grass_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_grass_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_graminees
                        name: graminees
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_grass_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_grass_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_grass_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_grass_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_plantain
                        name: plantain
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_grass_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_grass_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_grass_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_grass_04.png
                        tap_action:
                          action: none
        hold_action:
          action: none
      - type: custom:button-card
        custom_fields:
          numitems:
            card:
              type: custom:button-card
              label: |
                [[[
                  var bri = states['sensor.nombre_pollens_arbres_sup_0'].state;
                  return '(' + (bri ? bri : '0') + ')';
                ]]]
              show_icon: false
              show_state: false
              show_name: false
              show_label: true
              entity: sensor.nombre_pollens_arbres_sup_0
              styles:
                label:
                  - font-size: 0.6em
                  - color: rgba(178,190,181,0.6)
              tap_action:
                action: none
              hold_action:
                action: none
        styles:
          card:
            - background: none
            - border-radius: 0
            - border: 0
          custom_fields:
            numitems:
              - position: absolute
              - left: 75%
              - top: 10%
        entity: sensor.nombre_pollens_arbre_on
        show_entity_picture: true
        show_icon: false
        show_label: false
        show_state: false
        show_name: false
        state:
          - value: 0
            entity_picture: /local/images/pollens/pollen_tree_01.png
          - value: 1
            entity_picture: /local/images/pollens/pollen_tree_02.png
          - value: 2
            entity_picture: /local/images/pollens/pollen_tree_03.png
          - value: 3
            entity_picture: /local/images/pollens/pollen_tree_04.png
        size: 45px
        tap_action:
          action: fire-dom-event
          browser_mod:
            service: browser_mod.popup
            deviceID:
              - this
              - dashboard
            data:
              title: Pollen Arbre
              content:
                type: grid
                columns: 1
                square: false
                cards:
                  - type: grid
                    columns: 3
                    square: false
                    cards:
                      - type: custom:button-card
                        entity: sensor.pollens_91_bouleau
                        name: bouleau
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_platane
                        name: platane
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_tilleul
                        name: tilleul
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_peuplier
                        name: peuplier
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_noisetier
                        name: noisetier
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_olivier
                        name: olivier
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_chataignier
                        name: chataignier
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_frene
                        name: frene
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_chene
                        name: chene
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_aulne
                        name: aulne
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_saule
                        name: saule
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
                      - type: custom:button-card
                        entity: sensor.pollens_91_charme
                        name: charme
                        show_entity_picture: true
                        show_icon: false
                        show_label: false
                        show_state: false
                        show_name: true
                        state:
                          - value: 0
                            entity_picture: /local/images/pollens/pollen_tree_01.png
                          - value: 1
                            entity_picture: /local/images/pollens/pollen_tree_02.png
                          - value: 2
                            entity_picture: /local/images/pollens/pollen_tree_03.png
                          - value: 3
                            entity_picture: /local/images/pollens/pollen_tree_04.png
                        tap_action:
                          action: none
        hold_action:
          action: none
    view_layout:
      grid-area: room1

1 « J'aime »

reste a aranger la couleur par rapport au nombre.
je regarde de mon coté combien en jaune, orange et rouge et je change sur la base
la base est rouge alors qu’il n’y a aucun rouge dans le pollen, mais comme il y a 3 jaune et un orange, je considère que c’est rouge.

ah ok! Je suis parti sur une lecture un peu plus simpliste pour ce sensor: je prend la valeur Max() des pollens pour ce thème. Comment tu décides du poids de chaque couleur dans ce cas ?

un calcul a la c… que seul les fous comme moi utilise :slight_smile:
non, pour faire simple, je prends la valeur de chaque capteur et cela lui fait un poids, et si l’addition des poids est supérieur a un chiffre max relatif que j’ai défini, cela fait que le pollen est rouge alors qu’il n’y a par exemple que 6 jaune, ou 3 jaune et un orange.

1 « J'aime »

oki je vais rester sur ma logique dans ce cas ^^ comme cela il y aura 2 approches aussi folles les unes que les autres :wink: !

1 « J'aime »