#Why is timer active for x seconds not working?
1 messages · Page 1 of 1 (latest)
Is it transitioning between states or was timer already running when u fired it?
triggers:
- trigger: state
entity_id:
- timer.test_timer
to: active
for:
hours: 0
minutes: 0
seconds: 5
was triggered after 5 seconds after I pressed the start (timer was 10 minutes set). It went from idle to active
and log (excluding this as it is pointless here I think)
trigger:
id: '0'
idx: '0'
alias: null
platform: state
entity_id: timer.test_timer
from_state:
entity_id: timer.test_timer
state: idle
attributes:
duration: '0:10:00'
editable: true
friendly_name: test_timer
last_changed: '2025-09-18T11:11:34.760772+00:00'
last_reported: '2025-09-18T11:11:34.760772+00:00'
last_updated: '2025-09-18T11:11:34.760772+00:00'
to_state:
entity_id: timer.test_timer
state: active
attributes:
duration: '0:10:00'
editable: true
finishes_at: '2025-09-18T11:21:36+00:00'
remaining: '0:10:00'
friendly_name: test_timer
last_changed: '2025-09-18T11:11:36.419960+00:00'
last_reported: '2025-09-18T11:11:36.419960+00:00'
last_updated: '2025-09-18T11:11:36.419960+00:00'
for:
__type: <class 'datetime.timedelta'>
total_seconds: 5
attribute: null
Was idle. Then went active.
And started counting from 0 to....more
I fixed it by using a binary boolean helper instead of a timer, but still weird the timer active was not working.
I think the problem has to be found rather than this workaround
You sure you had the correct entity_id?
There likely isn't a problem
the state trigger for code as old and hasn't been updated. If it didn't work for timer it wouldn't work for any entity/state combo
it's agnostic to the entity type
timer is a helper too, so the states are set by HA, the only likely scenario here is a mistake by OP
sure, that's my point. Find the problem, I think it is either wrong entity id or timer was active before... so state didn't change