Addition of times

Hi everybody,

I try to add few hours but without success :persevere:

I wanna do 07:38 + 50 minutes => normally it should be at 08:28
or 07:38 (the time) + 1:53 (in duration)

nothing works…

Do you have a solution?

Thank you !!!

A quick search provides …

There are various others as well :slight_smile:

This automation takes the time from an input_datetime and takes 15 minutes off it…

automation:
  alias: Alarm clock - Bedroom
  initial_state: on
  trigger:
    platform: template
    value_template: "{{ states('sensor.time') == (((state_attr('input_datetime.bedroom_alarm_clock_time' , 'timestamp')) - (15 * 60))|timestamp_custom('%H:%M', false)) }}"
  condition:
    - condition: state
      entity_id: group.phone_trackers
      state: 'home'
    - condition: state
      entity_id: input_boolean.bedroom_alarm_clock_status
      state: 'on'
  action:
    service: script.bedroom_wake_up

It’s part of an alarm clock package, so if the weather is bad it wakes me up 15 minutes early, if not wakes me on time…

link removed

Hope this helps.

1 Like

thanks I’ll have a closer look

cheers