I’m trying to create a custom script for sending commands to my Roomba. I have access to my specific room/zone IDs but it would be a lot easier if I don’t have to remember the ID numbers and just select a more friendly name. However, I think I’m doing something slightly wrong with my script code.
So as an example, the below command will work to send the vacuum to the Living Room (Room ID: 1) and to the Entryway (Zone ID: 11).
service: vacuum.send_command
data:
command: start
params:
pmap_id: 0hVqO6_1RA-XDwpkLrv3Kw
regions:
- region_id: "1"
type: rid
- region_id: "11"
type: zid
target:
entity_id: vacuum.the_help
My non-functioning script YAML is:
sequence:
- service: vacuum.send_command
metadata: {}
data:
command: start
params:
pmap_id: 0hVqO6_1RA-XDwpkLrv3Kw
regions: >
{% for item in rooms %}
- region_id: {{ item }}
type: rid
{% endfor %}
{% for item in zones %}
- region_id: {{ item }}
type: zid
{% endfor %}
target:
entity_id: vacuum.main_floor
mode: single
fields:
rooms:
selector:
select:
multiple: true
options:
- label: Living Room
value: '1'
- label: Office
value: '4'
- label: Hallway
value: '8'
- label: Dining Room
value: '10'
- label: Kitchen
value: '5'
name: Rooms
required: false
zones:
selector:
select:
multiple: true
options:
- label: Entryway
value: '11'
- label: Garage Door
value: '0'
- label: Front Door
value: '1'
- label: Kitchen Counter
value: '3'
- label: Back Door
value: '6'
name: Zones
required: false
I know this issue is somewhere with how I templated this bit:
regions: >
{% for item in rooms %}
- region_id: {{ item }}
type: rid
{% endfor %}
{% for item in zones %}
- region_id: {{ item }}
type: zid
{% endfor %}
Can anyone correct what I did wrong or point me in the right direction?