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.
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
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.
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.