Hello,
I’m using this part of code inside a card:
custom_fields:
battery: |
[[[
if (states["sensor.m2007j22g_battery_state"].state == "charging")
return `<ha-icon
icon="mdi:battery-charging"
style="width: 20px; height: 20px;"></ha-icon
<span>${states['sensor.m2007j22g_battery_level'].state}%</span>`
]]]
In the <span> tag, which is the command to use in order to choose the character dimension of battery level (XY%)?
2 posts - 2 participants