Hello together,
although there are already hundreds of threads about this topic, I just can’t get ahead.
I want to create a helper automation for the alarm clock. As soon as Android’s _next_alarm is updated, the automation should take the new alarm time, subtract 5 minutes and store it in the helper input_datetime.alarmminusmin.
I just can’t manage to subtract 5 minutes. I have already tried several solutions, unfortunately without success. Since the data type at the end is a string, this is more difficult than I thought…
alias: Wecker_Hilfsautomatisierung
description: ""
trigger:
- platform: template
value_template: >-
{{ now() - states.sensor.poco_f2_pro_nachster_wecker.last_changed >
timedelta(seconds=1) }}
enabled: true
condition: []
action:
- service: input_datetime.set_datetime
data:
datetime: >-
{{ as_timestamp(states('sensor.poco_f2_pro_nachster_wecker'))
|timestamp_custom('%Y-%m-%d %H:%M:00') }}
target:
entity_id: input_datetime.alarmminusmin
mode: single