Hi, I am trying to get my xiaomi roborock vacuum running Valetudo RE to zone clean multiple zones using input_boolean buttons, using the below code. The code works when inserted into the template editor and also starts the vacuum when one zone is selected. But I am having trouble making it work with multiple zones. Any help would be great.
You got most of the way there and thank you @K_Shot, because based on what you posted I was able to get it working.
So the issue appears to be that in a template, all template generated values are strings. If we look at the mqtt message that is published in response to your code instead of getting something like…
…there is apparently no way to get a template to generate a list as opposed to a string.
However, there is a workaround. We can use a python_script to call the vacuum.custom_command service and have more control over the service data we send it. So to get this working we keep the same input_boolean and group configuration but also enable python_script and add a file called vac_clean.py to the config/python_scripts directory. We can then call python_script.vac_clean service which will use group.vac_rooms and vacuum.rockrobo but default but this can be changed.