Hoping someone can share Zwave Door Lock notification YAML? I’d like to have the notification include this info…
- Manual, Keypad, RF
- code slot # (not the actual code itself)
- locked / unlocked
so far I have only been able to figure out how to get the locked/unlocked info
This YAML doesnt provide the info on if the keypad was used, or if the lock/unlock was automated vs manual.
alias: "Notify : Door Lock Change"
description: Notification sent to all devices when a Door Lock changes status.
triggers:
- entity_id:
- lock.mudroom_deadbolt
- lock.front_entry_deadbolt
trigger: state
actions:
- data:
title: |
{% if trigger %}
{{ trigger.to_state.name }} is {{ trigger.to_state.state }}
{% else %}
Unknown Door - Status Changed
{% endif %}
message: |
{% if trigger %}
{% set lock_status = trigger.to_state.attributes.lock_status %}
{% set lock_status = lock_status|replace("by RF", "by automation") %}
{% set lock_status = lock_status|replace("user 0", "code 0") %}
{% set lock_status = lock_status|replace("user 1", "1") %}
{% set lock_status = lock_status|replace("user 2", "2") %}
{% set lock_status = lock_status|replace("user 3", "3") %}
{% set lock_status = lock_status|replace("user 4", "4") %}
{% set lock_status = lock_status|replace("user 5", "5") %}
{% set lock_status = lock_status|replace("user 6", "6") %}
{% set lock_status = lock_status|replace("user 7", "7") %}
{% set lock_status = lock_status|replace("user 8", "8") %}
{{ lock_status }}
{% else %}
Missing trigger information
{% endif %}
action: notify.notify
mode: parallel
max: 10