I currently have a Door lock where I have several codes configured. I want to receive a notification with the name of the user whose code was entered. Working today, I have a notification automation created for each user.
Single User Notification Automation
triggers:
- trigger: event
event_type: zwave_js_notification
event_data:
domain: zwave_js
node_id: 0
event_label: Keypad unlock operation
parameters:
userId: 1
conditions: []
actions:
- variables:
notification_message: User 1 unlocked the Front Door using a PIN
- action: notify.mobile_app_adminuser
data:
message: "{{ notification_message }}"
However, I can see this can become inefficient the more codes I use. I want to create one notification automation that uses the userId value to determine the message. I was thinking the Choose construct would work for what I am trying to do, however I cannot seem to properly reference the userId value from the trigger block.
Does the userId value have be referenced in the trigger block, or is it available to be referenced because it is in the notification event block.
Unified Notification Automation
https://dpaste.org/4o0Oy
Thanks in advance for any help or direction that you can offer. After reading through the documentation and the community posts, I seem to come to the end of me.