I’ve been working a lot with blueprints, but I can’t seem to be able to get past this. From what I’ve read, you can’t use an !input as a condition in a template without first converting it into a variable. Would someone please take a look at this blueprint and see what you believe may be wrong?
blueprint:
name: Set Room Occupancy Echo Group
description: Set a Room's Echo Group based on it's Occupancy
domain: automation
input:
name_of_group:
name: Name of Echo Group
description: >
Please use lower case and underscore seperators!
Example: living_room_occupancy_echos
occupancy_sensor:
name: Room Occupancy Sensor
description: Select the sensor used to determine if the room is occupied.
selector:
entity:
domain: binary_sensor
echo_devices:
name: Echo Devices
description: Select the echo device(s) for this room. Multiple echos seperated by comma.
selector:
entity:
domain: media_player
trigger:
- platform: state
entity_id: !input occupancy_sensor
- platform: homeassistant
event: start
variables:
# Make inputs available as a script level variable
sensor_var: !input occupancy_sensor
devices_var: !input echo_devices
action:
- service: group.set
data:
object_id: !input name_of_group
entities: |
{% if {{ states(sensor_var) }} == 'on') %}
{{ devices_var }}
{% else %}
[]
{% endif %}
mode: single