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.
if the door is locked and any of these codes are entered.
speak my message - The door was unlocked by user.
I am unclear why the rule I posted does not work at least on the trigger side. Will the condition lock code enter never evaluate to false after it is entered once?
If you only have a single lock code in the rule, and a different one is used, the rule should go false -- but you have every code in that rule, so why wouldn't it always be true wrt lock code?
Having said that, if all you want is to trigger the speech, then use a trigger.
I am not sure a trigger alone would suit my needs either though. What happens if the lock is unlocked already. One of my locks at least will lock the door if the code is entered as well