- service: notify.telegram
data_template:
message: >
{{now().strftime("%Y-%m-%d %H:%M")}}: Awning closed by {{'sunset' if trigger.event is defined else trigger.to_state.name}}.
If it was triggered by the Sun Trigger, it appends “sunset”.
2020-06-17 08:35 Awning closed by sunset.
If it was triggered by one of the Numeric State Triggers, it appends the entity’s friendly_name.
Your automation only has one condition. I think what you meant to say was, your automation has multiple triggers.
In any case, per the documentation linked to above by @123, trigger.platform will tell you the platform of the trigger that fired. So if it’s sun, then it was the first trigger, otherwise it’s one of the numeric_state triggers. To find out which of those fired, you can use trigger.entity_id or trigger.to_state.name.