I have an automation (to start a Fan). A timer running for e.g. 20 minuttes. But then I want to stop the Fan, by pressing a buttom. How can I stop the origional automation containing the timer. Seems like when the timer is running and I stop it from another automation, then I can’t turn on the Fan again (think the delay from first automation are still running). I haven’t done any programming i YAML, my automation are done from front-end-visuel-editor.
“normal use”
Trigger: Turn On button by single press
turn on switch (power to Fan)
wait 20 minuttes
turn off
Whats the issue why you just don’t leave it as is?
The timer ends and turns the fan off. If you turned it off before using the button, nothing will happen, right?
This is for a Fan in my bathroom. Normal use it should turn on Fan when the humidity is high, and then run for e.g. 20 minuttes. And this works perfect. But if I want to go to bed and sleep, then I don’t want the noise from the Fan, and therefore I want to press a button to turn off the Fan before the 20 minuttes delay have terminated. And this might work as I expect. But if I by mistake press the button then the Fan stop, but then I cant start the Fan again.
Thanx, but if I want to use a Timer then I need to code in YAML, right ? Can this be done from HA visuel-editor ?
I can find at “Timer” and start, finish, reload etc. but if I select the Timer from visuel-editor then I don’t get much help, like the delay where I can select the time in e.g. minuttes. The “Timer” do I understand that as a Timer or a condition/label for HA to “read the status from”.
Sorry, but I have not done any advanced programming in HA yet
You would need to share what it is you are actually doing to “stop it from another automation”. My guess would be that you used the automation.turn_off action without understanding how it actually works. While that action will stop a running automation, it also disables the automation’s triggers until it is turned back on.
Generally it is best practice to avoid using long delays.
I think what you may be missing is that you need to create a Timer entity in the Helper menu first. The timer actions like timer.start that are found in the Automation editor require a Timer entity to act on. Once that is done, you just select the Timer under Target, check the “duration” box, and type in the duration:
No, you don’t need to “code in YAML”. Pretty much everything that can be done in an automation, can be set up using the visual Automation Editor. The reason the examples you see here are in YAML is because it is the only efficient way for multiple people to share and edit automations and other configuration. Passing multiple screenshots back and forth takes a lot of time and means that each party has to manually retype everything, which is slow and error prone.
To trigger off a Timer, you will need to select “Manual Event” from the trigger options and fill in a little bit of information including the entity ID of the Time helper you created for this automation:
Then how do I stop the timer before it finish ?
Then I use the event to control it right ? I’ll have to figure out how to do it then
(sorry about language of my screendumps - should have selected english from the beginning)