Restore active/paused timers after a restart

To my knowledge, homeassistant.reload_config_entry is for reloading items listed in the config_entry registry.

Are you using that service call to explicitly reload the timer integration (and why)?

Un grand merci pour ça !

1 Like

FYI I have opened a PR to support this natively: Allow timer state to be restored on restart by raman325 · Pull Request #67658 · home-assistant/core · GitHub

The implementation differs slightly from your solution but I think it’s a sensible choice (obviously, since I wrote it :grinning_face_with_smiling_eyes: )

EDIT: Merged and part of 2022.4!

3 Likes

Can anyone help me understand this please? I’m a rookie in this input_text automation.
I have this code:

input_text:
  timers_active:
  timers_paused:

This is in automation:

- id: '1678043263387'
  alias: timers_save
  description: ''
  trigger:
  - platform: state
    entity_id:
    - timer.rodi_water
  condition: []
  action: []
  mode: single
- id: '1678043335545'
  alias: timers_restore
  description: ''
  trigger:
  - platform: state
    entity_id:
    - timer.rodi_water
  condition: []
  action: []
  mode: single

The first post in this topic indicates the presented technique has been deprecated and no further support will be provided.

This is the solution I’ve been looking for a long time, great!

All of my lighting automations use timers. If HA is restarted while the timers are less than 40 seconds, all lights stayed on and the timers were not renewed.

This solution fixes the problem. I think this is a great work around for timer.finished event cannot be catched at startup of Home Assistant if timer ended while Home Assistant was down. · Issue #79145 · home-assistant/core · GitHub
But I think the comment (an active or paused timer entity can be restored after a restart) in the first post regarding the timer restart might be misleading.

The comment was based on how the a timer’s restore option was originally described in the Pull Request that implemented it and in its documentation.

image

If it fails to behave as per its PR and documentation then it’s a bug. Your link indicates it was reported almost 7 months ago but, unfortunately, it never attracted the attention of anyone willing to fix it. That’s a shame because it’s a very useful feature.

hi,
i still using active timers and getting errors after a restart. (the old version)
do i need to change anything (from the beginning i saw that there is no need)
and just disable it ?
Thanks