Timer reset/restart

To reset or restart an active timer while it is running … it is necessary to cancel and start the timer. This will result in an unwanted CANCEL event before the timer gets active again.

Can we have a reset/restart functionality for TIMER to reset the clock to the start time keeping the status as active?

This is already possible by triggering the start service again.

Starts or restarts a timer with the provided duration. If no duration is given, it will either restart with its initial value, or continue a paused timer with the remaining duration.

https://www.home-assistant.io/components/timer/

Yes, I have tried this … but the timer always continues with the remaining time… it never does a restart for me

xx_Nexus_xx is right, the timer actually does restart, but the time remaining in the frontend is still the time of the first period (not restarted).
Even though the timer have been successfully restarted, the frontend display the wrong value.

Same experience here. When restarting a running timer, I would expect the timer to display a new countdown in the frontend, but it doesn’t. But in the background it is indeed restarted, only not displayed in the frontend.

Sounds like a bug, submit a PR

It’s also not working with the latest version (0.88.2 atm). But I found a workaround.

Solution is to cancel the timer before (re)starting.

Here’s an example of motion_sensor1 which, after have been triggered,
will turn light1 on for 2 minutes.

configuration.yaml:

timer:
  timer_light1:
    duration: '00:02:00'

automation.yaml:

- id: '0000000000001' 
  alias: Motion Sensor1 Triggered
  trigger:
  - entity_id: binary_sensor.motion_sensor1
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      brightness_pct: 10
      entity_id: light.light_1
    service: light.turn_on
  - data:
      entity_id: timer.timer_light1
    service: timer.cancel
  - data:
      duration: 00:02:00
      entity_id: timer.timer_light1
    service: timer.start
  - data:
      message: (re)started
      name: 'Timer for Light1: '
    service: logbook.log
  initial_state: 'on'

- id: '0000000000002'
  alias: Timer Light1
  trigger:
  - event_data:
      entity_id: timer.timer_light1
    event_type: timer.finished
    platform: event
  condition: []
  action:
  - data:
      entity_id: light.light_1
    service: light.turn_off
  initial_state: 'on'

Like puk1966, I also had to cancel and start the timer to update the duration on an active timer (push time zero into the future) in version 0.92. I consider this a work around since this segments timer’s active state in history graphs rather showing a continuous active state.

I had the same experience, I cannot restart a timer.

System Health

item value
arch x86_64
dev false
docker true
hassio true
os_name Linux
python_version 3.7.3
timezone America/New_York
version 0.94.3
virtualenv false

Cancel and re-start is not an option, that will complicate automations.

My use case is a count down timer to turn off a light, every time there’s motion reset the timer. This way I don’t have lingering and overlapping automations.

I would have (2) Automations and one timer per light:
(1) Turn on the light and start (or restart) the timer on motion
(2) automation to turn off the light when the timer hits zero

The timer would vary based on the use of the room, living room set higher (10m) because you sit idle, working area of a kitchen lower (2min), because you’re constantly moving.

~Todd

Yes, that use-case sound very familiar, but I have sorted it out in Node-Red

Nor quite ready for that plunge!

I started with baby-steps myself, but did the full transition after a few weeks of getting to know NR