Automation run modes - condition to check if automation is running?


I have an automation to turn on some lights if a motion sensor detects motion - classic stuff.
I have added a condition, so that the lights only turn on, when they are already on, but below a certain brightness value.
The action part basically does a ‘turn on - delay 5 minutes - return lights to dimmed state’.

I want to keep the lights on while the motion detector continues detect motion, so I added a ‘mode: restart’ to the automation.
However, subsequent triggers of the automation seem to also evaluate the ‘conditions:’ part, which will return false when the lights are full on.

I would need to add a clause like “... or the automation is already running” to the conditions block.
Is there a way to detect that this specific automation is already running?


You have the last triggered time, not great but it should work.
Compare the last triggered time with now and if it’s less than 5 minutes then it’s still running.

Good idea, I’ll try it that way!