This will give you the nice friendly name with a fallback to the entity id if there is no name:
message: >
Alarm on {{ trigger.to_state.name }}
If you really always want the entity id:
message: >
Alarm on {{ trigger.to_state.entity_id }}
Neither will work if you are testing the automation by triggering it manually with either the automation.trigger service or the button in the more info pop-up.