Ecrire en couleur une entité en fonction de son état

Oui, mais chaque bouton fait apparaitre un custom_fields différent qui lui-même contient plein de custom_fields différents (2000 lignes de code pour les 11 boutons et les 11 cartes (custom_fields) en dessous et juste la carte « Salle à manger » qui est presque finie (il reste à faire la carte quand je clique sur le bouton du climatiseur pour accéder aux autres options que le réglage de la température cible et l’allumage et l’extinction : les oscillations, les modes, la soufflerie, etc. et la programmation en fonction des jours avec différentes plages par jour de semaine et de WE).
Une fois cette partie finie, je m’attaquerai aux autres « cartes » :laughing:
Ca devrait faire 20 000 lignes à la fin

Pour l’instant :

type: custom:button-card
aspect_ratio: 1/1.9
custom_fields:
  acces:
    card:
      type: custom:button-card
      name: Accès
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      custom_fields:
        zone_acces:
          card:
            type: custom:button-card
            styles:
              card:
                - background-color: |
                    [[[
                      if (states['input_number.tableau_de_bord_carte_courante'].state == '1.0')
                        return 'rgba(64,192,64,0.7)';
                      else
                        return 'rgba(128,128,128,1.0)';
                    ]]]
                - border: 1px solid rgba(0,0,0,0.0)
                - box-shadow: 4px 4px 6px 0px inset rgba(32,32,32,0.7)
                - aspect-ratio: 1/1
                - border-radius: 50%
                - width: 88px
            tap_action:
              action: none
            hold_action:
              action: none
        icone_acces:
          card:
            type: custom:button-card
            icon: mdi:home
            styles:
              card:
                - background-color: rgba(0,0,0,0.0)
                - border: none
                - aspect-ratio: 1/1
                - border-radius: none
                - width: 88px
              icon:
                - width: 65%
                - top: 8px
                - left: 5px
            tap_action:
              action: call-service
              service: script.tableau_de_bord_carte_acces
            hold_action:
              action: none
      styles:
        card:
          - background-color: dimgrey
          - border: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '1.0')
                  return '2px inset rgba(0,255,0,1.0)';
                else
                  return '2px outset darkgrey';
              ]]]
          - box-shadow: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '1.0')
                  return '0px 0px 4px 4px rgba(0,128,0,0.3)';
                else
                  return '0px 0px 0px 0px rgba(0,0,0,0.0)';
              ]]]
          - aspect-ratio: 1/1
          - border-radius: 10%
          - width: 78px
          - padding-left: 5px
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - color: rgba(0,0,0,0.6)
        custom_fields:
          zone_acces:
            - position: absolute
            - left: 5px
            - top: 25px
          icone_acces:
            - position: absolute
            - left: 0px
            - top: 0px
      tap_action:
        action: none
      hold_action:
        action: none
  entree:
    card:
      type: custom:button-card
      name: Entrée
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      custom_fields:
        zone_entree:
          card:
            type: custom:button-card
            styles:
              card:
                - background-color: |
                    [[[
                      if (states['input_number.tableau_de_bord_carte_courante'].state == '2.0')
                        return 'rgba(64,192,64,0.7)';
                      else
                        return 'rgba(128,128,128,1.0)';
                    ]]]
                - border: 1px solid rgba(182,82,182,0.0)
                - box-shadow: 4px 4px 6px 0px inset rgba(32,32,32,0.7)
                - aspect-ratio: 1/1
                - border-radius: 50%
                - width: 88px
            tap_action:
              action: input_number.tableau_de_bord_carte_courante
            hold_action:
              action: none
        icone_entree:
          card:
            type: custom:button-card
            icon: phu:rooms-front-door
            styles:
              card:
                - background-color: rgba(0,0,0,0.0)
                - border: none
                - aspect-ratio: 1/1
                - border-radius: none
                - width: 88px
              icon:
                - width: 50%
                - top: 8px
                - left: 8px
            tap_action:
              action: call-service
              service: script.tableau_de_bord_carte_entree
            hold_action:
              action: none
      styles:
        card:
          - background-color: dimgrey
          - border: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '2.0')
                  return '2px inset rgba(0,255,0,1.0)';
                else
                  return '2px outset darkgrey';
              ]]]
          - box-shadow: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '2.0')
                  return '0px 0px 4px 4px rgba(0,128,0,0.3)';
                else
                  return '0px 0px 0px 0px rgba(0,0,0,0.0)';
              ]]]
          - aspect-ratio: 1/1
          - border-radius: 10%
          - width: 78px
          - padding-left: 5px
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - color: rgba(0,0,0,0.6)
        custom_fields:
          zone_entree:
            - position: absolute
            - left: 5px
            - top: 25px
          icone_entree:
            - position: absolute
            - left: 0px
            - top: 0px
      tap_action:
        action: none
      hold_action:
        action: none
  couloir:
    card:
      type: custom:button-card
      name: Couloir
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      custom_fields:
        zone_couloir:
          card:
            type: custom:button-card
            styles:
              card:
                - background-color: |
                    [[[
                      if (states['input_number.tableau_de_bord_carte_courante'].state == '3.0')
                        return 'rgba(64,192,64,0.7)';
                      else
                        return 'rgba(128,128,128,1.0)';
                    ]]]
                - border: 1px solid rgba(182,82,182,0.0)
                - box-shadow: 4px 4px 6px 0px inset rgba(32,32,32,0.7)
                - aspect-ratio: 1/1
                - border-radius: 50%
                - width: 88px
            tap_action:
              action: none
            hold_action:
              action: none
        icone_couloir:
          card:
            type: custom:button-card
            icon: phu:rooms-hallway
            styles:
              card:
                - background-color: rgba(0,0,0,0.0)
                - border: none
                - aspect-ratio: 1/1
                - border-radius: none
                - width: 88px
              icon:
                - width: 50%
                - top: 7px
                - left: 7px
            tap_action:
              action: call-service
              service: script.tableau_de_bord_carte_couloir
            hold_action:
              action: none
      styles:
        card:
          - background-color: dimgrey
          - border: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '3.0')
                  return '2px inset rgba(0,255,0,1.0)';
                else
                  return '2px outset darkgrey';
              ]]]
          - box-shadow: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '3.0')
                  return '0px 0px 4px 4px rgba(0,128,0,0.3)';
                else
                  return '0px 0px 0px 0px rgba(0,0,0,0.0)';
              ]]]
          - aspect-ratio: 1/1
          - border-radius: 10%
          - width: 78px
          - padding-left: 5px
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - color: rgba(0,0,0,0.6)
        custom_fields:
          zone_couloir:
            - position: absolute
            - left: 5px
            - top: 25px
          icone_couloir:
            - position: absolute
            - left: 0px
            - top: 0px
      tap_action:
        action: none
      hold_action:
        action: none
  cuisine:
    card:
      type: custom:button-card
      name: Cuisine
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      custom_fields:
        zone_cuisine:
          card:
            type: custom:button-card
            styles:
              card:
                - background-color: |
                    [[[
                      if (states['input_number.tableau_de_bord_carte_courante'].state == '4.0')
                        return 'rgba(64,192,64,0.7)';
                      else
                        return 'rgba(128,128,128,1.0)';
                    ]]]
                - border: 1px solid rgba(182,82,182,0.0)
                - box-shadow: 4px 4px 6px 0px inset rgba(32,32,32,0.7)
                - aspect-ratio: 1/1
                - border-radius: 50%
                - width: 88px
            tap_action:
              action: none
            hold_action:
              action: none
        icone_cuisine:
          card:
            type: custom:button-card
            icon: phu:rooms-kitchen
            styles:
              card:
                - background-color: rgba(0,0,0,0.0)
                - border: none
                - aspect-ratio: 1/1
                - border-radius: none
                - width: 88px
              icon:
                - width: 50%
                - top: 8px
                - left: 5px
            tap_action:
              action: call-service
              service: script.tableau_de_bord_carte_cuisine
            hold_action:
              action: none
      styles:
        card:
          - background-color: dimgrey
          - border: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '4.0')
                  return '2px inset rgba(0,255,0,1.0)';
                else
                  return '2px outset darkgrey';
              ]]]
          - box-shadow: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '4.0')
                  return '0px 0px 4px 4px rgba(0,128,0,0.3)';
                else
                  return '0px 0px 0px 0px rgba(0,0,0,0.0)';
              ]]]
          - aspect-ratio: 1/1
          - border-radius: 10%
          - width: 78px
          - padding-left: 5px
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - color: rgba(0,0,0,0.6)
        custom_fields:
          zone_cuisine:
            - position: absolute
            - left: 5px
            - top: 25px
          icone_cuisine:
            - position: absolute
            - left: 0px
            - top: 0px
      tap_action:
        action: none
      hold_action:
        action: none
  salon:
    card:
      type: custom:button-card
      name: Salon
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      custom_fields:
        zone_salon:
          card:
            type: custom:button-card
            styles:
              card:
                - background-color: |
                    [[[
                      if (states['input_number.tableau_de_bord_carte_courante'].state == '5.0')
                        return 'rgba(64,192,64,0.7)';
                      else
                        return 'rgba(128,128,128,1.0)';
                    ]]]
                - border: 1px solid rgba(182,82,182,0.0)
                - box-shadow: 4px 4px 6px 0px inset rgba(32,32,32,0.7)
                - aspect-ratio: 1/1
                - border-radius: 50%
                - width: 88px
            tap_action:
              action: none
            hold_action:
              action: none
        icone_salon:
          card:
            type: custom:button-card
            icon: phu:rooms-living
            styles:
              card:
                - background-color: rgba(0,0,0,0.0)
                - border: none
                - aspect-ratio: 1/1
                - border-radius: none
                - width: 88px
              icon:
                - width: 50%
                - top: 12px
                - left: 5px
            tap_action:
              action: call-service
              service: script.tableau_de_bord_carte_salon
            hold_action:
              action: none
      styles:
        card:
          - background-color: dimgrey
          - border: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '5.0')
                  return '2px inset rgba(0,255,0,1.0)';
                else
                  return '2px outset darkgrey';
              ]]]
          - box-shadow: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '5.0')
                  return '0px 0px 4px 4px rgba(0,128,0,0.3)';
                else
                  return '0px 0px 0px 0px rgba(0,0,0,0.0)';
              ]]]
          - aspect-ratio: 1/1
          - border-radius: 10%
          - width: 78px
          - padding-left: 5px
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - color: rgba(0,0,0,0.6)
        custom_fields:
          zone_salon:
            - position: absolute
            - left: 5px
            - top: 25px
          icone_salon:
            - position: absolute
            - left: 0px
            - top: 0px
      tap_action:
        action: none
      hold_action:
        action: none
  chambre:
    card:
      type: custom:button-card
      name: Chambre
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      custom_fields:
        zone_chambre:
          card:
            type: custom:button-card
            styles:
              card:
                - background-color: |
                    [[[
                      if (states['input_number.tableau_de_bord_carte_courante'].state == '6.0')
                        return 'rgba(64,192,64,0.7)';
                      else
                        return 'rgba(128,128,128,1.0)';
                    ]]]
                - border: 1px solid rgba(182,82,182,0.0)
                - box-shadow: 4px 4px 6px 0px inset rgba(32,32,32,0.7)
                - aspect-ratio: 1/1
                - border-radius: 50%
                - width: 88px
            tap_action:
              action: none
            hold_action:
              action: none
        icone_chambre:
          card:
            type: custom:button-card
            icon: phu:rooms-bedroom
            styles:
              card:
                - background-color: rgba(0,0,0,0.0)
                - border: none
                - aspect-ratio: 1/1
                - border-radius: none
                - width: 88px
              icon:
                - width: 50%
                - top: 10px
                - left: 5px
            tap_action:
              action: call-service
              service: script.tableau_de_bord_carte_chambre
            hold_action:
              action: none
      styles:
        card:
          - background-color: dimgrey
          - border: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '6.0')
                  return '2px inset rgba(0,255,0,1.0)';
                else
                  return '2px outset darkgrey';
              ]]]
          - box-shadow: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '6.0')
                  return '0px 0px 4px 4px rgba(0,128,0,0.3)';
                else
                  return '0px 0px 0px 0px rgba(0,0,0,0.0)';
              ]]]
          - aspect-ratio: 1/1
          - border-radius: 10%
          - width: 78px
          - padding-left: 5px
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - color: rgba(0,0,0,0.6)
        custom_fields:
          zone_chambre:
            - position: absolute
            - left: 5px
            - top: 25px
          icone_chambre:
            - position: absolute
            - left: 0px
            - top: 0px
      tap_action:
        action: none
      hold_action:
        action: none
  sejour:
    card:
      type: custom:button-card
      name: Séjour
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      custom_fields:
        zone_sejour:
          card:
            type: custom:button-card
            styles:
              card:
                - background-color: |
                    [[[
                      if (states['input_number.tableau_de_bord_carte_courante'].state == '7.0')
                        return 'rgba(64,192,64,0.7)';
                      else
                        return 'rgba(128,128,128,1.0)';
                    ]]]
                - border: 1px solid rgba(182,82,182,0.0)
                - box-shadow: 4px 4px 6px 0px inset rgba(32,32,32,0.7)
                - aspect-ratio: 1/1
                - border-radius: 50%
                - width: 88px
            tap_action:
              action: none
            hold_action:
              action: none
        icone_sejour:
          card:
            type: custom:button-card
            icon: phu:rooms-dining
            styles:
              card:
                - background-color: rgba(0,0,0,0.0)
                - border: none
                - aspect-ratio: 1/1
                - border-radius: none
                - width: 88px
              icon:
                - width: 50%
                - top: 8px
                - left: 5px
            tap_action:
              action: call-service
              service: script.tableau_de_bord_carte_sejour
            hold_action:
              action: none
      styles:
        card:
          - background-color: dimgrey
          - border: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '7.0')
                  return '2px inset rgba(0,255,0,1.0)';
                else
                  return '2px outset darkgrey';
              ]]]
          - box-shadow: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '7.0')
                  return '0px 0px 4px 4px rgba(0,128,0,0.3)';
                else
                  return '0px 0px 0px 0px rgba(0,0,0,0.0)';
              ]]]
          - aspect-ratio: 1/1
          - border-radius: 10%
          - width: 78px
          - padding-left: 5px
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - color: rgba(0,0,0,0.6)
        custom_fields:
          zone_sejour:
            - position: absolute
            - left: 5px
            - top: 25px
          icone_sejour:
            - position: absolute
            - left: 0px
            - top: 0px
      tap_action:
        action: none
      hold_action:
        action: none
  etage:
    card:
      type: custom:button-card
      name: Etage
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      custom_fields:
        zone_etage:
          card:
            type: custom:button-card
            styles:
              card:
                - background-color: |
                    [[[
                      if (states['input_number.tableau_de_bord_carte_courante'].state == '8.0')
                        return 'rgba(64,192,64,0.7)';
                      else
                        return 'rgba(128,128,128,1.0)';
                    ]]]
                - border: 1px solid rgba(182,82,182,0.0)
                - box-shadow: 4px 4px 6px 0px inset rgba(32,32,32,0.7)
                - aspect-ratio: 1/1
                - border-radius: 50%
                - width: 88px
            tap_action:
              action: none
            hold_action:
              action: none
        icone_etage:
          card:
            type: custom:button-card
            icon: phu:rooms-staircase
            styles:
              card:
                - background-color: rgba(0,0,0,0.0)
                - border: none
                - aspect-ratio: 1/1
                - border-radius: none
                - width: 88px
              icon:
                - width: 50%
                - top: 8px
                - left: 5px
            tap_action:
              action: call-service
              service: script.tableau_de_bord_carte_etage
            hold_action:
              action: none
      styles:
        card:
          - background-color: dimgrey
          - border: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '8.0')
                  return '2px inset rgba(0,255,0,1.0)';
                else
                  return '2px outset darkgrey';
              ]]]
          - box-shadow: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '8.0')
                  return '0px 0px 4px 4px rgba(0,128,0,0.3)';
                else
                  return '0px 0px 0px 0px rgba(0,0,0,0.0)';
              ]]]
          - aspect-ratio: 1/1
          - border-radius: 10%
          - width: 78px
          - padding-left: 5px
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - color: rgba(0,0,0,0.6)
        custom_fields:
          zone_etage:
            - position: absolute
            - left: 5px
            - top: 25px
          icone_etage:
            - position: absolute
            - left: 0px
            - top: 0px
      tap_action:
        action: none
      hold_action:
        action: none
  sous-sol:
    card:
      type: custom:button-card
      name: Sous-sol
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      custom_fields:
        zone_sous-sol:
          card:
            type: custom:button-card
            styles:
              card:
                - background-color: |
                    [[[
                      if (states['input_number.tableau_de_bord_carte_courante'].state == '9.0')
                        return 'rgba(64,192,64,0.7)';
                      else
                        return 'rgba(128,128,128,1.0)';
                    ]]]
                - border: 1px solid rgba(182,82,182,0.0)
                - box-shadow: 4px 4px 6px 0px inset rgba(32,32,32,0.7)
                - aspect-ratio: 1/1
                - border-radius: 50%
                - width: 88px
            tap_action:
              action: none
            hold_action:
              action: none
        icone_sous-sol:
          card:
            type: custom:button-card
            icon: phu:rooms-staircase
            styles:
              card:
                - background-color: rgba(0,0,0,0.0)
                - border: none
                - aspect-ratio: 1/1
                - border-radius: none
                - width: 88px
              icon:
                - width: 50%
                - top: 8px
                - left: 5px
                - transform: rotate(90deg)
            tap_action:
              action: call-service
              service: script.tableau_de_bord_carte_sous_sol
            hold_action:
              action: none
      styles:
        card:
          - background-color: dimgrey
          - border: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '9.0')
                  return '2px inset rgba(0,255,0,1.0)';
                else
                  return '2px outset darkgrey';
              ]]]
          - box-shadow: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '9.0')
                  return '0px 0px 4px 4px rgba(0,128,0,0.3)';
                else
                  return '0px 0px 0px 0px rgba(0,0,0,0.0)';
              ]]]
          - aspect-ratio: 1/1
          - border-radius: 10%
          - width: 78px
          - padding-left: 5px
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - color: rgba(0,0,0,0.6)
        custom_fields:
          zone_sous-sol:
            - position: absolute
            - left: 5px
            - top: 25px
          icone_sous-sol:
            - position: absolute
            - left: 0px
            - top: 0px
      tap_action:
        action: none
      hold_action:
        action: none
  terrasse:
    card:
      type: custom:button-card
      name: Terrasse
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      custom_fields:
        zone_terrasse:
          card:
            type: custom:button-card
            styles:
              card:
                - background-color: |
                    [[[
                      if (states['input_number.tableau_de_bord_carte_courante'].state == '10.0')
                        return 'rgba(64,192,64,0.7)';
                      else
                        return 'rgba(128,128,128,1.0)';
                    ]]]
                - border: 1px solid rgba(182,82,182,0.0)
                - box-shadow: 4px 4px 6px 0px inset rgba(32,32,32,0.7)
                - aspect-ratio: 1/1
                - border-radius: 50%
                - width: 88px
            tap_action:
              action: none
            hold_action:
              action: none
        icone_terrasse:
          card:
            type: custom:button-card
            icon: phu:rooms-terrace
            styles:
              card:
                - background-color: rgba(0,0,0,0.0)
                - border: none
                - aspect-ratio: 1/1
                - border-radius: none
                - width: 88px
              icon:
                - width: 50%
                - top: 8px
                - left: 5px
            tap_action:
              action: call-service
              service: script.tableau_de_bord_carte_terrasse
            hold_action:
              action: none
      styles:
        card:
          - background-color: dimgrey
          - border: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '10.0')
                  return '2px inset rgba(0,255,0,1.0)';
                else
                  return '2px outset darkgrey';
              ]]]
          - box-shadow: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '10.0')
                  return '0px 0px 4px 4px rgba(0,128,0,0.3)';
                else
                  return '0px 0px 0px 0px rgba(0,0,0,0.0)';
              ]]]
          - aspect-ratio: 1/1
          - border-radius: 10%
          - width: 78px
          - padding-left: 5px
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - color: rgba(0,0,0,0.6)
        custom_fields:
          zone_terrasse:
            - position: absolute
            - left: 5px
            - top: 25px
          icone_terrasse:
            - position: absolute
            - left: 0px
            - top: 0px
      tap_action:
        action: none
      hold_action:
        action: none
  alarme:
    card:
      type: custom:button-card
      name: Alarme
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      custom_fields:
        zone_alarme:
          card:
            type: custom:button-card
            styles:
              card:
                - background-color: |
                    [[[
                      if (states['input_number.tableau_de_bord_carte_courante'].state == '11.0')
                        return 'rgba(64,192,64,0.7)';
                      else
                        return 'rgba(128,128,128,1.0)';
                    ]]]
                - border: 1px solid rgba(182,82,182,0.0)
                - box-shadow: 4px 4px 6px 0px inset rgba(32,32,32,0.7)
                - aspect-ratio: 1/1
                - border-radius: 50%
                - width: 88px
            tap_action:
              action: none
            hold_action:
              action: none
        icone_alarme:
          card:
            type: custom:button-card
            icon: mdi:shield-home
            styles:
              card:
                - background-color: rgba(0,0,0,0.0)
                - border: none
                - aspect-ratio: 1/1
                - border-radius: none
                - width: 88px
              icon:
                - width: 50%
                - top: 8px
                - left: 5px
            tap_action:
              action: call-service
              service: script.tableau_de_bord_carte_alarme
            hold_action:
              action: none
      styles:
        card:
          - background-color: dimgrey
          - border: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '11.0')
                  return '2px inset rgba(0,255,0,1.0)';
                else
                  return '2px outset darkgrey';
              ]]]
          - box-shadow: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '11.0')
                  return '0px 0px 4px 4px rgba(0,128,0,0.3)';
                else
                  return '0px 0px 0px 0px rgba(0,0,0,0.0)';
              ]]]
          - aspect-ratio: 1/1
          - border-radius: 10%
          - width: 78px
          - padding-left: 5px
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - color: rgba(0,0,0,0.6)
        custom_fields:
          zone_alarme:
            - position: absolute
            - left: 5px
            - top: 25px
          icone_alarme:
            - position: absolute
            - left: 0px
            - top: 0px
      tap_action:
        action: none
      hold_action:
        action: none
  carte_acces:
    card:
      type: custom:button-card
      name: Accès
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      styles:
        card:
          - background-color: rgba(128,128,128,1.0)
          - border: 2px outset darkgrey
          - aspect-ratio: 1/1.176
          - border-radius: 3%
          - width: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '1.0')
                  return '330px';
                else
                  return '0px';
              ]]]
          - padding-left: 5px
          - z-index: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '1.0')
                  return '1';
                else
                  return '-1';
              ]]]
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - margin-top: '-10px'
          - color: lightgrey
      tap_action:
        action: none
      hold_action:
        action: none
  carte_entree:
    card:
      type: custom:button-card
      name: Entrée
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      styles:
        card:
          - background-color: rgba(128,128,128,1.0)
          - border: 2px outset darkgrey
          - aspect-ratio: 1/1.176
          - border-radius: 3%
          - width: 330px
          - padding-left: 5px
          - z-index: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '2.0')
                  return '1';
                else
                  return '-1';
              ]]]
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - margin-top: '-10px'
          - color: lightgrey
      tap_action:
        action: none
      hold_action:
        action: none
  carte_couloir:
    card:
      type: custom:button-card
      name: Couloir
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      styles:
        card:
          - background-color: rgba(128,128,128,1.0)
          - border: 2px outset darkgrey
          - aspect-ratio: 1/1.176
          - border-radius: 3%
          - width: 330px
          - padding-left: 5px
          - z-index: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '3.0')
                  return '1';
                else
                  return '-1';
              ]]]
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - margin-top: '-10px'
          - color: lightgrey
      tap_action:
        action: none
      hold_action:
        action: none
  carte_cuisine:
    card:
      type: custom:button-card
      name: Cuisine
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      styles:
        card:
          - background-color: rgba(128,128,128,1.0)
          - border: 2px outset darkgrey
          - aspect-ratio: 1/1.176
          - border-radius: 3%
          - width: 330px
          - padding-left: 5px
          - z-index: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '4.0')
                  return '1';
                else
                  return '-1';
              ]]]
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - margin-top: '-10px'
          - color: lightgrey
      tap_action:
        action: none
      hold_action:
        action: none
  carte_salon:
    card:
      type: custom:button-card
      name: Salon
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      styles:
        card:
          - background-color: rgba(128,128,128,1.0)
          - border: 2px outset darkgrey
          - aspect-ratio: 1/1.176
          - border-radius: 3%
          - width: 330px
          - padding-left: 5px
          - z-index: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '5.0')
                  return '1';
                else
                  return '-1';
              ]]]
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - margin-top: '-10px'
          - color: lightgrey
      tap_action:
        action: none
      hold_action:
        action: none
  carte_chambre:
    card:
      type: custom:button-card
      name: Chambre
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      styles:
        card:
          - background-color: rgba(128,128,128,1.0)
          - border: 2px outset darkgrey
          - aspect-ratio: 1/1.176
          - border-radius: 3%
          - width: 330px
          - padding-left: 5px
          - z-index: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '6.0')
                  return '1';
                else
                  return '-1';
              ]]]
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - margin-top: '-10px'
          - color: lightgrey
      tap_action:
        action: none
      hold_action:
        action: none
  carte_sejour:
    card:
      type: custom:button-card
      name: Salle à manger
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      custom_fields:
        eclairage:
          card:
            type: custom:button-card
            name: 'Éclairage :'
            styles:
              name:
                - font-size: 0.8em
                - font-weight: bold
                - color: rgba(0,0,0,0.6)
                - justify-self: start
                - font-style: italic
              card:
                - background-color: rgba(255,255,255,0.0)
                - border: none
            tap_action:
              action: none
            hold_action:
              action: none
        plafonnier_texte:
          card:
            type: custom:button-card
            name: Plafonnier
            styles:
              name:
                - font-size: 0.7em
                - color: rgba(0,0,0,0.6)
                - justify-self: middle
              card:
                - background-color: rgba(255,255,255,0.0)
                - border: none
                - border-radius: 0
                - width: 58px
            tap_action:
              action: none
            hold_action:
              action: none
        plafonnier_icone:
          card:
            type: custom:button-card
            size: 80%
            entity: light.salle_a_manger_plafonnier
            icon: phu:ceiling-fugato-four
            show_name: false
            state:
              - value: 'off'
                styles:
                  icon:
                    - color: dimgray
                  card:
                    - box-shadow: none
                    - border-radius: 50%
                    - border: dimgray
                    - background-color: rgba(242,242,242,1.0)
                    - width: 48px
                    - height: 48px
              - value: 'on'
                styles:
                  icon:
                    - color: rgb(255,255,128)
                  card:
                    - border-radius: 50%
                    - box-shadow: 0px 0px 6px 3px rgba(255,255,128,0.8)
                    - background-color: rgba(0,0,0,0.5)
                    - width: 48px
                    - height: 48px
        buffet_texte:
          card:
            type: custom:button-card
            name: Buffet
            styles:
              name:
                - font-size: 0.7em
                - color: rgba(0,0,0,0.6)
                - justify-self: middle
              card:
                - background-color: rgba(255,255,255,0.0)
                - border: none
                - border-radius: 0
                - width: 58px
            tap_action:
              action: none
            hold_action:
              action: none
        buffet_icone:
          card:
            type: custom:button-card
            size: 80%
            entity: light.salle_a_manger_relais_buffet
            icon: phu:adore
            show_name: false
            state:
              - value: 'off'
                styles:
                  icon:
                    - color: dimgray
                    - transform: rotate(180deg)
                  card:
                    - box-shadow: none
                    - border-radius: 50%
                    - border: dimgray
                    - background-color: rgba(242,242,242,1.0)
                    - width: 48px
                    - height: 48px
              - value: 'on'
                styles:
                  icon:
                    - color: rgb(255,255,128)
                    - transform: rotate(180deg)
                  card:
                    - border-radius: 50%
                    - box-shadow: 0px 0px 6px 3px rgba(255,255,128,0.8)
                    - background-color: rgba(0,0,0,0.5)
                    - width: 48px
                    - height: 48px
        vaisselier_texte:
          card:
            type: custom:button-card
            name: Vaisselier
            styles:
              name:
                - font-size: 0.7em
                - color: rgba(0,0,0,0.6)
                - justify-self: middle
              card:
                - background-color: rgba(255,255,255,0.0)
                - border: none
                - border-radius: 0
                - width: 58px
            tap_action:
              action: none
            hold_action:
              action: none
        vaisselier_icone:
          card:
            type: custom:button-card
            size: 80%
            entity: switch.salle_a_manger_prise_vaisselier
            icon: phu:adore
            show_name: false
            state:
              - value: 'off'
                styles:
                  icon:
                    - color: dimgray
                    - transform: rotate(180deg)
                  card:
                    - box-shadow: none
                    - border-radius: 50%
                    - border: dimgray
                    - background-color: rgba(242,242,242,1.0)
                    - width: 48px
                    - height: 48px
              - value: 'on'
                styles:
                  icon:
                    - color: rgb(255,255,128)
                    - transform: rotate(180deg)
                  card:
                    - border-radius: 50%
                    - box-shadow: 0px 0px 6px 3px rgba(255,255,128,0.8)
                    - background-color: rgba(0,0,0,0.5)
                    - width: 48px
                    - height: 48px
        volet:
          card:
            type: custom:button-card
            name: 'Volet :'
            styles:
              name:
                - font-size: 0.8em
                - font-weight: bold
                - color: rgba(0,0,0,0.6)
                - justify-self: start
                - font-style: italic
              card:
                - background-color: rgba(255,255,255,0.0)
                - border: none
            tap_action:
              action: none
            hold_action:
              action: none
        volet_up:
          card:
            type: custom:button-card
            show_name: false
            styles:
              card:
                - background-color: rgba(255,255,255,0.0)
                - background-image: url(/local/images/icones/volet_ouvrir.png)
                - background-size: cover
                - height: 54px
                - width: 54px
                - border-radius: 50%
                - box-shadow: 2px 2px 4px 0px rgba(32,32,32,0.5)
                - border: 2px rgba(211,211,211,1.0) outset
            tap_action:
              action: call-service
              service: script.salle_a_manger_volet_ouvrir
        volet_stop:
          card:
            type: custom:button-card
            show_name: false
            styles:
              card:
                - background-color: rgba(255,255,255,0.0)
                - background-image: url(/local/images/icones/volet_stopper.png)
                - background-size: cover
                - height: 54px
                - width: 54px
                - border-radius: 50%
                - box-shadow: 2px 2px 4px 0px rgba(32,32,32,0.5)
                - border: 2px rgba(211,211,211,1.0) outset
            tap_action:
              action: call-service
              service: script.salle_a_manger_volet_arreter
        volet_down:
          card:
            type: custom:button-card
            show_name: false
            styles:
              card:
                - background-color: rgba(255,255,255,0.0)
                - background-image: url(/local/images/icones/volet_fermer.png)
                - background-size: cover
                - height: 54px
                - width: 54px
                - border-radius: 50%
                - box-shadow: 2px 2px 4px 0px rgba(32,32,32,0.5)
                - border: 2px rgba(211,211,211,1.0) outset
            tap_action:
              action: call-service
              service: script.salle_a_manger_volet_fermer
        climatiseur:
          card:
            type: custom:button-card
            name: 'Climatiseur :'
            styles:
              name:
                - font-size: 0.8em
                - font-weight: bold
                - color: rgba(0,0,0,0.6)
                - justify-self: start
                - font-style: italic
              card:
                - background-color: rgba(255,255,255,0.0)
                - border: none
            tap_action:
              action: none
            hold_action:
              action: none
        climatiseur_icone:
          card:
            type: custom:button-card
            show_name: false
            styles:
              card:
                - background-color: rgba(255,255,255,0.0)
                - background-image: url(/local/images/icones/climatiseur.png)
                - background-size: cover
                - height: 54px
                - width: 54px
                - border-radius: 50%
                - box-shadow: 2px 2px 4px 0px rgba(32,32,32,0.5)
                - border: 2px rgba(211,211,211,1.0) outset
            tap_action:
              action: none
            hold_action:
              action: none
        climatiseur_texte:
          card:
            type: custom:button-card
            name: On / Off
            styles:
              name:
                - font-size: 0.7em
                - color: rgba(0,0,0,0.6)
              card:
                - background-color: rgba(255,255,255,0.0)
                - border: none
                - border-radius: 0
            tap_action:
              action: none
            hold_action:
              action: none
        climatiseur_interrupteur:
          card:
            type: custom:button-card
            aspect_ratio: 1/1
            entity: climate.salle_a_manger_climatisation_mqtt_hvac
            show_name: false
            show_icon: false
            styles:
              card:
                - background-color: rgba(0,0,0,0.0)
                - border: none
                - width: 54px
                - height: 54px
                - border-radius: 0px
                - background-size: cover
                - background-position: center
                - background-image: |
                    [[[
                      if (states['climate.salle_a_manger_climatisation_mqtt_hvac'].state == 'off')
                        return 'url(/local/images/icones/bouton_off.png)';
                      else
                        return 'url(/local/images/icones/bouton_on.png)';
                    ]]]
            tap_action:
              action: call-service
              service: script.climatiseur_sejour_on_off
        climatiseur_temp_texte:
          card:
            type: custom:button-card
            name: Température cible
            styles:
              name:
                - font-size: 0.7em
                - color: rgba(0,0,0,0.6)
              card:
                - background-color: rgba(255,255,255,0.0)
                - border: none
                - border-radius: 0
            tap_action:
              action: none
            hold_action:
              action: none
        climatiseur_temp:
          card:
            type: custom:button-card
            entity: sensor.salle_a_manger_climatisation_temperature_cible
            show_name: false
            show_icon: false
            show_state: true
            numeric_precision: 0
            tap_action: none
            styles:
              state:
                - font-size: 0.9em
                - font-weight: bold
                - color: |
                    [[[
                      if (states['climate.salle_a_manger_climatisation_mqtt_hvac'].state == 'off')
                        return 'rgba(80,80,80,1.0)';
                      else
                        return 'lightgray';
                    ]]]
              card:
                - background-color: rgba(32,32,32,0.5)
                - border: 1px rgba(0,0,0,0.5) inset
                - box-shadow: 1px 1px 1px 0px rgba(211,211,211,0.5)
                - width: 54px
                - aspect-ratio: 2/1
                - border-radius: 5px
                - z-index: 1
        climatiseur_temp_down:
          card:
            type: custom:button-card
            show_name: false
            show_state: true
            icon: mdi:menu-down
            numeric_precision: 0
            tap_action:
              action: |
                [[[
                  if (states['sensor.salle_a_manger_climatisation_temperature_cible'].state >= '17.0')
                    return 'call-service';
                  else
                    return 'none';
                ]]]
              service: script.climatiseur_sejour_diminuer_temperature_cible
            styles:
              state:
                - font-size: 0.9em
                - font-weight: bold
                - color: lightgray
              card:
                - background-color: rgba(0,0,0,0.0)
                - border: none
                - box-shadow: none
                - width: 40px
                - aspect-ratio: 1/1
                - border-radius: 50%
                - z-index: |
                    [[[
                      if (states['sensor.salle_a_manger_climatisation_temperature_cible'].state >= '17.0')
                        return '0';
                      else
                        return '-1';
                    ]]]
              icon:
                - width: 40px
                - color: |
                    [[[
                      if (states['sensor.salle_a_manger_climatisation_temperature_cible'].state >= '17.0')
                        return 'rgba(32,32,32,0.5)';
                      else
                        return 'rgba(32,32,32,0.0)';
                    ]]]
        climatiseur_temp_up:
          card:
            type: custom:button-card
            show_name: false
            show_state: true
            icon: mdi:menu-up
            numeric_precision: 0
            tap_action:
              action: |
                [[[
                  if (states['sensor.salle_a_manger_climatisation_temperature_cible'].state <= '32.0')
                    return 'call-service';
                  else
                    return 'none';
                ]]]
              service: script.climatiseur_sejour_augmenter_temperature_cible
            styles:
              state:
                - font-size: 0.9em
                - font-weight: bold
                - color: lightgray
              card:
                - background-color: rgba(0,0,0,0.0)
                - border: none
                - box-shadow: none
                - width: 40px
                - aspect-ratio: 1/1
                - border-radius: 50%
                - z-index: |
                    [[[
                      if (states['sensor.salle_a_manger_climatisation_temperature_cible'].state <= '32.0')
                        return '0';
                      else
                        return '-1';
                    ]]]
              icon:
                - width: 40px
                - color: |
                    [[[
                      if (states['sensor.salle_a_manger_climatisation_temperature_cible'].state <= '32.0')
                        return 'rgba(32,32,32,0.5)';
                      else
                        return 'rgba(32,32,32,0.0)';
                    ]]]
        temp_icone:
          card:
            type: custom:button-card
            aspect_ratio: 1/1
            show_name: false
            show_icon: false
            styles:
              card:
                - opacity: 1
                - background-image: url(/local/images/icones/temperature.png)
                - background-size: cover
                - background-position: center
                - background-color: rgba(0,0,0,0.0)
                - border-radius: 50%
                - box-shadow: 2px 2px 4px 0px rgba(32,32,32,0.5)
                - border: 2px rgba(211,211,211,1.0) outset
                - z-index: 1
        temp_valeur:
          card:
            type: custom:button-card
            entity: sensor.salle_a_manger_climatisation_bletemp
            show_name: false
            show_icon: false
            show_state: true
            numeric_precision: 1
            tap_action: none
            styles:
              state:
                - font-size: 0.8em
                - font-weight: bold
                - color: dimgray
                - justify-self: end
                - padding-right: 10%
              card:
                - background-color: rgba(242,242,242,1.0)
                - border: dimgray
                - z-index: 0
        hygro_icone:
          card:
            type: custom:button-card
            aspect_ratio: 1/1
            show_name: false
            show_icon: false
            styles:
              card:
                - opacity: 1
                - background-image: url(/local/images/icones/hygrometrie.png)
                - background-size: cover
                - background-position: center
                - background-color: rgba(0,0,0,0.0)
                - border-radius: 50%
                - box-shadow: 2px 2px 4px 0px rgba(32,32,32,0.5)
                - border: 2px rgba(211,211,211,1.0) outset
                - z-index: 1
        hygro_valeur:
          card:
            type: custom:button-card
            entity: sensor.salle_a_manger_climatisation_blehum
            show_name: false
            show_icon: false
            show_state: true
            numeric_precision: 1
            tap_action: none
            styles:
              state:
                - font-size: 0.8em
                - font-weight: bold
                - color: dimgray
                - justify-self: end
                - padding-right: 10%
              card:
                - background-color: rgba(242,242,242,1.0)
                - border: dimgray
                - z-index: 0
        ouvertures:
          card:
            type: custom:button-card
            name: 'Ouvrant(s) :'
            styles:
              name:
                - font-size: 0.8em
                - font-weight: bold
                - color: rgba(0,0,0,0.6)
                - justify-self: middle
                - font-style: italic
              card:
                - background-color: rgba(255,255,255,0.0)
                - border: none
            tap_action:
              action: none
            hold_action:
              action: none
        baie_vitree_etat:
          card:
            type: custom:button-card
            show_name: true
            show_icon: false
            name: |
              [[[
                if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'off' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'off')
                  return 'Baie vitrée <br> fermée';
                else if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'on' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'off')
                  return 'Baie vitrée <br> ouverte côté droit';
                else if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'off' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'on')
                  return 'Baie vitrée <br> ouverte côté gauche';
                else if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'on' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'on')
                  return 'Baie vitrée <br> ouverte (deux côtés)';
              ]]]
            styles:
              name:
                - font-size: |
                    [[[
                      if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'off' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'off')
                        return '0.9em';
                      else if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'on' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'off')
                        return '0.8em';
                      else if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'off' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'on')
                        return '0.8em';
                      else if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'on' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'on')
                        return '0.7em';
                    ]]]
                - font-weight: |
                    [[[
                      if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'off' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'off')
                        return 'regular';
                      else if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'on' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'off')
                        return 'bold';
                      else if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'off' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'on')
                        return 'bold';
                      else if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'on' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'on')
                        return 'bold';
                    ]]]
                - color: |
                    [[[
                      if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'off' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'off')
                        return 'green';
                      else if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'on' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'off')
                        return 'red';
                      else if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'off' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'on')
                        return 'red';
                      else if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'on' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'on')
                        return 'red';
                    ]]]
              card:
                - background-color: |
                    [[[
                      if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'off' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'off')
                        return 'rgba(128,255,128,0.7)';
                      else if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'on' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'off')
                        return 'rgba(255,128,128,1.0)';
                      else if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'off' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'on')
                        return 'rgba(255,128,128,1.0)';
                      else if (states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_droit_contact'].state == 'on' && states['binary_sensor.salle_a_manger_detecteur_d_ouverture_baie_vitree_cote_gauche_contact'].state == 'on')
                        return 'rgba(255,128,128,1.0)';
                    ]]]
                - border: 1px rgba(0,0,0,0.5) inset
                - box-shadow: 1px 1px 1px 0px rgba(211,211,211,0.5)
                - width: 130px
                - height: 40px
                - border-radius: 5px
                - z-index: 1
      styles:
        card:
          - background-color: rgba(128,128,128,1.0)
          - border: 2px outset darkgrey
          - aspect-ratio: 1/1.176
          - border-radius: 3%
          - width: 330px
          - padding-left: 5px
          - z-index: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '7.0')
                  return '1';
                else
                  return '-1';
              ]]]
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - margin-top: '-10px'
          - color: lightgrey
        custom_fields:
          eclairage:
            - position: absolute
            - top: 25px
            - left: 20px
          plafonnier_texte:
            - position: absolute
            - top: 50px
            - left: 50px
          plafonnier_icone:
            - position: absolute
            - top: 75px
            - left: 55px
          buffet_texte:
            - position: absolute
            - top: 50px
            - left: 140px
          buffet_icone:
            - position: absolute
            - top: 75px
            - left: 145px
          vaisselier_texte:
            - position: absolute
            - top: 50px
            - left: 230px
          vaisselier_icone:
            - position: absolute
            - top: 75px
            - left: 235px
          volet:
            - position: absolute
            - top: 155px
            - left: 20px
          volet_down:
            - position: absolute
            - top: 140px
            - left: 70px
          volet_stop:
            - position: absolute
            - top: 140px
            - left: 140px
          volet_up:
            - position: absolute
            - top: 140px
            - left: 210px
          climatiseur:
            - position: absolute
            - top: 225px
            - left: 20px
          climatiseur_icone:
            - position: absolute
            - top: 210px
            - left: 100px
          climatiseur_texte:
            - position: absolute
            - top: 208px
            - left: 165px
          climatiseur_interrupteur:
            - position: absolute
            - top: 215px
            - left: 160px
          climatiseur_temp_texte:
            - position: absolute
            - top: 206px
            - left: 225px
          climatiseur_temp_down:
            - position: absolute
            - top: 220px
            - left: 212px
          climatiseur_temp:
            - position: absolute
            - top: 228px
            - left: 245px
          climatiseur_temp_up:
            - position: absolute
            - top: 220px
            - left: 292px
          temp_valeur:
            - position: absolute
            - width: 75px
            - top: 295px
            - left: 48px
          temp_icone:
            - position: absolute
            - width: 48px
            - top: 281px
            - left: 16px
          hygro_valeur:
            - position: absolute
            - width: 75px
            - top: 345px
            - left: 48px
          hygro_icone:
            - position: absolute
            - width: 48px
            - top: 331px
            - left: 16px
          ouvertures:
            - position: absolute
            - width: 130px
            - top: 295px
            - left: 165px
          baie_vitree_etat:
            - position: absolute
            - top: 325px
            - left: 165px
      tap_action:
        action: none
      hold_action:
        action: none
  carte_etage:
    card:
      type: custom:button-card
      name: Etage
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      styles:
        card:
          - background-color: rgba(128,128,128,1.0)
          - border: 2px outset darkgrey
          - aspect-ratio: 1/1.176
          - border-radius: 3%
          - width: 330px
          - padding-left: 5px
          - z-index: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '8.0')
                  return '1';
                else
                  return '-1';
              ]]]
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - margin-top: '-10px'
          - color: lightgrey
      tap_action:
        action: none
      hold_action:
        action: none
  carte_sous_sol:
    card:
      type: custom:button-card
      name: Sous-sol
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      styles:
        card:
          - background-color: rgba(128,128,128,1.0)
          - border: 2px outset darkgrey
          - aspect-ratio: 1/1.176
          - border-radius: 3%
          - width: 330px
          - padding-left: 5px
          - z-index: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '9.0')
                  return '1';
                else
                  return '-1';
              ]]]
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - margin-top: '-10px'
          - color: lightgrey
      tap_action:
        action: none
      hold_action:
        action: none
  carte_terrasse:
    card:
      type: custom:button-card
      name: Terrasse et piscine
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      styles:
        card:
          - background-color: rgba(128,128,128,1.0)
          - border: 2px outset darkgrey
          - aspect-ratio: 1/1.176
          - border-radius: 3%
          - width: 330px
          - padding-left: 5px
          - z-index: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '10.0')
                  return '1';
                else
                  return '-1';
              ]]]
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - margin-top: '-10px'
          - color: lightgrey
      tap_action:
        action: none
      hold_action:
        action: none
  carte_alarme:
    card:
      type: custom:button-card
      name: Alarme et sécurité
      entity: input_number.tableau_de_bord_carte_courante
      show_state: false
      show_icon: false
      styles:
        card:
          - background-color: rgba(128,128,128,1.0)
          - border: 2px outset darkgrey
          - aspect-ratio: 1/1.176
          - border-radius: 3%
          - width: 330px
          - padding-left: 5px
          - z-index: |
              [[[
                if (states['input_number.tableau_de_bord_carte_courante'].state == '11.0')
                  return '1';
                else
                  return '-1';
              ]]]
        name:
          - font-size: 0.9em
          - font-weight: bold
          - justify-self: start
          - align-self: start
          - margin-top: '-10px'
          - color: lightgrey
      tap_action:
        action: none
      hold_action:
        action: none
