Hello @Maj.D.Hurtz !
You could use a Gcode for that :
[output_pin LIGHT_pin]
pin: PE5
pwm: False
value: 0
[gcode_macro M355]
gcode:
{% set S = params.S|default(1)|int %}
#default_parameter_S=1
SET_PIN PIN=LIGHT_pin VALUE={S}
M355 S0 turns light off
M355 S1 turns light on