I'm looking to have a script/automation that does something in a loop (play an audio file) until some state changes based on activity of a human.
To make sure this can run somewhat safely I want this to have a timeout.
Similar to how the actions to wait for a state to occur have a timeout, I want a timeout on the loop condition.
Is there a reasonable way to build this? I was thinking maybe with a helper that gets set before the loop is entered and a time condition (or templated) but it seems annoying to need a helper per script that behaves this way