I have two automations competing over turning on/off a light with sensors

So I have a light that illuminates my stairs but also lights up my living room

the conundrum is that with one automation I have a P1 Aqara sensor that turns on/off the light when it senses motion on my stairs but ALSO have an Aqara FP1E that turns the light on when presence is detected in the living room

I cannot seem to get the presence sensor to keep the light on when presence is detected because if someone goes up/down the stairs the previous automation will then turn the lights off instead of retaining its previous state

I saw there was something about using scenes but I’m still kind of new to this and don’t know where to start

Any advice?

Create a group from both sensors and use it as trigger. This way if any of them is on (specifically your FP1E) the group will remain on and won’t turn the light off.