I know I can get the entity_id of an event that triggered an automation with:
trigger.event.data.entity_id
How do I get the entity_id if the trigger uses platform: state
or platform: webhook
? I’ve tried, for example changing trigger.event
to trigger.state
- alias: "Timer Cancel"
mode: parallel
trigger:
- platform: state
to: "off"
entity_id:
- switch.office_credenza
- switch.office_desk
action:
- service: timer.cancel
entity_id: "timer.{{ trigger.state.data.entity_id.split('.')[-1] }}"
# to cancel , for example timer.office_desk