Smart lock, notify which user unlocks notification

I thought there was something out there to do this but can’t find it.
I’m trying to create an automation which sends me a notification who has unlocked the door.
I’ve created a helper which gives the number of each slot ( input_number.gate_lock_user_code )
I was hoping to use it in an automation but can’t seem to figure it out.
Is there anything out there that can do what I need?

I thought of using something simple like this, but if 3 was the last to unlock, it’s not changing to 3 so I imagine there would be no change so no notification.

alias: gate - Notify when gate lock code is 3
triggers:
  - entity_id: input_number.gate_lock_user_code
    to: "3"
    trigger: state
actions:
  - action: notify.mobile_app_blobfishs_iphone_12
    data:
      message: Paul's tag used to unlock the gate
mode: single

If the value of the input_number is 3, this automation won’t fire. It will only fire when the number changes to 3 from some other number.

Presumably you’re using some automation to set the input_number? If so, trigger the notification there. If not, can you give us more information about how the input_number is set?

I used the helpers and automations from here Z-Wave JS Locks in Home Assistant - Now See Who Opened The Door - This Smart House

There is an automation for the user notifications but it gives an error on line 20

alias: Front Lock - Lock Code
description: ''
trigger:
  - platform: event
    event_type: zwave_js_notification
condition:
  - condition: template
    value_template: '{{ trigger.event.data.device_id == ''445eaa0e224212106f75062e28800af3'' }}'
  - condition: template
    value_template: '{{ trigger.event.data.event == 6 }}'
action:
  - service: input_number.set_value
    data_template:
      entity_id: input_number.last_front_door_code
      value: '{{trigger.event.data.parameters.userId | int}}'
  - service: input_text.set_value
    data_template:
      entity_id: input_text.front_lock_user
      value: >
'{% if states('input_number.last_front_door_code') | int == 1 %}
  Code1
{% elif states('input_number.last_front_door_code') | int == 2 %}
  Code2
{% elif states('input_number.last_front_door_code') | int == 3 %}
  Code3
{% elif states('input_number.last_front_door_code') | int == 4 %}
  Code4
{% elif states('input_number.last_front_door_code') | int == 5 %}
  Code5
{% elif states('input_number.last_front_door_code') | int == 6 %}
  Code6
{% elif states('input_number.last_front_door_code') | int == 7 %}
  Code7
{% elif states('input_number.last_front_door_code') | int == 8 %}
  Code8
{% elif states('input_number.last_front_door_code') | int == 9 %}
  Code9
{% else %}
  Error
{% endif %}'
mode: single