I want my automation to trigger a “wait” until “Start At Time” and then run for “Run For” hours and then turn off. I’ve currently connected a socket I can control in HA so I got that part covered.
Can someone help me get this sorted using the UI?
Please speak to me as I was 3 years old… new to all of this
The trigger can just be the time you want to start it. Should be easy to plug in a start time.
The ‘run for’ can be a timer. You ‘start timer’ when the trigger happens for as many hours yuou want it to run.
Then you have another automation with a trigger that stops the process when the timer has finished.
I’m sure if you wait long enough, someone will write it for you… but this isn’t too difficult that you couldn’t try and post back any issues. Feel free and I or someone will help you correct it. Its a good way to learn.
Btw, it looks like you are creating some sort of manual run timer. I do something very similar for my pool automation. This may help. I don’t bother with a ‘start’ button like you do. I simply trigger off of setting the timer itself (your slider). Then start it. Then clear the duration back to zero.
In essence, your flow you’ll have 3 events to trigger off.
the time itself. Your choice.
finishing of the timer.
The push button to activate it
For each of those, you create 1 automation (you can do it in a single automation if you wanted using trigger IDs and ‘choose’. Its again up to you but by example uses 2 automations.
So for #1 if you want to use the time to start it.
trigger:
- platform: time
at: '22:22:00'
That flow should start your process, and kick off the countdown timer. The duration of that timer should be the value in your slide (like my example).
This would capture the timer finish and stop your process.
#3
The other piece of your GUI is the fact that I think you only want this to happen after you hit the ‘button’. If that is the case, you’ll probably want to create another input_boolean’ so you can use that as a condition in your start automation. Basically when you press that button, you’re going to toggle an ‘input_boolean’ to ‘on’ so you know that your process is allowed to start. You’ll need an automation to handle this. Essentially:
trigger:
- platform: state
entity_id: button.my_button
That automation should simply toggle that input_boolean to ‘on’. Then your automation from step #1 and #2 should have that input_boolean = on as a condition.