Template help please

I am trying to build an automation to get my door lock notification message, I used to trigger on the zwave id that i hardcoded but reading forums, I understant that this is not the right thing to do so i am trying to get the notification via a trigger where i would be using device_id but I can’t get it to work;

I am testig in developer template and I have results I can’t reproduce in the automation, let say my ZWAVE id is :e4cf47e709626c845e82ec53eec06715 (I found it listening to events )

In template I tried the following:

{{device_id(“lock.serrure_cabanon”)}} this return e4cf47e709626c845e82ec53eec06715

Then if i tried {{“e4cf47e709626c845e82ec53eec06715” == device_id(“lock.serrure_cabanon”) }} it tells me TRUE in template but if I try it in the automation, it never runs :

description: ""
trigger:
  - platform: event
    event_type: zwave_js_notification
condition:
  - condition: template
    value_template: >-
      {{trigger.event.data.device_id == device_id("lock.serrure_cabanon")
      }}
action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
  - service: input_text.set_value
    target:
      entity_id: input_text.serrure_cabanon_last_status
    data:
      value: "test"
mode: single

if I change it to {{trigger.event.data.device_id == ‘e4cf47e709626c845e82ec53eec06715’}} in the YAML then it runs

I think I tried every option, quote, no quote … nothing works

thank for any help provided

I can’t see anything obviously wrong but try this:

condition:
  - condition: template
    value_template: >
      {% set dev_id = device_id('lock.serrure_cabanon') %}
      {{trigger.event.data.device_id == dev_id }}

Why do you want to template the device_id?
It will not change, so you can just do this:

description: ""
trigger:
  - platform: event
    event_type: zwave_js_notification
    event_data:
      device_id: e4cf47e709626c845e82ec53eec06715
action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
  - service: input_text.set_value
    target:
      entity_id: input_text.serrure_cabanon_last_status
    data:
      value: "test"
mode: single