Timer.finished not working anymore

I think since 2024.4.0 my automations don’t trigger on timer.finished.

The automation works otherwise, but the trigger is not. Nothing in the logs.

Is that a known issue? I am on 2024.4.1 now.

alias: test
description: ""
trigger:
  - platform: event
    event_type: timer.finished
    event_data:
      entity_id: timer.timer_1
  - platform: homeassistant
    event: start
condition:
  - condition: state
    entity_id: timer.timer_1
    state: idle
action:
  - service: fan.turn_off
    data: {}
    target:
      entity_id: fan.1
mode: single

Just checked my logs but I have no such trouble for both 2024.4.0 and 2024.4.1 so that is weird. Are you sure that is it?

I do not understand your timer idle condition though. Why would you check for whatever state you thiink the timer has after a timer finishes? You already know it just finised. If you think it might have started again you would most likely not catch it here anyway.

1 Like

Not sure but I didn’t change anything else.

The check is for home assistant startup, in case the timer finished while restarting.

Did you check the trace?

There’s a check in a timer if it should restore on startup or not. If you don’t want running timers to survive a restart just uncheck it?

If I remove the condition it works. Weird that it worked for over a year now.

I guess restoring the timer should work. Thanks for pointing that out.

1 Like

Btw. I do have other conditions like that, that work.

This issue also appeared for me in 2024.4.0 across all automations that are triggered by timer.finished. The automations work fine when i revert back to 2024.3.3.

From what I can tell, when the timer.finished event is fired, the timer’s state is still active.

Automation:

- id: '1648808546330'
  alias: Toilet Timer End
  description: ''
  trigger:
  - platform: event
    event_type: timer.finished
    event_data:
      entity_id: timer.toilet
  - platform: state
    entity_id:
    - binary_sensor.toilet
    to: 'off'
    from: 'on'
    for:
      hours: 0
      minutes: 0
      seconds: 10
  condition:
  - condition: and
    conditions:
    - condition: state
      entity_id: binary_sensor.toilet
      state: 'off'
    - condition: state
      entity_id: timer.toilet
      state: idle
  action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.toilet
  mode: single

Trigger:

platform: event
event_type: timer.finished
event_data:
  entity_id: timer.toilet

Condition Trace:

Executed: April 7, 2024 at 7:23:58 PM
Result:

result: false

conditions/0
Executed: April 7, 2024 at 7:23:58 PM
Result:

result: true

conditions/0/entity_id/0
Executed: April 7, 2024 at 7:23:58 PM
Result:

result: true
state: 'off'
wanted_state: 'off'

conditions/1
Executed: April 7, 2024 at 7:23:58 PM
Result:

result: false

conditions/1/entity_id/0
Executed: April 7, 2024 at 7:23:58 PM
Result:

result: false
state: active
wanted_state: idle

conditions/1 should be true because it was triggered by the timer.finished event

I’ve raised a bug here: timer.finished is triggered with the timer state set to active · Issue #115087 · home-assistant/core · GitHub

1 Like

The purpose of the idle check was to deal with the scenario where a restore mode timer might expire while homeassistant is not running. As the timer.finished event does not fire on restart the automation is launched by the homeassistant.start event. The timer state is reset to idle during startup before the homeassistant.start event if the timer expired.

Looks like the original behavior will be restored in 2024.4.2.

1 Like

I confirm it works again.

Important: The timer state needs to be checked at startup - otherwise it won’t trigger. I guess it restores the timer after startup but doesn’t trigger if the timer finishes while HA is offline.

So idk if this is a new issue but I am currently having issues with the timer.finished event. It doesn’t trigger. Ever. It just doesn’t work. I’m fairly certain it’s like malfunctioning. Also real question
Why is the timer event only available via an event? And not through a regular GUI type thingy?






I’m not entirely sure what I need to do for this to work. Traces doesn’t show anything on the automations. I’m pretty sure that either the code for a trigger I used is wrong or something is wrong with home assistant itself because I just reinstalled everything from scratch and set it all back up to ensure I didn’t have any issues
(my backups were reaching over 8gb which was unacceptable.)

It’s very hard to follow screenshots. Perhaps export the YAML and paste it correctly formatted.

How are you starting the timer and are you running it until normal completion? Can you show the state history for the timer?

I’m not sure what you mean by “thingy”, but if you’re asking why it isn’t a state, then it’s because this really is an event. It’s when the timer goes from active to idle. Those last two are the timer’s states, but it doesn’t tell you how it got there — it could’ve been cancelled or finished normally. But if you don’t care about that, you could have a state trigger and use “idle” as the state.

1 Like

Not sure what’s going on but this is the same problem and same solution as this thread

Are @jatgm1 and @anon88759339 the same person?

Short summary is the event is all lowercase. Timer.finished will never trigger.

3 Likes

Lol ya I thought a funnier name would Garner a faster response because people will be like “lol butt stuff and threesomes”. Seems to have worked idk. Random sex related expletives tend to be fairly attentive grabbing I think.

And an obsession of yours, it seems.

The rationale does’t help the case, I can imagine a whole lot of people who weren’t already ignoring you for the crude name itself will now permanently ignore you for the reason you chose it.