How to call presets based on which PIR Sensor was active first

I have two PIR sensors, one at the top and one at the bottom of my stairs, on the left side of the stairs is an Addressable CCT COB LED-Stripe.

When I trigger the PIR at the bottom of the stairs, I want to call preset-bottom-on, when I trigger the PIR at the top of the stairs I want to trigger the preset-bottom-off.

Now the same but in reverse when I start at the top of the stairs.

Using the StaircaseMod is not an option because I need to control presets rather than segments.

So what I’m looking for is some way of defining the logic to see which PIR Sensors were active first. Anyone any ideas?

I’ve spent a many hours now searching and even trying to build my own usermod. I’m at the point where I’m realizing how little I know about C programming and just want to make sure, that there is no other way than build an usermod