Hi guys,
I have some difficulties with setting app zone cleaning with Xiaomi Robot Vacuum.
I want to use select list and automation rule instead of scripts.
This is the automation I’ve got setup
- alias: 'Xiaomi Vacuum Zone Cleaning'
hide_entity: True
trigger:
platform: state
entity_id: input_select.xiaomi_vacuum_cleaner_zone
condition:
condition: template
value_template: '{{ trigger.to_state.state != "Select" }}'
action:
- service: vacuum.xiaomi_clean_zone
data_template:
zone: >
{% if trigger.to_state.state == "Kitchen" %}
[[34050, 27950, 35900, 29250]]
{% elif trigger.to_state.state == "Living Room" %}
[[31000, 24350, 37200, 27900]]
{% elif trigger.to_state.state == "Hole Room" %}
[[28000, 25900, 31000, 27500]]
{% elif trigger.to_state.state == "Bedroom" %}
[[25500, 25300, 28000, 26700]]
{% else %}
[[25500, 25300, 28000, 26700]]
{% endif %}
entity_id: vacuum.xiaomi_robot_vacuum_cleaner
repeats: 2
Problem is that I’m getting error like this:
Error while executing automation automation.xiaomi_vacuum_zone_cleaning. Invalid data for call_service at pos 1: expected list for dictionary value @ data['zone']
Problem doesn’t occure if I’m not using if/else statement, but passing single parameter.
Thanks in advance