I found code below that the author and others say will write lock events to the HA log… but looks like its not, I cant find any evidence in the log.
Also, I’d like to write these to an Entity so the dashboard can show the date/times of the last 10 actions for each Entity. Anyone know how to do that?
thx!
template:
- trigger:
- platform: event
event_type: zwave_js_notification
event_data:
device_id: lock.front_entry_deadbolt
label: Access Control
sensor:
- name: "Front Door Lock Event"
state: "{{now() | as_local }}"
unique_id: front_door_lock_event
attributes:
log: >
{% set log = this.attributes.get('log', []) %}
{% set new = [{
"event": trigger.event.data.event_label | default ('unknown', true),
"user": trigger.event.data.parameters.userId | default ('None', true),
"time": (trigger.event.time_fired | as_local).isoformat() }] %}
{{ (new + log)[:10] }}