#Why is timer active for x seconds not working?

1 messages · Page 1 of 1 (latest)

unkempt ginkgo
#
trigger: state
entity_id:
  - timer.ac_living_room_timer
to: active
for:
  hours: 0
  minutes: 0
  seconds: 5

After i start the timer, the above trigger is not firing after 5 seconds. No trace can be found.

vague compass
#

Is it transitioning between states or was timer already running when u fired it?

vague compass
#
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
unkempt ginkgo
#

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.

vague compass
#

I think the problem has to be found rather than this workaround

shadow slate
#

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

vague compass
#

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