Automation for input_datetime.set_datetime

Hi,
I wanted to set the value of “input_datetime.calendario_data_fine” using the state of “input_datetime.calendario_data_inizio” plus 1 day.
I tried different approaches but to no avail…like this:

action: input_datetime.set_datetime
metadata: {}
target:
  entity_id: input_datetime.calendario_data_fine
data:
  date: "{{ (strptime(states('input_datetime.calendario_data_inizio'), '%Y-%m-%d') + timedelta(days=1)) }}"

Found the problem: the string is correct, but “datetime” should be inserted and not “date”. I’m writing it for future reference. :slight_smile:

action: input_datetime.set_datetime
metadata: {}
target:
  entity_id: input_datetime.calendario_data_fine
data:
  datetime: "{{ (strptime(states('input_datetime.calendario_data_inizio'), '%Y-%m-%d') + timedelta(days=1)) }}"