Hi!
How do I add two values in a value_template?
value_template: '{{ value.split(" ")[0] }}'
And now i want to add a 0.009
The value is 1.30 and the result must be 1.309
value_template: '{{ value.split(" ")[0] + 0.009 }}'
Does not work
Hi!
How do I add two values in a value_template?
value_template: '{{ value.split(" ")[0] }}'
And now i want to add a 0.009
The value is 1.30 and the result must be 1.309
value_template: '{{ value.split(" ")[0] + 0.009 }}'
Does not work
How about this?
{{ (value.split(" ")[0] + 0.009) }}
Ah, thatโs right. But now I have the problem that the value is a string- can s.o show me how to transfer it to float? The other way how to add the 9 as as string.
Thank you
Try a float filter:
{{ (value.split(" ")[0]|float + 0.009) }}
Thank you! Great!