WTH can't I add time to a running timer?

I want to have a button/action that simply adds 30 minutes to a running timer.
That way I can, for instance, disable my porch camera for the time I expect not to get notifications.

But you can’t ADD time to a timer past the duration it was originally created with.

I didn’t know this was a restriction until now. So I’ve voted for this. But until it gets changed, you can use the timer.start action and a template, like this:

action: timer.start
target:
  entity_id:
    - timer.my_timer_entity
data:
  duration: >
    {% set seconds_to_add = 60 %}
    {% set now_dt = now() %}
    {% set finish_at = state_attr('timer.my_timer_entity', 'finishes_at') | as_datetime(now_dt) %}
    {{ (finish_at - now_dt).total_seconds() + seconds_to_add }}

I would like to the this possible in more info view of a timer. :+1:

I spent hours trying to figure out why I couldn’t add time to a timer, then I found:

And how I’m working around it now:

      - alias: Start or add 30 minutes to Camera-Disable Timer
        if:
          - condition: state
            entity_id: timer.camera_disable_timer
            state: active
            for:
              hours: 0
              minutes: 0
              seconds: 0
        then:
          - action: timer.start
            metadata: {}
            target:
              entity_id: timer.camera_disable_timer
            data:
              duration: >
                {{ (state_attr('timer.camera_disable_timer', 'finishes_at') |
                as_datetime - now() + timedelta(minutes=30)).total_seconds() |
                round(0) }}
            alias: Add 30 minutes to timer
        else:
          - alias: Set it really high
            action: timer.start
            metadata: {}
            data:
              duration: "60:30:00"
            target:
              entity_id: timer.camera_disable_timer
          - action: timer.change
            metadata: {}
            data:
              duration: "-60:00:00"
            target:
              entity_id: timer.camera_disable_timer
            alias: Reduce it by all but 30 minutes

Yes, good idea. I can make a workaround automation but it would be so much better if it was a default feature of every timer!

This would be simpler, like I proposed above…

    - alias: Start or add 30 minutes to Camera-Disable Timer
      action: timer.start
      target:
        entity_id: timer.camera_disable_timer
      data:
        duration: >
          {% set minutes_to_add = 30 %}
          {% set now_dt = now() %}
          {% set finish_at = state_attr('timer.my_timer_entity', 'finishes_at') | as_datetime(now_dt) %}
          {{ (finish_at - now_dt).total_seconds() + 60*minutes_to_add }}
1 Like

I’ll definitely try that next time I have a moment!