Rule advice

I’m kinda new to building rules. I built this rule to trigger scenes based on times. It will also turn things off when I get to a certain part of the house. If I go to the foyer it will unlock the door. If I don’t, it will just end the rule. What are y’all’s thoughts? Is there a better way to do what I am trying to accomplish?

Before I start, it should be noted that rule actions are basically an ordered script. Any time a trigger matches an event that happens on the hub or, less commonly, the rule is invoked from another rule (that's a kind of rule action you can do), the actions will run from the top. It will not run in response to any event or schedule not explicitly specified otherwise (delays, waits, and similar things done in the actions can also create schedules or event subscriptions, though those are a bit different; conditionals will not create subscriptions to any events).

So, while I don't know the full intent of your rule, it seems to me like you have multiple, disparate sets of actions in there that you don't really intend to set off just by mode becoming night. If it were me, I'd make the time-based ones just use Simple Automation Rules or smaller, purpose-built app instead (though really the first part of the rule looks fine for that--I assume this is some sort of morning "routine"?). What I'm not sure about is that last part with the motion sensor and locks. If you explain what you're really trying to accomplish there, someone might be able to say whether you're on the right track or if there's a different way you might want to do this.

This is my routine. It is built in order. As time flows it triggers the next scene. I eventually get to the point that isn’t as time specific. I still follow the same routine so I use motion sensors to trigger the next scenes, and speech commands as well as turning the TV’s nd lights off. I used rule machine for simplicity for a one stop shop for prepping for work. If I wanted to change something I only had to go to one spot. The biggest thing I’m hung up on is the end.

If I go into the foyer I want it to unlock the door and lock it back when it closes. If I don’t go into the foyer I just want to end the rule. I used a timeout and then a conditional action. I couldn’t figure out a better way to do it.

I would just change around the logic you have

Wait for foyer active > timeout 5 min
If foyer active
Unlock door
Wait for door close
Lock door

No need to exit the rule it will run the if statement or not.

Ok. Thanks for the help. I made the change.