Reschedule yearly events (datetime helpers) using automations

I’ve added some automations and scripts I only want to trigger on yearly or monthly events. Such as for instance birthdays.

I’ve added datetime helpers with the scheduled birthdays to home assistant. However, when they are in the past I need to reschedule them for next year.

I was thinking about adding all yearly datetime helpers to an automation with a time trigger and a list of all the datetimes as in

platform: time
at:
  - input_datetime.birthday_1
  - input_datetime.birthday_2
  - input_datetime.yearlyevent_1
  - input_datetime.yearlyevent_2

and then template an action like

service: input_datetime.set_datetime
entity_id: {{trigger.entity_id}}
data_template:
      datetime: "{{ (now()+timedelta(years=1).strftime('%Y-%m-%d %H:%M:%S') }}"

However from what I read from documentation trigger.entity_id does not exist when using time triggers

Anyone else have an idea for this?

Nevermind apparently this works:

service: input_datetime.set_datetime
data:
  entity_id: '{{ trigger.entity_id }}'
  datetime: >-
    {{ now().strftime('%Y-%m-%d %H:%M:%S') | replace(now().year, now().year+1)
    }}