Timer Documentation Help

Hi maybe a silly question but im not quite sure what it means.

In the Timer Documentation a Note states :-

Timers will be restored to their correct state and time on Home Assistant startup and restarts when configured with the restore option.

However, automations using the timer.finished event will not trigger if the timer expires when Home Assistant is not running.

What does the last line mean? do timers still run during a restart ? How can they expire when HA is not running?

thanks

Home assistant can work out how long it was stopped for after it restarts and can adjust timers that were running by that amount.

Example 1:
You have a timer started and it runs for 30 minutes but you shut down home assistant for 5 minutes.

When you restart home assistant the timer will be restored and keep running and be adjusted for the missing 5 minutes, any automations that trigger on the timer finishing will work.

Example 2:
You have a timer started and it runs for 30 minutes but you shut down home assistant for an hour.

When you restart home assistant the timer will be restored as finished but it will not trigger any automations that look for the timer finishing.

Ok that makes sense then. It must be using time stamps as a reference for timers then i thought it was a stand alone timer like in a plc that would only run when the system was running. Thanks for the clarification

It would be nice if there was another event that that triggered if the timer had finished when HA had restarted like a timer time elapsed. As a second option to trigger automations. Might see one in the future :grin:

The trouble with this is that your automation won’t know how long ago the timer was supposed to have finished and it could lead to unexpected results.

If this is likely to be an occurrence for you, you might be able to do something with the homeassistant stated event.

e.g. home assistant stated trigger → is timer finished but motion light / pool pump / whatever still on condition? If so, turn it off as the action.