Arrondi sous button-card

Bonjour
J’ai une incompréhension sur l’utilisation de Button card à partir de l’exemple sur la doc.
Plutôt que j’avoir une montagne de lignes avec des gauges, je voulais regrouper chaque chaque objet type VM ou serveur dans un button card.
Ca a pris forme, mais je butte sur le pourcentage.
image

J’ai essayé plusieurs solutions que j’ai pu trouvé comme Math.round, mais ca affiche Math.round sur le button.
Sur d’autres cards j’ai pu le faire facilement avec les template { }, mais la je ne comprend pas bien les histoires de [[[ ]]]

Si quelqu’un a une solution, je suis preneur !

Mon yaml est le suivant

yaml
square: true
type: grid
cards:
  - type: custom:button-card
    entity: binary_sensor.node_pve_status
    icon: mdi:check-circle
    aspect_ratio: 1/1
    name: Intel NUC
    styles:
      card:
        - background-color: '#FFFFFF'
        - border-radius: 10%
        - padding: 10%
        - color: '#333333'
        - font-size: 10px
        - text-transform: capitalize
      grid:
        - grid-template-areas: '"i i" "n n" "cpu cpu" "ram ram" "sd sd"'
        - grid-template-columns: 1fr 1fr
        - grid-template-rows: 1fr min-content min-content min-content min-content
      name:
        - font-weight: bold
        - font-size: 13px
        - color: black
        - align-self: middle
        - padding-bottom: 4px
      img_cell:
        - justify-content: center
        - align-items: start
        - margin: none
      icon:
        - color: |
            [[[
              if (entity.state == 'on') return 'green';
              else return 'red';
            ]]]
        - width: 80%
        - margin-top: 0%
      custom_fields:
        temp:
          - align-self: start
          - justify-self: end
        cpu:
          - padding-bottom: 2px
          - align-self: middle
          - justify-self: start
          - '--text-color-sensor': >-
              [[[ if (states["sensor.node_pve_cpu_used"].state > 80) return
              "red"; ]]]
        ram:
          - padding-bottom: 2px
          - align-self: middle
          - justify-self: start
          - '--text-color-sensor': >-
              [[[ if (states["sensor.node_pve_memory_used_percentage"].state >
              80) return "red"; ]]]
        sd:
          - align-self: middle
          - justify-self: start
          - '--text-color-sensor': >-
              [[[ if (states["sensor.node_pve_disk_used_percentage"].state > 80)
              return "red"; ]]]
    custom_fields:
      cpu: |
        [[[
          return `<ha-icon
            icon="mdi:server"
            style="width: 12px; height: 12px;">
            </ha-icon><span> CPU : <span style="color: var(--text-color-sensor);">${states['sensor.node_pve_cpu_used'].state}%</span></span>`
        ]]]
      ram: |
        [[[
          return `<ha-icon
            icon="mdi:memory"
            style="width: 12px; height: 12px;">
            </ha-icon><span> RAM : <span style="color: var(--text-color-sensor);">${states['sensor.node_pve_memory_used_percentage'].state}%</span></span>`
        ]]]
      sd: |
        [[[
          return `<ha-icon
            icon="mdi:harddisk"
            style="width: 12px; height: 12px;">
            </ha-icon><span> SD : <span style="color: var(--text-color-sensor);">${states['sensor.node_pve_disk_used_percentage'].state}%</span></span>`
        ]]]
columns: 4

Salut,
j’ai ca pour arrondir.

arrondie a 1 après virgule:

`${parseFloat(states['sensor.temperature_humidity_sensor_exterieur_av_temperature'].state).toFixed(1)}`

exemple:

    custom_fields:
      status: >
        [[[ return '<ha-icon icon="mdi:thermometer" style="width: 15px; height:
        15px; color: #44739e;"></ha-icon>' +
        `${parseFloat(states['sensor.temperature_humidity_sensor_exterieur_av_temperature'].state).toFixed(1)}`
        + ' °C' + ' <ha-icon icon="mdi:water-percent" style="width: 15px;
        height: 15px; color: #44739e;"></ha-icon>' +
        `${parseFloat(states['sensor.temperature_humidity_sensor_exterieur_av_humidity'].state).toFixed(0)}`
        + ' %'; ]]]
1 « J'aime »
.toFixed(1)

a ajouter collé a l’entité

Exemple :

          label: >
            [[[ return variables.temp_trend + (entity.state* 1).toFixed(1) +"°" 
            ]]]   
          label: >
            [[[ return entity.state.toFixed(1) ]]] 
          label: >
            [[[ return states['sensor.temperature_sejour'].state.toFixed(1) ]]] 
1 « J'aime »

@WarC0zes @herveaurel
Merci à vous deux.
image