How to switch off two lights for x amount of minutes with a slider button to set x amount

I have 2 lights switched on 24hrs a day.

I would like to switch off 2 lights for a brief period of time, x amount of minutes, and then a slider to set X amount of minutes. Please help.

I have searched and tried so adjusting so many similar timer guides but they all different in some way or form and can not get anything to work.

Something similar to this maybe?
image

I see you basically already made the helpers. Now just make two automations.

Goto sleep

alias: Goto sleep
description: ''
mode: single
trigger:
  - platform: state
    entity_id: input_boolean.sleep
    to: 'on'
condition: []
action:
  - service: light.turn_off
    target:
      entity_id:
        - light.light1
        - light.light2
  - service: timer.start
    target:
      entity_id: timer.sleep
    data:
      duration: "{{ states('input_number.sleep')|int * 60}}"

And to restore

alias: Wake up
description: ''
mode: single
trigger:
  - platform: event
    event_type: timer.finished
    event_data:
      entity_id: timer.sleep
  - platform: state
    entity_id: input_boolean.sleep
    to: 'off'
condition: []
action:
  - service: light.turn_on
    target:
      entity_id:
        - light.light1
        - light.light2
  - service: input_boolean.turn_off
    target:
      entity_id: input_boolean.sleep
  - service: timer.cancel
    target:
      entity_id: timer.sleep

Thank you so much for the reply. I appreciate your help.
This image was just an image I found online. So nothings been set up yet.

How would I go about setting the helpers up?

Just in the UI via Configuration => Helpers.
input_boolean => Toggle
input_number => Number
timer => Timer

The automation expects the number to be whole minutes. Pick the range you like.

Thank you so much @septillion
All is working 100%. Much appreciated :raised_hands:t4: