Bonsoir,
J’essais de mettre en place le monitoring de mon HassOs avec button-card, mais j’ai un soucis avec certaines valeurs comme la température et l’utilisation de la mémoire.
Qu’elle est la méthode pour avoir les bonnes valeurs ?
Je suis sur un nuc intel
type: custom:button-card
entity: sensor.cpu_temperature
icon: mdi:raspberry-pi
aspect_ratio: 2/2
name: HassOS
styles:
card:
- background-color: '#000022'
- border-radius: 10%
- padding: 10%
- color: ivory
- font-size: 10px
- text-shadow: 0px 0px 5px black
- text-transform: capitalize
grid:
- grid-template-areas: '"i temp" "n n" "cpu cpu" "ram ram" "sd sd" "network network" '
- 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: white
- align-self: middle
- justify-self: start
- padding-bottom: 4px
img_cell:
- justify-content: start
- align-items: start
- margin: none
icon:
- color: |
[[[
if (entity.state < 60) return 'lime';
if (entity.state >= 60 && entity.state < 80) return 'orange';
else return 'red';
]]]
- width: 70%
- margin-top: '-10%'
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.processor_use_percent"].state > 80) return
"red"; ]]]
ram:
- padding-bottom: 2px
- align-self: middle
- justify-self: start
- '--text-color-sensor': '[[[ if (states["sensor.memory_use"].state > 80) return "red"; ]]]'
sd: |
[[[
return `<ha-icon
icon="mdi:harddisk"
style="width: 12px; height: 12px; color: deepskyblue;">
</ha-icon><span>SD: <span style="color: var(--text-color-sensor);">${states['sensor.disk_use'].state}%</span></span>`
]]]
network: |
[[[
return `<ha-icon
icon="mdi:network"
style="width: 12px; height: 12px; color: deepskyblue;">
</ha-icon><span>Network: <span style="color: var(--text-color-sensor);">${states['sensor.ipv4_address_eth0'].state}%</span></span>`
]]]
D’avance merci