so i made a timer using three rules and a “helper” called a “timer” now, i have it so if i turn a switch on, there is a rule that automatically starts a timer, i have a rule that if the switch turns off it automatically cancels the timer. and a rule so that when the timer finishes it automatically performs an action. the issue im having is that i do not have enough knowledge to make the timer adjustable in time. i wanted to have a box that i type in and i enter the amount of minutes that i want the timer to be timed for. right now its fixed at 30 minutes. is there a way to do this without making a rule for every possibility of how many minutes i want and use a different switch for each quantity of minutes? seems like theres probably a way to do this thats more intelligent, and this is indeed a smart home lol.
You can use an input_number
(safer because it prevents users from entering non-numeric or out-of-range values).
Modify the automation you currently use to start the timer. Make it use the input_number
’s value as the timer’s duration
.
Something like this:
- service: timer.start
data:
entity_id: timer.my_timer
duration: "{{ states('input_number.my_timer') | int * 60 }}"
is input_number also a helper?
It’s your choice. You can create an input_number
via the UI using Configuration > Helpers or using YAML in configuration.yaml
.