@agoberg2 Sure thing! I have defined 6 vacuum sections as follows:
- Living room
- Kitchen (part of living room)
- Rug (part of living room)
- Bedroom
- Study
- Hallway
For each of these sections, I have created a toggle helper (which the custom button-cards toggle) and when the start button is pressed, a script is activated.
Essentially, the script is just a call-service to the vacuum, but depending on which section is toggled, it sends over different parameters in an array. If no section is selected, the script sends over an empty array which the vacuum translates to ‘vacuum everything’, which is perfect for my use case.
Each time the script is run, it also resets the “number of repetitions” input helper back to 1.
Here’s the complete code of the script:
alias: Selectie stofzuigen
icon: mdi:robot-vacuum
sequence:
- service: vacuum.send_command
target:
device_id: 706c3120ce0571b7d9094a1e359da416
data:
command: app_zoned_clean
params: >-
[{%if states.input_boolean.woonkamer_keuken_robotstofzuiger_selecteren_voor_stofzuigen.state=='on'%}
[22300,29400,28400,31000,{{states.input_number.algemeen_robotstofzuiger_zone_herhalingen.state|int}}],
{%endif%}
{%if states.input_boolean.woonkamer_vloerkleed_robotstofzuiger_selecteren_voor_stofzuigen.state == 'on'%}
[25900,26100,27200,28000,{{states.input_number.algemeen_robotstofzuiger_zone_herhalingen.state|int}}],
{%endif%}
{%if states.input_boolean.woonkamer_robotstofzuiger_selecteren_voor_stofzuigen.state == 'on'%}
[22300,24400,28400,31000,{{states.input_number.algemeen_robotstofzuiger_zone_herhalingen.state|int}}],
{%endif%}
{%if states.input_boolean.gang_robotstofzuiger_selecteren_voor_stofzuigen.state == 'on'%}
[15650,28120,22300,31000,{{states.input_number.algemeen_robotstofzuiger_zone_herhalingen.state|int}}],[15650,27900,18530,28110,{{states.input_number.algemeen_robotstofzuiger_zone_herhalingen.state|int}}],{%endif%}
{%if states.input_boolean.studeerkamer_robotstofzuiger_selecteren_voor_stofzuigen.state == 'on'%}
[15990,25060,18530,27900,{{states.input_number.algemeen_robotstofzuiger_zone_herhalingen.state|int}}],
{%endif%}
{%if states.input_boolean.slaapkamer_robotstofzuiger_selecteren_voor_stofzuigen.state == 'on'%}
[22000,25060,18530,28120,{{states.input_number.algemeen_robotstofzuiger_zone_herhalingen.state|int}}],
{%endif%}]
- service: input_boolean.turn_off
target:
entity_id:
- input_boolean.gang_robotstofzuiger_selecteren_voor_stofzuigen
- input_boolean.slaapkamer_robotstofzuiger_selecteren_voor_stofzuigen
- input_boolean.studeerkamer_robotstofzuiger_selecteren_voor_stofzuigen
- input_boolean.woonkamer_keuken_robotstofzuiger_selecteren_voor_stofzuigen
- input_boolean.woonkamer_robotstofzuiger_selecteren_voor_stofzuigen
- input_boolean.woonkamer_vloerkleed_robotstofzuiger_selecteren_voor_stofzuigen
data: {}
- service: input_number.set_value
data:
value: 1
target:
entity_id: input_number.algemeen_robotstofzuiger_zone_herhalingen
mode: single