My goal: Play a TTS event announcing a lock was unlocked by lock code. So something like Bedroom door was unlocked by Family. I have tried several different things, however can not get it to work as I would like.
One thing I am noticing that If I put a user code as a condition for a rule. Once I enter that code - it always seems to stay true.
In a rule, it uses the last lock code entered as the condition. The rule will be evaluated by a code being entered, but that may not help your use case. So as @doug says, put it in a trigger. It all depends on what events you want to cause this thing to speak.