Having not used the GUI before, I assume that is state, condition, action; you can’t use the delay as a condition. You could put it in the action section, but that logic doesnt work as it’s not measuring if the light is on for x seconds, but just waiting that time and turning it off; maybe it doesnt matter though.
The Automation Editor, in its current form, doesn’t support all available automation capabilities (compared to creating an automation using a text editor). Creating templates is the Automation Editor’s weak spot. This is unfortunate because to create a more sophisticated automation usually requires templating.
It really should not be this way but it seems to be difficult to attract developers to volunteer their time to improve the Automation Editor.
FWIW, the openHAB community was faced with a similar challenge (to improve their Rule Editor). Here’s one proposal that, although it wasn’t implemented, provides a fresh approach to the challenge. The left hand pane shows the available options for triggers, conditions and actions, the central one is where the rule is composed, and the right hand pane presents documentation for whatever you are using (but the right hand pane can optionally be hidden).
Thanks. I didn’t mention it, that’s just 3 actions following each other. Condition is time etc …
As @francisp mentioned the problem seems to be that delay doesn’t take templates. I now set it to “minutes: 5” and this is working.
The example you posted is way over my head
Actually, delaydoes accept templates (see last two examples in the documentation). The problem is what I stated above, the Automation Editor doesn’t support that capability. It’s a limitation of the Automation Editor, not delay.
If you compose your automation using a text editor, you’ll see that delay does support templates.
Ah ok. So then I’ll write the automation by myself (as i did it since the very beginning). Could someone please tell me if my template looks correct? Does it need some more indents or less?
Just in case someone noticed: This automation was changed from the original one for testing purposes (minutes instead of hours) and switching on a light instead of a pump …
Now changing this back to what it’s supposed to be.
What are you trying to achieve, that looks like every minute the automation is going to kick off, and turn on the light for x seconds and then turn off.
You originally described wanting to wait for the switch to turn on, then wait x seconds before turning off. What you’ve done above wont work that way.
Two possibilities: a) I didn’t describe correctly what i wanted to acchieve, or b) you didn’t understand it
Just joking …
It does exactly what I want it to do: Turn on the switch, let it runs for x seconds/minutes and then turn it off again. What i posted was the outcome of the test I did. Waiting for 2h to see it my automation would work seemed a bit stupid. So I changed the automation for once a minute and turn on time to seconds instead of minutes.
The actual Solution to the original problem is that you cannot use the Automation Editor to create templated delays; you have to use a text editor. That is the answer to your original question. Whatever automation you ultimately produce isn’t the answer to your original question.
I can’t ride this bike.
That’s because the chain fell off the main gear. Put the chain back on.
I put the chain on and drove the bike to the store and that’s the Solution!
I guess it’s ME only that can answer that question as i asked it. ;), and I took your reply and solved my problem. I just don’t get the point of your comment…
The SOLUTION to my problem is posted in #8 - turn off a switch after a given time.
Consider someone who reads your first post. There’s no automation posted there. It contains three fragments of an automation and the observation that “It turns on, but never off”.
The cause of why it never turned off is because you can’t template delay in the Automation Editor.
If the user clicks the Solution link in the first post they are led to your post which contains no explanation why delay failed to work in your first post but somehow now works in the so-called Solution post.
Your post is simply an example of the solution’s application but not the actual solution (i.e. explanation of why the problem occurred and how to mitigate it).
In fact, you even admitted the cause of the problem:
As @francisp mentioned the problem seems to be that delay doesn’t take templates.
Except delay does accept templates, just not via the Automation Editor.