Switch that automaticly turns of after 1 hour

If possible, I don’t know how to do it.

About the slider, you can do it with a helper entity. First edit the script to take the value from the helper entity and assign it to the “for” entry in the script.
Once achieved, you only need to tunne it in the UI to be shown as a slider. See this topic

Glad to help.