Change switch on duration through slider

Hi!

I am so sorry if I was not clear.

I am able to get a slider on the dashboard by creating a helper for input number, I don’t know how to utilize it in the automation.

Thank you for your tip regarding the reloading automation part, I will be following your method!

So, I have to create one helper for input_number and another one for input_datetime, right?

The above code calls the switch to turn on and then the date time service?
Is the entity_id: input_datetime.XXX, correct? I did not understand the .XXX part

And where do I paste the below code?

trigger:
  - platform: time
    at: input_datetime.watering_off_time
condition: []
action:
  - service: switch.turn_off
    target:
      entity_id: switch.sonoff_