I think it looks fine. Did it work?
I'd also maybe have the door check happen at bed time too just to be sure. If you use a mode you could trigger it with the mode change. As a secondary with a different type of trigger.
The other option would be to reverse that actions and say if door UNLOCKED then...
But I don't know if that makes any real difference.
The other thing you may want to consider is sending a message if it is unlocked at that time (or a confirmation of locking). Some people have used a contact sensor as a condition of locking, no sense of locking an open or ajar door.
In RM after each conditional statement you will have a (T) or a (F) based on the current condition of that conditional statement and at the end of all statements you will see [TRUE] or [FALSE] based on the entire conditional action.
So for instance
IF (NOT Door locked(F) AND Door locked (T)[FALSE])
The door is locked so
NOT Door locked is false and
Door locked is true
If you AND those statements the entire statement is FALSE
You probably don't need the if statement just the "Lock:Fornt Door".
If the door is already locked and gets another command to lock it it won't do anything.
With my Yale locks, it will still try to lock. It might not trigger the mechanism, but it wakes up the lock, and it chimes like it just locked so I use the conditionals in all my RM's like the OP.
OP, for reference, the "NOT" in coding is just the opposite state of what the conditional is asking for.
IE:
Door Locked (locked)
NOT Door locked (unlocked)
I am new to HE and have only used RM for a couple of days but here is how I set mine up. It is important to check for more than did the lock just lock. If the door is open, the lock will still report it was locked. Also I want to know if the door was open slightly and the lock doesn't fully lock which puts it into the "unknown" condition. There may be a better way but this is what I came up with being new to RM.
You could move the "IF front door closed" as the first action in the rule and and add in a wait for event "front door closed" after the notification about it being open.
This would then allow the rule to continue and lock after the door is closed and also removes the need to evaluate if the door is closed in the subsequent if statements.
Okay I think I got it now. I still need to check the sensor twice but I do like this flow better. I just need to add in my Echo's for the Open and Unknown results to yell at me too.
If you added in another exit rule at the end of the if door open you would limit the notifications as I'd gather if you have to physically close the door you should still be there when it locks.