Using trigger ID in notification message

I can’t seem to find the correct syntax online for how to code a trigger_id into a notification message.

If I have two triggers, with the ID’s ’hot' and ‘overcurrent’ can I just use the following to send either of those trigger ID’s in the message?

service: notify.mobile_app_dave_s_s22
data:
  message: "The alfresco dual smart switch is currently {{ trigger.to_state.trigger_id  }}"

I’m yet to test it since hopefully neither of these states ever happen (I would have to force the state in HA) but just trying to confirm my code syntax is correct so I can use the same system in other automations.

If you want to use the trigger’s id you don’t need the to_state part:

service: notify.mobile_app_dave_s_s22
data:
  message: "The alfresco dual smart switch is currently {{ trigger.id  }}"
2 Likes

Awesome, thanks. I’ll create another automation where I can test it more easily.