Hi, I’m struggling with a value template and wonder if anyone can help me? I’ve tried a fair bit and read through the jinja documentation but I’m new to it so think I’m missing something! So far I’ve got:
value_template: >-
{%- set line = value.split("\r\n") -%}
{{ (line[2] }}
Which gives me a state of:
dev/md0 3.6T 506G 3.1T 14% /mnt
All I actually want though is the “14%” part as the state. I’ve tried a few things, split using &nsbp, things like that but I’m either barking up the wrong tree or I’m getting the formatting wrong because it’s not working!