styles:
  card:
    - border: 1px solid darkgrey
    - box-shadow: 0px 0px 4px 2px inset darkgrey
    - background-color: rgba(240,240,240,1.0)
  custom_fields:
    acces:
      - position: absolute
      - left: 7px
      - top: 5px
    entree:
      - position: absolute
      - left: 91px
      - top: 5px
    couloir:
      - position: absolute
      - left: 175px
      - top: 5px
    cuisine:
      - position: absolute
      - left: 259px
      - top: 5px
    salon:
      - position: absolute
      - left: 7px
      - top: 89px
    chambre:
      - position: absolute
      - left: 91px
      - top: 89px
    sejour:
      - position: absolute
      - left: 175px
      - top: 89px
    etage:
      - position: absolute
      - left: 259px
      - top: 89px
    sous-sol:
      - position: absolute
      - left: 7px
      - top: 173px
    terrasse:
      - position: absolute
      - left: 91px
      - top: 173px
    alarme:
      - position: absolute
      - left: 175px
      - top: 173px
    carte_acces:
      - position: absolute
      - left: 7px
      - top: 257px
    carte_entree:
      - position: absolute
      - left: 7px
      - top: 257px
    carte_couloir:
      - position: absolute
      - left: 7px
      - top: 257px
    carte_cuisine:
      - position: absolute
      - left: 7px
      - top: 257px
    carte_salon:
      - position: absolute
      - left: 7px
      - top: 257px
    carte_chambre:
      - position: absolute
      - left: 7px
      - top: 257px
    carte_sejour:
      - position: absolute
      - left: 7px
      - top: 257px
    carte_etage:
      - position: absolute
      - left: 7px
      - top: 257px
    carte_sous_sol:
      - position: absolute
      - left: 7px
      - top: 257px
    carte_terrasse:
      - position: absolute
      - left: 7px
      - top: 257px
    carte_alarme:
      - position: absolute
      - left: 7px
      - top: 257px
tap_action:
  action: none
hold_action:
  action: none