Is it possible to use a variable for the entity_id in triggers?
For instance:
- id: auto_to_on
platform: state
entity_id: binary_sensor.backyard_hue_sensor_motion
from: 'off'
to: 'on'
- id: auto_to_dim
platform: state
entity_id: binary_sensor.backyard_hue_sensor_motion
from: 'on'
to: 'off'
for: '00:02:00'
- id: auto_to_off
platform: state
entity_id: binary_sensor.backyard_hue_sensor_motion
from: 'on'
to: 'off'
for: '00:02:30'
be something like
variables:
sensor: binary_sensor.backyard_hue_sensor_motion
trigger:
- id: auto_to_on
platform: state
entity_id: "{{ sensor }}"
from: 'off'
to: 'on'
- id: auto_to_dim
platform: state
entity_id: "{{ sensor }}"
from: 'on'
to: 'off'
for: '00:02:00'
- id: auto_to_off
platform: state
entity_id: "{{ sensor }}"
from: 'on'
to: 'off'
for: '00:02:30'