Hi all,
I have the next simple blueprint:
blueprint:
name: Configure ZBMINIR2 detached relay mode
description: Configure ZBMINIR2 detached relay mode.
domain: automation
author:
homeassistant:
min_version: 2022.4.0
input:
zbminir2_device:
name: ZBMINIR2 device
selector:
device:
filter:
manufacturer: SONOFF
model: Zigbee smart switch (ZBMINIR2)
multiple: false
controlled_light:
name: Toggle target lights
description: The switch will toggle these lights.
selector:
entity:
filter:
domain: light
multiple: false
triggers:
- domain: mqtt
device_id: !input 'zbminir2_device'
type: action
subtype: toggle
trigger: device
variables:
zbminir2_device: !input 'zbminir2_device'
zbminir2_switch: "switch.{{ device_attr(zbminir2_device, 'name') | slugify }}"
actions:
- choose:
- conditions:
- condition: state
entity_id: '{{ zbminir2_switch }}'
state: "off"
sequence:
- type: turn_on
device_id: '{{ zbminir2_device }}'
domain: switch
- conditions:
- condition: state
entity_id: '{{ zbminir2_switch }}'
state: "on"
sequence:
- action: light.toggle
metadata: {}
data: {}
target:
entity_id: !input 'controlled_light'
mode: single
But I am not able to use the variables and I get the following error:
Message malformed: Entity {{ zbminir2_switch }} is neither a valid entity ID nor a valid UUID for dictionary value @ data['actions'][0]['choose'][0]['conditions'][0]['entity_id']
Surely it is a problem of not understanding how variables work, do you know of any specific documentation on where and how to use variables?
thanks for everything