Hey,
Been slowly getting to grips with HA and I’ve got a Yale (keyfree) Z-wave lock.
It presents in (via Z-wave JS) two alarm states to determine what it’s doing.
When one state (Alarm type) is either 18 or 19 the door has been unlocked with a code & the second state (Alarm Level) changes to the number of the code slot used.
So far so good
The challenge is that within ~1 second the lock returns to default state and the Alarm Level defaults back down to value 1.
I figured out using a template with a trigger that looks like:
- trigger:
- trigger: state
entity_id: sensor.front_door_lock_alarm_type
to:
- "18"
- "19"
sensor:
- name: "Front Door Lock Last Used Code"
unique_id: 6basdasddc3-d4e5-4148-979b-8a98waasdasd59bb
state: "{{ states('sensor.front_door_lock_alarm_level') }}"
This worked great a few times & still does work now when I manually manipuate the alarm states using dev tools.
However in every day practical use, when the template trigger is hit the Alarm Level seems to either be not updated yet, or I susspect has reverted back to it’s default “1” state.
Is there any way I can control the speed of execution, or prehaps more robustly access the history of the Level sensor to look at +0.5 seconds to record the last used key value?
Any pointers or thoughts welcome please!