I thought this would be straightforward but I can’t find it. Apologies in advance if it is simple.
I would like to press a button, then at a later specified time, execute an action.
Specifically, I commonly think of turning the water heating on during peak electricity rate so I don’t do it - then by the time it’s off peak, I’ve forgotten - go to have a shower some hours later and the water is cold.
Below is as far as I’ve got, do I need to programmatically calculate how long it is until 7pm and then delay for that long?
An input_button (or any button) changes state to the timestamp of the last trigger when pressed, so a state change trigger (without a from/to state) could be used directly
Thanks people - I fixed the button once I had the automation working. I’ve gone with any (null) state change for now, I have another button that uses input_boolean which I’d copied this automation from, but I’d set up the button helper as an experiment. Basically, ‘Button’ was top of the list in the GUI, I didn’t find it very intuitive that ‘Toggle’=input_boolean, and I didn’t bother changing it! Will see which one I like best - the difference is the other button shows a different colour to reassure the user it’s been pressed and then goes back to original colour at the end of the automation, which is a few more steps.
If you’re going to use a boolean anyway, you would be better served to follow @Troon’s advice and trigger on the time. You can use a Choose action so your button switches the boolean and the time turns on the switch: