How to make a little more complicate Input Datetime automation

Hi,

i have an automation/reminder in my HA to alert me when my car MOT is expired:

automation:
trigger:
 -platform: time
  at: input_datetime.mot_mercedes

- service: script.notify_engine
  data:
    who: 'axydas_mob'
    title: '*TITLE*'
    value1: 'MESSAGE'
    value2: 'MESSAGE'
    value3: 'MESSAGE'
    tag_id: 'mot_alert'
    sticky: 'true'
    group: ha_helper
    color: '#ff8c0'

I want a more complicate automation. I want to get the alert 30, 20 and 10 days before the expiry date. I do not want to create more datetime helpers to do that. I want to use a single automation.

Anyone who can help me to do the automation?

Thanks in advance

One way would be to create three template sensors that are the value of the input_datetime minus 10 days, 20 days & 30 days. Then you could add those to the time trigger:

template:
  sensor:
  - name: Mot Mercedes minus 10 days
    state: >
      {{ (states.input_datetime.mot_mercedes.attributes.timestamp - 10*24*60*60) | timestamp_local }}
    device_class: timestamp
  - name: Mot Mercedes minus 20 days
    state: >
      {{ (states.input_datetime.mot_mercedes.attributes.timestamp - 20*24*60*60) | timestamp_local }}
    device_class: timestamp
  - name: Mot Mercedes minus 30 days
    state: >
      {{ (states.input_datetime.mot_mercedes.attributes.timestamp - 30*24*60*60) | timestamp_local }}
    device_class: timestamp
automation:
- trigger:
  - platform: time
    at:
    - input_datetime.mot_mercedes
    - sensor.mot_mercedes_minus_10_days
    - sensor.mot_mercedes_minus_20_days
    - sensor.mot_mercedes_minus_30_days
...

Thanks a lot!!!