[HELP] make slider control sun elevation automation

Dawn to dusk lights. Basically, I want to replace the hardcoded “-6°” with a slider in the front end. I know about number component, but not sure how to tell it to change the elevation (there’s no - sun.offset.set_level: ). Help appreciated

sun:
  latitude: 32.588081
  longitude: -88.822899
 
  on_sunset:
   - elevation: -6°
     then:
        - light.turn_on:
            id: fslight
  on_sunrise:
    - elevation: -6°
      then:
        - light.turn_off:
            id: fslight

I’m not 100% sure, but it’s likely something along the lines of:

number:
- platform: template
  name: Elevation 
  optimistic: true
  restore_value: true
  initial_value: 0
  unit_of_measurement: "°"
  id: elevation_number
  min_value: -90
  max_value: 90
  step: 1
  mode: slider


sun:
  latitude: 32.588081
  longitude: -88.822899
 
  on_sunset:
   - elevation: !lambda 'return id(elevation_number).state;'
     then:
        - light.turn_on:
            id: fslight
  on_sunrise:
    - elevation: !lambda 'return id(elevation_number).state;'
      then:
        - light.turn_off:
            id: fslight

@Didgeridrew thank you very much for the code. I definitely thought it should work but apparently elevation is not templatable.