Hi,
this issue drives me grazy. The simplified code for the action I am looking at is
action: vacuum.send_command
target:
entity_id: vacuum.roborock_s7_maxv
data:
command: app_segment_clean
params:
- segments: >
{%- set mapper = {'Room23' : '[23]'} -%}
{%- set roomnr = mapper['Room23'] -%}
{{- roomnr -}}
and it works as expected in Developer Tools.
However, basically the same code does not trigger the action in the button below
show_name: true
show_icon: true
type: button
entity: vacuum.roborock_s7_maxv
tap_action:
action: perform-action
perform_action: vacuum.send_command
target:
entity_id: vacuum.roborock_s7_maxv
data:
command: app_segment_clean
params:
- segments: >
{%- set mapper = {'Room23' : '[23]'} -%} {%- set roomnr =
mapper['Room23'] -%} {{- roomnr -}}
The odd line breaks in the template part at the end are generated on Save by Home Assistant…
Replacing the last part with hard coded value resolves the issue
params:
- segments: [23]
But I need to use the mapper for different rooms (as I am actually using a input_select). For me it looks like the multiline part of yaml is not working. However, it is more likely that I am doing something wrong.
Any hints?