Automation not being triggered

I have created an automation through Lovelace with a trigger that looks like this:

This is supposed to turn a light off after 5 minutes. I left it 20 minutes and the light didn’t turn off. I then clicked on ‘Execute’ and the light turned off. From what I’ve read, this means that the action is working but the trigger isn’t.

Can anyone point me in the right direction please.

Can you show us what the entity is called and how it looks from the states page?
Also what the different states are.

Strangely, I just checked it again and the lights have turned off. Does it take a bit of time for HA to sync itself when something new is created?

Depends on how long it takes you to restart Home Assistant or reload the automations yaml :wink:

1 Like

Ah! I didn’t do either. Lesson learned

I have a similar problem with the following automation i made. It does not seem to trigger. Any suggestions?

  alias: Fountain Timer
  description: Turns off pump in 1 hour
  trigger:
  - entity_id: switch.sonoff_1000b7c31b
    for: 3 minutes
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data: {}
    entity_id: switch.sonoff_1000b7c31b
    service: switch.turn_off

I think it’s your for: that is wrong. You need either:

for: "00:03:00"

or:

for:
  minutes: 3

Reference

1 Like