Hi All,
I’ve done the Advanced Mode described on the docs page here: Advanced - DeebotUniverse
But I have an issue with this script:
deebot_clean:
description: Start a deebot cleaning task
variables:
queue: input_text.deebot_gregorio_queue
vacuum_bot: vacuum.gregorio
sequence:
- alias: Get room numbers
variables:
# See for appending to list
# https://github.com/home-assistant/core/issues/33678#issuecomment-609424851
rooms: >-
{%- set queue_split = states(queue).split(",") -%}
{%- set rooms = state_attr(vacuum_bot, "rooms")-%}
{%- set data = namespace(rooms=[]) -%}
{%- for room_name in queue_split -%}
{%- set data.rooms = data.rooms + [rooms[room_name]] -%}
{%- endfor -%}
{{ data.rooms | join(",") }}
- alias: Send cleaning job to vacuum
service: vacuum.send_command
data:
entity_id: "{{ vacuum_bot }}"
command: spot_area
params:
rooms: "{{ rooms }}"
cleanings: 2
I changed correctly these two variables:
queue: input_text.deebot_gregorio_queue
vacuum_bot: vacuum.gregorio
and the input_text.deebot_gregorio_queue
state is equal to 0,1,2,3,4,5,6,7,8 which are the rooms selected to clean.
The attribute ‘rooms’ of vacuum.gregorio is only {} I think here is the issue, so when I execute the script, this is the output on the trace:
params:
domain: vacuum
service: send_command
service_data:
entity_id: vacuum.gregorio
command: spot_area
params:
rooms: ',,,,,,,,'
cleanings: 2
target: {}
running_script: false
how you can see the rooms param has only commas rooms: ',,,,,,,,'
I really don’t get what the script does with variable rooms
, is the first script that I’m trying to use and modify.
The only thing that I would like is that the state of input_text.deebot_gregorio_queue
(which is = ‘0,1,2,3,4,5,6,7,8’) is used in the rooms parameter.
Can someone help me please? Thanks!
Edit: ok a resolved this issue using simply:
rooms: >-
{%- set lista = states(queue) -%}
{{ lista }}