Hello,
I’m building a bar-card in order to monitor the memory use of the Odroid board where I installed home assistant.
I used this portion of code, where I defined a config card template with the variables:
id: odroidn2_status
type: custom:config-template-card
variables:
- states['sensor.home_assistant_host_disk_total'].state
- states['sensor.home_assistant_host_disk_used'].state
- states['sensor.system_monitor_memory_use'].state
- states['sensor.home_assistant_core_cpu_percent'].state
- states['sensor.system_monitor_processor_temperature'].state
entities:
- sensor.home_assistant_host_disk_total
- sensor.home_assistant_host_disk_used
- sensor.system_monitor_memory_use
- sensor.home_assistant_core_cpu_percent
- sensor.system_monitor_processor_temperature
and this one where I defined the name of the card:
- type: custom:bar-card
show_icon: true
icon: mdi:memory
align: split
columns: 1
max: 100
positions:
icon: outside
indicator: inside
unit_of_measurement: '%'
severity:
- color: '#3f921b'
from: 0
to: 49.9
- from: 50
to: 74.9
color: '#c5af1a'
- from: 75
to: 94.9
color: '#ffa500'
- from: 95
to: 100
color: '#ff0000'
card_mod:
style: |
ha-card {
--ha-card-border-width: 0px;
}
bar-card-currentbar, bar-card-backgroundbar{
border-radius: 10px;
}
bar-card-name {
font-size: 11px;
}
entities:
- entity: sensor.system_monitor_memory_usage
name: ${ 'RAM (' + vars[2] + 'Gb/4 Gb)' }
entity_row: true
But the card shows me the following:
Is there a way to avoid that long number and keep “1.9” or at least “1.95”? How could I round into the name bar-card?