Simple variable use in automation

I am very new to this and just learning the basics. I have the following which works:

condition:

  • condition: time
    before: !input lights_out_time_weekdays

I want to write it so the condition is 15 minutes before lights out time but I cannot get it right, I thought it would look like:

condition:

  • condition: time
    before: !input lights_out_time_weekdays - 00:15:00

but that is not correct and I am not sure how to write this.

TIA

Look into templates for how to create variables and do math and working with time and timestamps is another subject you are looking at there.
Also You are saying automations, you are showing code related to blueprints, and asking in a blueprints category.
You are also sharing the minimum code, so any answer we give is at risk for being wrong because we don’t have any context.

My suggestion is post more of your code, clarify if blueprint or automation.

If this is a blueprint, do not start learing with these. Build automations first and learn how to do that. Get what you want working, then make the blueprint out of that by adding the !inputs and variables and such.

Creating an automation blueprint - Home Assistant.

There are hundreds of examples of working blueprints in the blueprint exchange and I have about 20 of them in my link bottom of this message. Do a little reading, look thru some examples, and then come back with questions.

At this point we would be just writing your code for you because you don’t yet understand what you are doing, and I for one do not usually write code for others except when I build something and share that IE the links below.