- service: input_datetime.set_datetime
data:
timestamp: >
{{ (today_at('12:00:00') + timedelta(hours = states('input_number.piscine_nombre_fonctionnement_heure') | float(0))).timestamp() }}
target:
entity_id: input_datetime.piscine_debut_periode
If that fails to work (potentially because the template reports a timestamp value that includes the current date) then use this one:
- service: input_datetime.set_datetime
data:
time: >
{{ (today_at('12:00:00') + timedelta(hours = states('input_number.piscine_nombre_fonctionnement_heure') | float(0))).strftime('%H:%M:%S') }}
target:
entity_id: input_datetime.piscine_debut_periode