Open seblu opened 2 months ago
I do not think you can use this:
- service: cover.open_cover
target: "{{ covers }}"
1st, covers
is not a variable - it is an "input" and is supposed to be used along with !input
when addressed.
2nd, do not think that it is allowed to use other inputs/variables for default
.
cover
is a variable in the context of where open_action
is substituted. I removed the end of the blueprint to simplify the report. Here is what is look like.action:
- variables:
covers: !input covers
- choose:
- alias: Open cover(s)
conditions:
- condition: trigger
id: sunrise
sequence: !input open_action
This is an elegant way to create default actions. IIRC, sequence cannot use templates.
You can use a template returning a native dictionary as well, which is useful if the attributes to be set depend on the situation
.
Not a perfect argument but let me remind you that the blueprint/automation works (and for months), so the core is accepting it.
cover
is a variable in the context of whereopen_action
is substituted
This is an important info; otherwise it was not clear since you are using same name for a variable & input. Tried to reproduce your case, it seems to work OK, no errors in Log:
blueprint:
name: test_input
domain: automation
input:
input_INPUT_BOOLEAN:
input_ACTION:
default:
- service: input_boolean.toggle
target:
entity_id: >-
{{ INPUT_BOOLEAN }}
selector:
action:
trigger: []
action:
- variables:
INPUT_BOOLEAN: !input input_INPUT_BOOLEAN
- sequence: !input input_ACTION
automation:
- alias: test_input_1
id: test_input_1
use_blueprint:
path: test/test_input.yaml
input:
input_INPUT_BOOLEAN: input_boolean.test_boolean_2
BTW, have you tried to expand this block? It shows this in my simplified case: and it is possible to create an automation in yaml successfully.
Yes, no problem with block expansion and we can edit the YAML. The issue is in the label/description of the expandable block.
I guess the function which try to describe the action (create the text) try to parse the target
of the YAML but is unhappy with target
not being a map, because it can't use in
on strings.
Checklist
Describe the issue you are experiencing
Let's imagine the following blueprint:
The automation edition interface display the following error message :
Error in describing action: cannot use 'in' operator to search for "area_id" in "{{ covers }}"
.Here is a screenshot of how it's displayed.
The automation works as expected, so it's mainly an UI errors because a code is expecting a map and not a string for targets.
Describe the behavior you expected
To not display errors and propose YAML edition.
Steps to reproduce the issue
What version of Home Assistant Core has the issue?
2024.9.0
What was the last working version of Home Assistant Core?
No response
In which browser are you experiencing the issue with?
firefox,chrome
Which operating system are you using to run this browser?
Arch Linux, Android
State of relevant entities
No response
Problem-relevant frontend configuration
No response
Javascript errors shown in your browser console/inspector