Hey, i’m pretty new in this and I have a little problem that I’m sure you guys will be able to solve for me
What I’m trying to do is to execute a script that will send my roborock to vacuum selected rooms. I have input_boolean defined for each room. When executing commands I want to combine the input_booleans that are in ON sate and generate a “params” property of the command.
If I paste the code bellow to the template editor everything looks fine. Even if I execute the command in developer tools it works fine (i set the params to: [1,3,]). But when the script is executed via button I get an error: Unable to send command to the vacuum: {‘code’: -10000, ‘message’: ‘data for segment is not a number’}
vacuum_rooms:
alias: Vacuum Rooms
sequence:
- data:
entity_id: vacuum.roborock
command: app_segment_clean
params: >
[{% if is_state('input_boolean.clean_kitchen', 'on') %}1,{% endif %}{% if is_state('input_boolean.clean_hallway', 'on') %}2,{% endif %}{% if is_state('input_boolean.clean_bedroom', 'on') %}3,{% endif %}]
service: vacuum.send_command
Thanks for the help!