Hello people,
Is it possible to use an input_datetime.datehelper instead of the date in the template below?
value_template: '{{ (( as_timestamp(now()) - as_timestamp(strptime("01.08.2023", "%d.%m.%Y")) ) / 86400 ) | round(2) | int}}'
Hello people,
Is it possible to use an input_datetime.datehelper instead of the date in the template below?
value_template: '{{ (( as_timestamp(now()) - as_timestamp(strptime("01.08.2023", "%d.%m.%Y")) ) / 86400 ) | round(2) | int}}'
yes
value_template: "{{ (now() - states('input_datetime.your_datetime') | as_datetime | as_local).days }}"
Just replace input_datetime.your_datetime
with your input datetime’s entity_id.
Thanks it’s working