Help with automation, Trigger in order

Hey All, having some trouble with an automation.

I have an FP2 in my master bedroom, the view of it can also see part of my onsuite.

I am trying to setup an automation that turns on the light in the master bath when we enter, but leaves it on until a sequence of triggers is sent to turn it off.

Zone 1 turns on light , zone 3, Zone 2, Zone 1 in that order turns it back off.

or alternate

if i go through the zone into the master bath, it will turn on the light, and then when i cross the entrance again it turns the light off. with this i would need it to be able to run multiple times in parallel since my wife may also walk in and out so i would like the light to stay on. FP2 cannot see the whole master bath, so it would just turn the light off with a normal automation.

Thank you for any help you may be able to give me.

Hi, welcome to the forum!

I have something similar with motion sensors to detect a routine.
The trigger is the first motion sensor.
As an action I have 2 other motion sensors set up with ‘Wait for trigger’, one after the other and then the rest of the actions.

Thank you Nick,

I did try to use wait for trigger, but it did not seem to care about the order of events.

light would turn off if i went through 1,2,3 and for 3,2,1. 3,2,1 being the order i want to turn off the light.

I am using one singular FP2 for this, but since its zoned out it should act kinda like 3 different sensors.