Hi,
I’m new to HA and trying to setup my first automation using split config files.
My automations.yaml
file looks like this,
- id: device_update
alias: 'Device update'
trigger:
platform: state
entity_id: group.phones
action:
service: notify.slack
data_template:
message: '{{ trigger.entity_id }} just changed from {{ trigger.from_state.state }} to {{ trigger.to_state.state }}'
When triggering this automation I get this error,
homeassistant.exceptions.TemplateError: UndefinedError: 'trigger' is undefined
I suspect it’s a variable scoping error, and I tried a few variants of this, but can’t figure out how to reference trigger data in the template. Can anyone help?
I’ve been using this docs