Hi everyone, i need a template sensor that multiplies 60.27 per the days elapsed since 16 february 2022, how could i do it?
The following will acount for whole days.
{{ 60.27 * (now() - "2022-02-16"|as_datetime|as_local).days }}
If you need to keep it to 2 decimals, make sure to add a round()
filter
{{ (60.27 * (now() - "2022-02-16" | as_datetime | as_local).days) | round(2) }}
1 Like
Thanks!
So simple yet so effective