Include Zwave ID or name in notification

I have the Keymaster Basic setup for my zwave yale locks. Using HAOS with ZWaveJSUI addon. Notifications are working but they are not showing which door is getting opened. (script below)

I have been looking at the detailed tracelog to identify the device ID, door name, … but can’t find it anywhere.

How do i include the DeviceID or DeviceName into the notification?

  - alias: Lock Notifications
    description: "Notify when certain codes are used to unlock the doors, if notify is enabled"
    id: lock_notifications
    triggers:
      - trigger: event
        event_type: zwave_js_notification
        event_data:
          command_class: 113
          command_class_name: Notification
          label: Access Control
          type: 6
          event: 6
          event_label: Keypad unlock operation
         device_id: "{{device_id}}"
        variables:
          unlock_code_slot: "{{ trigger.event.data.parameters.userId }}"
    condition: []
    actions:
      - choose:
          - conditions:
              - condition: template
                value_template: |
                  {% set mysensor = "input_boolean.lock_code_slot_" ~ unlock_code_slot ~ "_notify" %}  
                  {{is_state(mysensor, 'on') }}
            sequence:
              - action: notify.lock_notify_group
                data:
                  message: >-
                    {% set namesensor = "input_text.lock_code_slot_" ~
                    unlock_code_slot ~ "_name" %} {{
                    states(namesensor)}} unlocked the {{device_id}} door at
                    {{ now().strftime('%H:%M') }}
    mode: single

this should tell you the trigger friendly name

{{ trigger.to_state.attributes.friendly_name }}

You will most likely get a better response posting in the linked thread or at the Keymaster github linked in your link as the folks following those posts are probably using this.

Others would have to do a LOT of investigation before being able to attempt to answer your question.

I didn’t mean for you to link us to the github.

I meant for you to ask there :slight_smile: Or in the forum link you did post in the original post.

Use the device_id from the trigger event data along with the device template helpers, e.g. to get the Device Name.

https://www.home-assistant.io/docs/configuration/templating/#devices