Automation - set date time helper with time helper value

Hello all,

for all my lights and other switched devices I use a date/time-helper to get a delay function. One example:

service: input_datetime.set_datetime
metadata: {}
data:
  timestamp: "{{ (now() + timedelta(minutes=3)).timestamp() | int(0) }}"
target:
  entity_id: input_datetime.flur_ug_licht

Instead of writing “minutes=3” in the code on all places I use this, I want to use a time helper HH:MM:SS for that.

Any hint how I can do this?

Thanks and best regards,
Benny

service: input_datetime.set_datetime
metadata: {}
data:
  timestamp: |
    {% set (h,m,s) = states('input_datetime.time_only').split(':') | map('int', 0) %}
    {{ (now() + timedelta(hours=h, minutes=m, seconds=s)).timestamp() | int(0) }}
target:
  entity_id: input_datetime.flur_ug_licht