#Trigger variables: template isn't resolved, but why?

1 messages · Page 1 of 1 (latest)

young warren
#

Hello, I tried to follow the docs on trigger_variables but somehow get an error after reloading. This is my automations.yaml

- alias: My Automation
  id: '1671617025000'
  description: ''
  trigger_variables:
    trigger_entity: binary_sensor.motion_1
  trigger:
    - platform: state
      entity_id: "{{ trigger_entity }}"
      from: "off"
      to: "on"
  condition: []

and I get the error

failed to setup triggers and has been disabled: Entity {{ trigger_entity }} is neither a valid entity ID nor a valid UUID for dictionary value @ data['entity_id']. Got None

can someone help me please :)

covert sky
#

You can't use templates in a state trigger

#

Use a template trigger instead

young warren
#

Ohh, thank you! I see it has nothing to do with trigger variables 😅

icy violet
#

I wasn't sure if @zenith egret was trying to support something like that, just for Blueprints