Automation Triggers - Identifyimg Lock Keypad Use vs Manual unlock

I want to disable the Home Assistant Alarm if my Side Door was unlocked by the Keypad. I will note that my Lock is accessed through the Smartthings Integration so testing ZWave values might not be available. I did do some debugging and determined that looking at the last change it does tell me the method used when I look at the lock in the UI.

image

Also looking at the state table in the Home Assistant DB I see this in the attributes field.

{“lock_state”: “locked”, “method”: “keypad”, “friendly_name”: “Side Door Lock”}

I just don’t know how to go about testing and parsing the value of an attribute in an automation trigger.

Would appreciate any help.

Paste this into the Template Editor, change the entity name to whatever you are using and observe the result.

{{ state_attr('lock.my_lock', 'method') }}

{{ state_attr('lock.my_lock', 'method') == 'keypad' }}

Thank you! for helping me with a direction. I hadn’t used Templates before. It appears there is several ways to do this. I see I can setup a Sensor in my config and simply check that as part of the automation.